/* ai_guard.css - AI-content guard (static/js/ai_guard.js). Own file: app.css is at its size cap.
 * Every rule is under .aig-*, so deleting the script tag leaves the page
 * exactly as it was (C3). Theme tokens only; spacing 4/8/12/16, type 12/13, 2px gold focus ring.
 * Warn-only: amber (--warn) marks "check before you upload", never a red error. */

/* ── The set mark: one quiet toggle in each results header (never one per card) ────────────── */
.aig-set {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0 8px 0 auto;          /* docks right, ahead of the results filter when it is there */
  height: 28px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.aig-set:last-child { margin-right: 0; }
.aig-set[hidden] { display: none; }
.aig-set:hover { color: var(--text); background: var(--s2); }
.aig-set-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aig-set-box {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border2);
  border-radius: 3px;
  position: relative;
}
.aig-set[aria-pressed="true"] { color: var(--warn); border-color: var(--warn); }
.aig-set[aria-pressed="true"] .aig-set-box { border-color: var(--warn); background: var(--warn); }
.aig-set[aria-pressed="true"] .aig-set-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.aig-set-note {
  margin: -4px 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: var(--s2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}
.aig-set-note[hidden] { display: none; }
.aig-set:focus-visible,
.aig-pill:focus-visible,
.aig-note-x:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── The verdict pill (opens the agency strip) ─────────────────────────────────────────────── */
.aig-pill {
  order: -3;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--s2);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.aig-pill.aig-ai,
.aig-pill.aig-edited { border-color: var(--warn); color: var(--warn); }
/* A linked record we could not read: unknown, so dashed rather than a verdict either way. */
.aig-pill.aig-linked { border-color: var(--warn); border-style: dashed; color: var(--text); }
.aig-pill:hover { background: var(--s3); }

/* ── The strip at the top of the card body ─────────────────────────────────────────────────── */
.aig-strip {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: var(--s2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}
.aig-strip.aig-credentials { border-left-color: var(--border2); }
.aig-strip[hidden] { display: none; }
.aig-strip p { margin: 0; }
.aig-strip .aig-lead { color: var(--text); }
.aig-strip .aig-found { margin: 4px 0 8px; overflow-wrap: anywhere; }
.aig-strip .aig-sub { color: var(--text); font-weight: 600; }
.aig-strip .aig-next { margin: 8px 0 0; }
.aig-strip .aig-link {
  display: inline-block;
  margin: 8px 0;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.aig-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.aig-list { margin: 4px 0; padding: 0 0 0 16px; }
.aig-list li { margin: 2px 0; }
.aig-list b { font-weight: 600; color: var(--text); }
.aig-list .aig-refused b { color: var(--warn); }
.aig-fine { color: var(--muted); }

/* ── The queue badge: a short label on a flagged photo's thumbnail (hover has the detail) ───── */
/* Bottom-left, just above the filename bar: the top-left is the selection tick and the top-right
   the context badge. Clicks pass through to the cell, so selecting still works on the badge. */
.aig-qbadge {
  position: absolute;
  left: 4px;
  bottom: 20px;
  z-index: 2;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 5px;
  border: 1px solid var(--warn);
  border-radius: 4px;
  background: var(--scrim);
  color: var(--warn);
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.3;
}
.aig-qbadge.aig-linked { border-style: dashed; color: var(--text); }

/* ── The export note (persistent, not a toast; every row stays in the CSV) ────────────────── */
.aig-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--warn);
  border-radius: 6px;
  background: var(--s2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}
.aig-note-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.aig-note-txt b { font-weight: 600; }
.aig-note-x {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.aig-note-x:hover { color: var(--text); }
