/* ============================================================
   chain-next.css — the F-tag strip (chain-strip.js)
   One row of chips per building + F-tag: citation, audits, QAPI project,
   Mock Survey, policies. Used on the POC closeout page, the Mock Survey
   finding drawer, Audit Capture rows, QAPI project cards and the F-tag
   library. Prefix .chn-, tokens from ivy-refresh.css only.
   ============================================================ */

.chn {
  --chn-ok-line: color-mix(in srgb, var(--ok) 30%, transparent);
  --chn-warn-line: color-mix(in srgb, var(--warn) 30%, transparent);
  --chn-danger-line: color-mix(in srgb, var(--danger) 30%, transparent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-family: var(--font-sans);
}
.chn[hidden] { display: none; }
.chn:empty { margin: 0; padding: 0; }

.chn-ico {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chn-tag,
.chn-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  position: relative;
}
.chn-tag {
  background: var(--teal-soft);
  border-color: var(--teal-line);
  color: var(--teal-deep);
  font-weight: 700;
  letter-spacing: .01em;
}
.chn-tag.is-quiet { background: var(--muted-surface); border-color: var(--line); color: var(--muted); }
.chn-t { overflow: hidden; text-overflow: ellipsis; }

.chn-chip.is-ok { background: var(--ok-soft); border-color: var(--chn-ok-line); color: var(--ok-ink); }
.chn-chip.is-warn { background: var(--warn-soft); border-color: var(--chn-warn-line); color: var(--warn-ink); }
.chn-chip.is-danger { background: var(--danger-soft); border-color: var(--chn-danger-line); color: var(--danger-ink); }
.chn-chip.is-neutral { background: var(--card); border-color: var(--line); color: var(--fg-soft); }

a.chn-chip:hover,
a.chn-tag:hover { border-color: var(--teal); box-shadow: var(--shadow-sm); }
a.chn-chip:focus-visible,
a.chn-tag:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* The link that IS this screen: shown, not a link. */
.chn-chip.is-here { border-style: dashed; cursor: default; }

.chn-wait { color: var(--muted); font-size: var(--fs-sm); }

/* Screen-reader word for the tone (the icon carries it visually). */
.chn-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Spacing where a screen drops the strip in. */
.chn-row { margin: 0 0 14px; }
.chn-row:has(> .chn[hidden]) { margin: 0; }
.chn-in-card { margin-top: 10px; }

@media (max-width: 720px) {
  .chn { gap: 5px; }
  .chn-tag,
  .chn-chip { min-height: 30px; font-size: var(--fs-sm); padding: 3px 9px; white-space: normal; }
}
