/* The conversation index — an editorial "table of contents" page for all
   conversations, replacing the old in-place sidebar search. */

.chat-index {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: var(--nv-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--nv-sp-6);
}

.chat-index[hidden] { display: none; }

.chat-index__page {
  width: min(640px, 100%);
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--nv-r-lg);
  box-shadow: 0 24px 60px var(--nv-shadow-ink-strong);
  padding: var(--nv-sp-6) var(--nv-sp-7);
}

.chat-index__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--nv-sp-3);
  padding-bottom: var(--nv-sp-4);
  border-bottom: 3px double var(--rule-strong);
}

.chat-index__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre-ink);
}

.chat-index__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
  line-height: 1.15;
}

.chat-index__close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--nv-r-sm);
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
}

.chat-index__close:hover,
.chat-index__close:focus-visible {
  border-color: var(--moss);
  color: var(--moss);
  outline: none;
}

.chat-index__search {
  display: flex;
  align-items: center;
  gap: var(--nv-sp-2);
  margin: var(--nv-sp-4) 0 var(--nv-sp-3);
  padding-bottom: var(--nv-sp-2);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--nv-text-muted);
}

.chat-index__search:focus-within { color: var(--moss); border-color: var(--moss); }

.chat-index__search input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.chat-index__list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-index__row {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--nv-sp-4);
  padding: var(--nv-sp-3) var(--nv-sp-2);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  transition: background var(--nv-ease);
}

.chat-index__row:hover,
.chat-index__row:focus-visible {
  background: var(--nv-tint-accent-low);
  outline: none;
}

.chat-index__row-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-index__row-date {
  flex: none;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ochre-ink);
}

.chat-index__note {
  margin-top: var(--nv-sp-4);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .chat-index__row { transition: none; }
}
