/* ==================================================================
   matching-identity.css - Group E of the Incoming matching canon
   ------------------------------------------------------------------
   The applicant's Identity panel (verified identifiers) and the
   Applicant File's matched-document history. Lifts beside all-files.css,
   af-requirements.css and threshold-file-responsibility.css.

   Lifted from docs/design-canon/threshold-incoming-matching/
   matching-identity.css (Incoming matching contract C21). Loaded after
   threshold-file-responsibility.css.

   The panel is the Responsibility drawer's family (non-modal, right,
   460px, sunk paper, cards with kicker heads). It keeps its own
   th-mx-id-* atoms (C21); they are not remapped onto th-resp-*.

   Every rule that touches a shipped atom (.th-modal, .th-field,
   .th-radio, .cc-pill) is scoped under the identity dialogs' own root,
   .th-mx-id-dialog, so no other surface changes.

   Tokens only; both themes come from threshold-tokens.css.
   ================================================================== */

/* ---------- entry point on the file's identity line ---------- */
.th-mx-id-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  margin: -2px 0;
  border: 1px solid var(--th-line);
  border-radius: var(--th-radius-pill);
  background: var(--th-paper-sunk);
  font: inherit;
  font-size: var(--th-size-12);
  color: var(--th-ink);
  cursor: pointer;
  white-space: nowrap;
}
.th-mx-id-entry > svg { color: var(--th-advant); flex: none; }
.th-mx-id-entry > span:first-of-type { font-weight: 600; }
.th-mx-id-entry__count { color: var(--th-ink-2); }
.th-mx-id-entry:hover { border-color: var(--th-line-2); background: var(--th-paper-2); }
.th-mx-id-entry:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-mx-id-entry[aria-expanded="true"] { border-color: var(--th-advant); background: var(--th-advant-soft); }

/* ---------- drawer (Responsibility drawer family, non-modal) ---------- */
.th-mx-id-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100%;
  background: var(--th-paper-sunk);
  border-left: 1px solid var(--th-line-2);
  box-shadow: -12px 0 36px color-mix(in oklab, var(--th-ink) 14%, transparent);
  z-index: 55;
  display: flex;
  flex-direction: column;
  font-family: var(--th-font-sans);
  color: var(--th-ink);
  font-size: 13px;
}
.th-mx-id-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--th-line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: none;
}
.th-mx-id-head__text { flex: 1; min-width: 0; }
.th-mx-id-title { margin: 0; font: 600 17px var(--th-font-serif); color: var(--th-ink); }
.th-mx-id-title:focus { outline: none; }
.th-mx-id-meta { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--th-ink-2); }
.th-mx-id-meta__name { font-weight: 600; color: var(--th-ink); }
.th-mx-id-meta__scope::before { content: "·"; margin-right: 8px; color: var(--th-ink-4); }
.th-mx-id-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--th-radius-3);
  color: var(--th-ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  flex: none;
}
.th-mx-id-close:hover { background: var(--th-paper-2); color: var(--th-ink); }
.th-mx-id-close:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; }
.th-mx-id-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.th-mx-id-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- cards ---------- */
.th-mx-id-card { border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper); min-width: 0; }
.th-mx-id-card__head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--th-line);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.th-mx-id-card__head > .th-kicker { margin: 0; }
.th-mx-id-card__meta { font-size: 11.5px; color: var(--th-ink-2); }
.th-mx-id-card__foot {
  padding: 10px 12px;
  border-top: 1px solid var(--th-line-soft);
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.th-mx-id-card__foot:empty { display: none; }

/* ---------- identifier rows ---------- */
.th-mx-id-list { list-style: none; margin: 0; padding: 0; }
.th-mx-id-row { padding: 12px; border-top: 1px solid var(--th-line-soft); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.th-mx-id-row:first-child { border-top: 0; }
.th-mx-id-row.is-fresh { background: var(--th-ok-soft); box-shadow: inset 3px 0 0 var(--th-ok); }
.th-mx-id-row__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-mx-id-kind { font-size: 12px; font-weight: 600; color: var(--th-ink-2); }
.th-mx-id-value { font-family: var(--th-font-mono); font-size: 15px; letter-spacing: 0.01em; color: var(--th-ink); overflow-wrap: anywhere; }
.th-mx-id-value.is-past { font-size: 13px; color: var(--th-ink-2); }
.th-mx-id-facts {
  margin: 2px 0 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 4px 12px;
  font-size: 12.5px;
  line-height: 1.45;
}
.th-mx-id-facts dt { color: var(--th-ink-2); font-weight: 400; }
.th-mx-id-facts dd { margin: 0; color: var(--th-ink); min-width: 0; overflow-wrap: anywhere; }
.th-mx-id-ev { display: inline-flex; flex-direction: column; gap: 2px; }
.th-mx-id-quiet { color: var(--th-ink-2); }
.th-mx-id-link { color: var(--th-advant); text-decoration: none; }
.th-mx-id-link:hover { color: var(--th-advant-deep); }
.th-mx-id-link:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; border-radius: var(--th-radius-2); }
.th-mx-id-row__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* disputed: status is a word and a dot, never colour alone (th-resp-attn grammar) */
.th-mx-id-dispute { margin-top: 2px; border: 1px solid var(--th-warn); border-radius: var(--th-radius-5); background: var(--th-warn-soft); padding: 9px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.th-mx-id-dispute__head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; color: var(--th-warn-ink); }
.th-mx-id-dispute__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--th-warn-ink); box-shadow: 0 0 0 2px color-mix(in oklab, var(--th-warn-ink) 18%, transparent); flex: none; }
.th-mx-id-dispute__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.th-mx-id-dispute__list > li { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.th-mx-id-dispute__what { min-width: 0; overflow-wrap: anywhere; }
.th-mx-id-dispute__meta { color: var(--th-ink-2); font-size: 12px; }
.th-mx-id-dispute__note { color: var(--th-ink); font-size: 12px; }
.th-mx-id-dispute__means { margin: 0; padding-top: 6px; border-top: 1px solid color-mix(in oklab, var(--th-warn) 40%, transparent); font-size: 12px; line-height: 1.5; color: var(--th-ink); }

/* empty state */
.th-mx-id-empty { padding: 14px 12px 4px; display: flex; flex-direction: column; gap: 6px; }
.th-mx-id-empty__title { margin: 0; font: 600 14px var(--th-font-serif); color: var(--th-ink); }
.th-mx-id-empty__text { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--th-ink-2); }
.th-mx-id-empty-line { margin: 0; padding: 12px; font-size: 12.5px; color: var(--th-ink-2); }

/* access line for a reader without the manage key */
.th-mx-id-access { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.5; color: var(--th-ink-2); }
.th-mx-id-access > svg { flex: none; margin-top: 3px; color: var(--th-ink-3); }

/* Past disclosure */
.th-mx-id-past { border-top: 1px solid var(--th-line-soft); }
.th-mx-id-past > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--th-ink);
  cursor: pointer;
}
.th-mx-id-past > summary::-webkit-details-marker { display: none; }
.th-mx-id-past > summary > svg { color: var(--th-ink-3); transition: transform 120ms ease; flex: none; }
.th-mx-id-past[open] > summary > svg { transform: rotate(90deg); }
.th-mx-id-past > summary:focus-visible { outline: 2px solid var(--th-advant); outline-offset: -2px; }
.th-mx-id-past__count { font-weight: 400; color: var(--th-ink-2); }
.th-mx-id-past__lede { margin: 0; padding: 0 12px 8px 32px; font-size: 12px; line-height: 1.5; color: var(--th-ink-2); }
.th-mx-id-past__list { list-style: none; margin: 0; padding: 0 0 4px; }
.th-mx-id-past__row { margin: 0 12px 8px; padding: 10px 12px; border: 1px dashed var(--th-line); border-radius: var(--th-radius-3); display: flex; flex-direction: column; gap: 5px; background: var(--th-paper-sunk); }
.th-mx-id-past__row .th-mx-id-facts { color: var(--th-ink-2); }

/* activity: th-history__row from the operational sheet, sized for the drawer */
.th-mx-id-acts { list-style: none; margin: 0; padding: 0; }
.th-mx-id-acts > .th-history__row { grid-template-columns: 92px minmax(0, 1fr); padding: 9px 12px; }
.th-mx-id-acts > .th-history__row:last-child { border-bottom: 0; }
.th-mx-id-act .th-history__what { font-size: 12.5px; overflow-wrap: anywhere; }
.th-mx-id-act.is-warn .th-history__what { color: var(--th-warn-ink); }
.th-mx-id-act.is-ok .th-history__what { color: var(--th-ok-ink); }
.th-mx-id-act__reason { margin-top: 3px; font-size: 12px; line-height: 1.45; color: var(--th-ink); padding-left: 8px; border-left: 2px solid var(--th-line); }
.th-mx-id-act__link { margin-top: 3px; font-size: 12px; }

/* loading */
.th-mx-id-loading { margin: 0; font-size: 12.5px; color: var(--th-ink-2); }
.th-mx-id-skel { padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.th-mx-id-skel__line { display: block; height: 10px; width: 70%; border-radius: var(--th-radius-2); background: var(--th-paper-2); }
.th-mx-id-skel__line.is-short { width: 32%; }
.th-mx-id-skel__line.is-mid { width: 52%; }
.th-mx-id-skel__line.is-value { height: 16px; width: 44%; }

/* ---------- dialogs ---------- */
.th-mx-id-lede { margin: 0; font-size: 13px; line-height: 1.55; color: var(--th-ink); }
.th-mx-id-mono { font-family: var(--th-font-mono); }
.th-input.th-mx-id-mono { letter-spacing: 0.02em; }
.th-mx-id-help { font-size: 11.5px; line-height: 1.4; color: var(--th-ink-2); }
.th-mx-id-opt { font-weight: 400; color: var(--th-ink-3); margin-left: 4px; }
.th-mx-id-evidence { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper); }
.th-mx-id-dialog .th-field > select.th-input { width: 100%; }
.th-mx-id-dialog .th-radiolist > .th-radio:last-child { border-bottom: 0; }
.th-mx-id-dialog .th-radio[aria-disabled="true"] { cursor: not-allowed; }
.th-mx-id-dialog .th-radio[aria-disabled="true"] .th-radio__text > span:first-child { color: var(--th-ink-2); }
.th-mx-id-dialog .th-radio > .cc-pill { flex: none; }

/* Correct: from and to */
.th-mx-id-move { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.th-mx-id-move__side { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--th-line); border-radius: var(--th-radius-3); background: var(--th-paper); min-width: 0; }
.th-mx-id-move__side.is-open { border-style: dashed; background: transparent; }
.th-mx-id-move__side.is-open .th-mx-id-move__name { color: var(--th-ink-2); font-weight: 400; }
.th-mx-id-move__name { font-size: 13px; font-weight: 600; color: var(--th-ink); overflow-wrap: anywhere; }
.th-mx-id-move__meta { font: 11.5px var(--th-font-mono); color: var(--th-ink-2); }
.th-mx-id-move__arrow { align-self: center; color: var(--th-ink-3); display: grid; place-items: center; }
.th-mx-id-find { max-width: none; background: var(--th-paper); }

/* Revoke: what stops, what stays */
.th-mx-id-impact { display: flex; flex-direction: column; gap: 8px; color: var(--th-ink); }
.th-mx-id-impact__row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }

/* ---------- Requirements & documents: matched documents ---------- */
.th-mx-id-automark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 16px;
  color: var(--th-ink-2);
  white-space: nowrap;
}
.th-mx-id-automark > svg { color: var(--th-advant); flex: none; }
.th-mx-id-hist { align-items: flex-start; }
.th-mx-id-hist .af-req-history-text { min-width: 0; align-items: flex-start; }
.th-mx-id-hist.is-report > svg { color: var(--th-risk-ink); }
.th-mx-id-hist.is-report b { font-weight: 600; color: var(--th-ink); }
.th-mx-id-why {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--th-advant);
  cursor: pointer;
}
.th-mx-id-why > svg { transition: transform 120ms ease; }
.th-mx-id-why[aria-expanded="true"] > svg { transform: rotate(90deg); }
.th-mx-id-why:hover { color: var(--th-advant-deep); }
.th-mx-id-why:focus-visible { outline: 2px solid var(--th-advant); outline-offset: 2px; border-radius: var(--th-radius-2); }
.th-mx-id-set { margin-top: 4px; color: var(--th-ink); font-weight: 500; }
.th-mx-id-setlist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; color: var(--th-ink); }

/* the recorded comparison (read-only) */
.th-mx-id-record { margin: 2px 0 2px 22px; border: 1px solid var(--th-line); border-radius: var(--th-radius-5); background: var(--th-paper-sunk); padding: 10px 12px 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.th-mx-id-record__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-mx-id-record__ro { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--th-ink-2); }
.th-mx-id-record__facts { margin: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 12px; font-size: 12.5px; line-height: 1.45; }
.th-mx-id-record__facts dt { color: var(--th-ink-2); font-weight: 400; }
.th-mx-id-record__facts dd { margin: 0; color: var(--th-ink); min-width: 0; overflow-wrap: anywhere; }
.th-mx-id-record__facts .cc-pill { vertical-align: 1px; }
.th-mx-id-record__foot { margin: 0; font-size: 11.5px; color: var(--th-ink-2); line-height: 1.45; }
.th-mx-id-outcome { font-weight: 600; }
.th-mx-id-cmp-wrap { min-width: 0; }
.th-mx-id-cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--th-paper); border: 1px solid var(--th-line); border-radius: var(--th-radius-3); }
.th-mx-id-cmp th, .th-mx-id-cmp td { text-align: left; padding: 6px 10px; border-top: 1px solid var(--th-line-soft); vertical-align: baseline; }
.th-mx-id-cmp thead th { border-top: 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-2); background: var(--th-paper-2); }
.th-mx-id-cmp tbody th { font-weight: 500; color: var(--th-ink); }
.th-mx-id-cmp td { color: var(--th-ink); overflow-wrap: anywhere; }
.th-mx-id-cmp tr.is-differs > * { background: var(--th-risk-soft); }
.th-mx-id-res { white-space: nowrap; gap: 3px; }
.th-mx-id-src { display: block; font-size: 11px; color: var(--th-ink-2); font-family: var(--th-font-sans); }
.th-mx-id-hidden { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--th-ink-2); }

/* ---------- narrow (lifted as @media, as all-files.css's narrow block) ---------- */
@media (max-width: 720px) {
  .th-mx-id-record { margin-left: 0; }
  .th-mx-id-cmp, .th-mx-id-cmp tbody, .th-mx-id-cmp tr, .th-mx-id-cmp th, .th-mx-id-cmp td { display: block; }
  .th-mx-id-cmp thead { display: none; }
  .th-mx-id-cmp tbody tr { padding: 8px 10px; border-top: 1px solid var(--th-line-soft); }
  .th-mx-id-cmp tbody tr:first-child { border-top: 0; }
  .th-mx-id-cmp tbody th, .th-mx-id-cmp td { padding: 1px 0; border-top: 0; }
  .th-mx-id-cmp tbody th { font-weight: 600; margin-bottom: 2px; }
  .th-mx-id-cmp td { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; }
  .th-mx-id-cmp td::before { content: attr(data-label); color: var(--th-ink-2); font-size: 11.5px; }
  .th-mx-id-record__facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .th-mx-id-record__facts dd { margin-bottom: 4px; }
  .th-mx-id-move { grid-template-columns: minmax(0, 1fr); }
  .th-mx-id-move__arrow { transform: rotate(90deg); justify-self: start; padding-left: 10px; }
  .th-mx-id-impact__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .th-mx-id-entry { white-space: normal; }
}
