/* grid.css — View 1: spine groups + cell cards. The glanceable triage surface.
   The engineer scans this to see, at a glance: which baselines exist, which have
   clean runs, and what finding bears on each. So verdict and epistemic state are
   pushed to read PRE-attentively (chip fill + left tick), not as buried text. */

.matrix-intro {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 760px;
}
.matrix-intro strong {
  color: var(--text-primary);
}

.spine-group {
  margin-bottom: 30px;
}
.spine-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--edge);
}
.spine-title {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
  text-transform: uppercase;
}
.spine-sub {
  font-size: 12.5px;
  color: var(--text-meta);
  line-height: 1.4;
}
.spine-empty {
  color: var(--text-faint);
  font-size: 13px;
  font-style: italic;
}

.cell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: var(--gap);
}

.cell-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-base), transform var(--t-base),
    box-shadow var(--t-base), background var(--t-base);
}
.cell-card:hover {
  border-color: var(--hover-border);
  background: var(--card-bg-hover);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.cell-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-card);
}
.cell-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.cell-coords {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

/* Verdict chip — the run-count + glyph, made glanceable. Each state carries its
   own tinted pill so the eye finds "which cells have clean baselines" instantly. */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}
.verdict--none {
  color: var(--none);
  background: var(--inset-bg);
  border-color: var(--divider);
}
.verdict--clean {
  color: var(--clean-bright);
  background: var(--clean-bg);
  border-color: color-mix(in srgb, var(--clean) 45%, transparent);
}
.verdict--warn {
  color: var(--warn-bright);
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}
.cell-ctrl {
  font-size: 11.5px;
  color: var(--text-meta);
  margin-top: 8px;
}
.cell-ctrl strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Annotation hint — the one finding that bears on the cell. Epistemic color is
   reinforced with a left tick so it is not carried by hue alone (a11y). */
.cell-hint {
  position: relative;
  margin-top: 10px;
  padding: 8px 0 0 10px;
  border-top: 1px dashed var(--edge);
  font-size: 12px;
  color: var(--measured);
  line-height: 1.4;
}
.cell-hint::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 1px;
  width: 2px;
  border-radius: 1px;
  background: var(--measured);
}
.cell-hint--inferred {
  color: var(--inferred);
}
.cell-hint--inferred::before {
  background: var(--inferred);
}

/* Deferred collapsed group — informational, recedes from the working spines. */
.spine-group--deferred .spine-header {
  cursor: pointer;
  user-select: none;
  transition: border-color var(--t-quick);
}
.spine-group--deferred .spine-header:hover {
  border-color: var(--hover-border);
}
.spine-group--deferred .deferred-toggle {
  margin-left: auto;
  color: var(--text-meta);
  font-family: var(--mono);
  transition: transform var(--t-base);
}
.spine-group--deferred.is-open .deferred-toggle {
  transform: rotate(90deg);
}
.spine-group--deferred .deferred-body {
  display: none;
}
.spine-group--deferred.is-open .deferred-body {
  display: grid;
}
.deferred-item {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-meta);
  background: var(--inset-bg);
  border: 1px dashed var(--edge);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
