/* IncidentPeopleComponent (app/components/incident_people_component.rb): Who was there on an incident, redrawn in NS6 (14 Oct 2026) so the people read at a glance. Number 32: free, and unique
   (test/styles/stylesheet_test.rb); the older rules for the panel in 61-incidents.css and 68-case-page-layout.css are gone, so nothing later overrides these.

   The panel holds groups (the people involved, the witnesses, who reported it or responded), each under a small heading with its count and its people as cards that fill the row and wrap (one to a
   row on a phone). A card: the monogram, then the name and the role as a badge, then badges for what stands about them here (withdrawn, their cases here, their referrals from here), then when
   they were recorded and the history, and the actions in one row at its foot. Every state is said in words; a tone is a second signal and never the only one (WCAG 1.4.1).

   Tokens only and logical properties only (test/styles/tokens_test.rb, test/styles/components_test.rb): it reads in light and dark, on the shell and the console, and mirrors in a right-to-left
   language. Nothing pinned, no fixed widths on text, everything that holds words may shrink and wrap (WCAG 1.4.10), and every control is at least 24 CSS px, 44 on touch (WCAG 2.5.8). */

.incident-people {
  min-inline-size: 0;
}

.incident-people-groups {
  display: grid;
  gap: var(--space-4);
  min-inline-size: 0;
}

.incident-people-group {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.incident-people-group-heading {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.incident-people-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-3);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A PERSON is a card: the monogram in the first column, everything said about them in the second, the actions at its foot. Cards fill the row and wrap, one to a row on a phone. */
.incident-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  column-gap: var(--space-3);
  row-gap: var(--space-3);
  align-items: start;
  min-inline-size: 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

/* A withdrawn person's card is drawn with a dashed edge on the sunken surface; the badge says it in words. */
.incident-person-is-withdrawn {
  border-style: dashed;
  background: var(--surface-sunken);
}

.incident-person > .avatar {
  margin-block-start: 0.1rem;
}

/* Someone nobody identified has no monogram to draw: a quiet question mark on the muted tone, in the same circle. Decoration, hidden from assistive technology. */
.incident-person-avatar-unknown {
  border: 1px dashed var(--tone-mute-line);
  background: var(--tone-mute-bg);
  color: var(--tone-mute-fg);
}

.incident-person-body {
  display: grid;
  gap: var(--space-1);
  min-inline-size: 0;
}

.incident-person p {
  min-inline-size: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.incident-person-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-inline-size: 0;
}

.incident-person-name {
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.3;
}

.incident-person-name bdi {
  unicode-bidi: isolate;
}

.incident-person-unidentified {
  color: var(--fg2);
  font-weight: 400;
}

.incident-person-role {
  display: inline-flex;
}

/* What stands about the person here: badges that wrap, a case a link that looks like one of them. */
.incident-person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.incident-person-chips > li {
  display: inline-flex;
  min-inline-size: 0;
  max-inline-size: 100%;
}

/* A case here is a link: underlined, so it is not taken for a word, and the badge's least height is a pointer's target (WCAG 2.5.8). */
.incident-person-case.pill {
  min-block-size: 1.5rem;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  border-color: var(--tone-accent-line);
  background: var(--tone-accent-bg);
  color: var(--tone-accent-fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.incident-person-case.pill:hover {
  text-decoration-thickness: 2px;
}

.incident-person-case.pill:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.incident-person-recorded {
  color: var(--fg2);
  font-size: var(--text-xs);
}

/* A withdrawn person: said in words (the badge), and the name is quieter as a second signal. */
.incident-person-is-withdrawn .incident-person-name,
.incident-person-is-withdrawn .incident-person-link {
  color: var(--fg2);
}

.incident-person-history {
  min-inline-size: 0;
  font-size: var(--text-sm);
}

.incident-person-history summary {
  display: flex;
  align-items: center;
  min-block-size: 1.5rem;
  color: var(--fg2);
  cursor: pointer;
}

.incident-person-history ol {
  margin: var(--space-1) 0 0;
  padding-inline-start: 1.25rem;
}

.incident-person-history li {
  overflow-wrap: anywhere;
}

/* THE ACTIONS: one compact row at the card's foot, under the name. */
.incident-person-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  min-inline-size: 0;
}

/* More than one office to refer to: one button that opens the list of them, in the flow (never a popover pinned over the page), each a target of its own. */
.incident-person-refer {
  min-inline-size: 0;
}

.incident-person-refer > summary {
  list-style: none;
  cursor: pointer;
}

.incident-person-refer > summary::-webkit-details-marker {
  display: none;
}

.incident-person-refer-list {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding: var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  list-style: none;
}

.incident-person-refer-link {
  display: flex;
  align-items: center;
  min-block-size: 1.5rem;
  padding-inline: var(--space-1);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.incident-person-refer-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .incident-person-history summary,
  .incident-person-case.pill,
  .incident-person-refer-link {
    min-block-size: var(--target-min);
  }
}

/* Add a person ends the panel's body, as Add a note and Add a file end theirs: a button at the start, under a hairline (the foot is for where the facts came from). */
.incident-people-add {
  min-inline-size: 0;
  margin-block-start: var(--space-3);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--rule);
}
