/* The index view.
 *
 * Dense and scannable, because this gets read every morning and a spacious layout would mean four
 * items per screen. The reference here is a list view, not a landing page — Linear's issue list and
 * Hacker News rather than a marketing site.
 *
 * Provenance is styled to be *legible but quiet*: present on every value, never shouting. If it
 * shouted, a reader would learn to tune it out, and then it would be decoration. */

.index-wrap { max-width: 58rem; }

/* ── status ── */
.status {
  padding: .7rem .95rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  font-size: .92rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}
.status.ok { border-left-color: #1e8449; }
.status.bad {
  border-left-color: #c0392b;
  background: color-mix(in srgb, #c0392b 6%, transparent);
  color: var(--ink);
}
.status b { color: var(--ink); }
.status .mono { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); display: block; margin-top: .3rem; }
@media (prefers-color-scheme: dark) {
  .status.ok { border-left-color: #5ad18a; }
  .status.bad { border-left-color: #ff8b7d; }
}

/* ── tabs ── */
.tabs { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.tabs button {
  font: inherit; font-size: .9rem; cursor: pointer;
  padding: .45rem .95rem; border-radius: 5px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
}
.tabs button:hover { border-color: var(--ink-faint); color: var(--ink); }
.tabs button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tab-count { margin-left: auto; font-size: .82rem; color: var(--ink-faint); }
.tab-count b { color: var(--ink-soft); }

.legend {
  font-size: .82rem; color: var(--ink-faint); line-height: 1.7;
  padding-bottom: .9rem; border-bottom: 1px solid var(--line); margin: 0 0 .3rem;
}

/* ── rows ── */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 1.25rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.row:last-child { border-bottom: 0; }
.row-title { font-size: 1rem; line-height: 1.45; font-weight: 550; }
.row-sub { margin-top: .25rem; color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }
.row-sub .co { font-weight: 600; color: var(--ink); }
.row-sub .loc { margin-left: .6rem; color: var(--ink-faint); }

/* The classifier's own reason, shown rather than hidden. A filter you cannot inspect is a filter you
   cannot tune, and this is the line that makes a wrong decision diagnosable. */
.row-why {
  margin-top: .35rem;
  font-size: .82rem;
  color: var(--ink-faint);
  line-height: 1.55;
  padding-left: .7rem;
  border-left: 2px solid var(--line);
}
.row-why b { font-weight: 600; }

.row-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: .3rem;
  font-size: .78rem; color: var(--ink-faint); white-space: nowrap;
}
.age { font-variant-numeric: tabular-nums; }

.srcs { display: flex; gap: .4rem; align-items: center; }
.srcs a { font-family: var(--mono); font-size: .74rem; }
.srcs .more { color: var(--ink-faint); font-size: .74rem; }

.yrs { font-family: var(--mono); font-size: .74rem; }
/* Absent is a finding, not a blank — it is the whole reason the column exists. */
.yrs-none { color: var(--accent); }

.review {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: #c0392b; border: 1px solid currentColor; border-radius: 3px; padding: .05rem .35rem;
}
@media (prefers-color-scheme: dark) { .review { color: #ff8b7d; } }

/* ── provenance ── */
.v-low { border-bottom: 1px dotted var(--ink-faint); }
.prov {
  font-family: var(--mono); font-size: .68rem; color: var(--ink-faint);
  margin-left: .45rem; white-space: nowrap;
}
/* An inferred value is marked differently from a sourced one. They must never look alike. */
.prov-model { color: var(--accent); }

/* Block only inside a row, where it sits under the value it disagrees with. Scoped, because the
   legend mentions it mid-sentence and an unscoped `display:block` broke that sentence over three
   lines — the same class doing two jobs in two places. */
.row .conflict {
  display: block; margin-top: .25rem;
  padding-left: .6rem; border-left: 2px solid var(--accent);
}
.conflict { font-size: .8rem; color: var(--ink-faint); }
.legend .conflict { color: var(--accent); font-family: var(--mono); }
.conflict a { font-size: .74rem; }

.empty { color: var(--ink-faint); padding: 2rem 0; }

@media (max-width: 40rem) {
  .row { grid-template-columns: 1fr; }
  .row-meta { flex-direction: row; align-items: center; gap: .6rem; flex-wrap: wrap; }
}

/* ── search ── */
/* Keyword search over the same records as the list below. Styled as part of the list, not a hero:
   the page is still a list view. Hidden until /api/search answers a probe. */
.search { margin: 0 0 1.5rem; }
.search-label { display: block; font-size: .82rem; color: var(--ink-faint); margin-bottom: .35rem; }
.search-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-bar input {
  flex: 1 1 14rem; min-width: 0;
  font: inherit; font-size: .95rem;
  padding: .45rem .7rem; border-radius: 5px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input:focus-visible,
.search-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-bar button {
  font: inherit; font-size: .9rem; cursor: pointer;
  padding: .45rem .95rem; border-radius: 5px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent); font-weight: 600;
}
.search-bar .search-clear { border-color: var(--line); color: var(--ink-soft); font-weight: 400; }
.search-note { font-size: .8rem; color: var(--ink-faint); margin: .45rem 0 0; min-height: 1em; }
.search-results { border-bottom: 1px solid var(--line); margin-top: .3rem; }
.search-kind {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint);
}
