/* findings.css — Findings page and the FindingRow list (ui/alert.rs), which
   Overview and scan detail use too. */

.fd-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
}
.fd-search { flex: 0 1 320px; min-width: 0; }

/* ---------- FindingRow: severity · CVE + title · package · where ---------- */
.fd-rows {
  container-type: inline-size;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.fd-rows--flush { border: 0; border-radius: 0; background: transparent; }
.fd-rows--flush .fd-row:first-child { border-top: 1px solid var(--border); }
.fd-rows__list { list-style: none; margin: 0; padding: 0; }

.fd-row {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.3fr);
  gap: var(--space-4);
  align-items: center;
  min-height: 44px;
  padding: 8px var(--space-4);
  border-top: 1px solid var(--border);
  font: 400 13px/20px var(--font-sans);
  color: var(--ink-muted);
}
.fd-rows__list > .fd-row:first-child { border-top: 0; }
.fd-row--head + .fd-rows__list > .fd-row:first-child { border-top: 1px solid var(--border); }
.fd-row:hover { background: var(--surface-raised); }
.fd-row:has(.fd-row__id:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.fd-row--head {
  min-height: 36px; padding-top: 6px; padding-bottom: 6px; border-top: 0;
  font: 600 11px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-raised);
}

.fd-row__sev { display: flex; }
.fd-row__main { min-width: 0; display: flex; align-items: baseline; gap: var(--space-3); }
/* the CVE link covers the whole row; the target link sits above it */
.fd-row__id { flex: none; font: 500 13px/20px var(--font-mono); color: var(--ink); text-decoration: none; }
.fd-row__id::after { content: ""; position: absolute; inset: 0; }
.fd-row__id:hover { color: var(--grape); text-decoration: underline; }
.fd-row__id:focus-visible { outline: none; }
.fd-row__title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-muted); }
.fd-row__title.is-empty { font-style: italic; }

.fd-row__info { display: contents; }
.fd-row__pkg { min-width: 0; display: flex; align-items: baseline; gap: var(--space-2); }
.fd-row__pkg code { font: 500 13px/20px var(--font-mono); color: var(--ink); background: none; padding: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fd-row__eco { flex: none; font-size: 12px; color: var(--ink-muted); }
.fd-row__conf { position: relative; z-index: 1; color: var(--warn-text); align-self: center; }

.fd-row__where { min-width: 0; display: flex; align-items: center; gap: 6px; }
.fd-row__kind { flex: none; display: inline-flex; color: var(--ink-muted); }
.fd-row__kind .mc-ico { width: 16px; font-size: 13px; }
.fd-row__target { position: relative; z-index: 1; flex: 0 1 auto; min-width: 0; font: 500 13px/20px var(--font-mono);
  color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-row__target:hover { color: var(--grape); text-decoration: underline; }
.fd-row__src { flex: 1 1 0; min-width: 0; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.fd-row__target + .fd-row__src::before { content: "\00B7\00a0"; }

/* Medium width (Overview panel, tablets): drop the "where" column. */
@container (max-width: 760px) {
  .fd-row { grid-template-columns: 112px minmax(0, 1fr) minmax(0, 0.8fr); }
  .fd-row__where, .fd-row--head > :last-child { display: none; }
  .fd-row__main { flex-direction: column; align-items: stretch; gap: 0; }
}
/* Narrow (phones): badge + CVE id, then the title, then package · target. */
@container (max-width: 520px) {
  .fd-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "sev id" "title title" "info info";
    row-gap: 2px; column-gap: var(--space-3); padding: 10px var(--space-4);
  }
  .fd-row--head { display: none; }
  .fd-row__main { display: contents; }
  .fd-row__sev { grid-area: sev; }
  .fd-row__id { grid-area: id; align-self: center; }
  .fd-row__title { grid-area: title; }
  .fd-row__info { grid-area: info; display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); min-width: 0; }
  .fd-row__pkg { flex: 0 1 auto; }
  .fd-row__eco { display: none; }
  .fd-row__where { display: flex; flex: 0 1 auto; justify-content: flex-end; }
  .fd-row__where .fd-row__target + .fd-row__src { display: none; }
}

/* ---------- Pager ---------- */
.fd-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.fd-pager__range { font: 400 13px/20px var(--font-sans); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.fd-pager .mc-btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 640px) {
  .fd-search { flex: 1 1 100%; }
}
