/* Semantic search panel. Uses the tokens defined in predict.css so the two
   halves of the page read as one, and so both themes come for free. */

.search {
  margin-bottom: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.search-row input[type="search"] {
  flex: 1 1 22rem;
  min-width: 0;
  font-family: var(--voice);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.5rem 0.65rem;
}

.search-row input[type="search"]::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.search-row input:focus-visible,
.search-row button:focus-visible {
  outline: 2px solid var(--rise);
  outline-offset: 1px;
}

.search-row button {
  font-family: var(--voice);
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--card);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
}

.search-row button:hover {
  background: var(--rise);
  border-color: var(--rise);
}

.search-status {
  font-family: var(--data);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin: 0.55rem 0 0;
}

/* A quiet pulse while the model loads: 130 MB takes a moment and silence
   reads as a broken page. */
.search-status.working::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.5em;
  border-radius: 50%;
  background: var(--rise);
  vertical-align: middle;
}

@media (prefers-reduced-motion: no-preference) {
  .search-status.working::after {
    animation: pulse 1.1s ease-in-out infinite;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.res-head {
  font-family: var(--voice);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 1.2rem 0 0.4rem;
}

.res-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.res {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.5rem;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  font: inherit;
  color: inherit;
}

/* Only a frame is actionable: it selects the ranking below. A narrative is
   evidence, so it does not pretend to be a button. */
button.res {
  cursor: pointer;
}

button.res:hover,
button.res:focus-visible {
  background: var(--rise-soft);
}

.sim {
  font-family: var(--data);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}

.res-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.res-title {
  font-family: var(--quote);
  font-size: var(--step-0);
  line-height: 1.35;
  color: var(--ink);
}

button.res .res-title {
  font-family: var(--voice);
  font-weight: 600;
}

.res-sub,
.res-trigger {
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.res-trigger {
  font-style: italic;
}

.empty {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin: 1rem 0 0;
  max-width: 44rem;
}

/* A frame picked from the search is marked in the ranking below, so the
   handoff from words to numbers is visible. */
ol.ranking > li.picked {
  background: var(--rise-soft);
}
