/* Entities page (tickets 004, 989): the page head carries the title and the shared time control
   (decoys-reports.css owns `.workspace-page` / `.workspace-head` / `.workspace-head__action`) and the one
   Kind pull-down (ticket 001082); the section head carries the count and the Partial badge. */

.workspace-head__action .entities-window {
  margin: 0;
}

/* The Kind pull-down sits in the page head beside the window picker (ticket 001082), so every control of
   the page is in one place and the count line carries only the count. */
.entities-kind-select {
  max-width: 100%;
}

/* The Provenance column is left out when every row is OBSERVED (the Label header says so, with the ⓘ), so a
   chip that is the same on every row does not repeat down the page. */
.entities-table th .entities-table__all-observed {
  margin-left: 0.4rem;
  font-weight: 400;
  color: var(--ink-dim);
}

/* A date and a count read whole: the cells that hold one do not wrap and are not cut. The Label cell is
   the one that flexes (a user agent wraps there, above). */
.entities-table .entities-cell--nowrap {
  white-space: nowrap;
}

/* A user agent is cut to 64 characters in the middle (entity_format.js middleEllipsis()); on a narrow screen
   even that wraps inside its cell instead of pushing the table past the card. The Label link reads as a
   link, not as a coloured chip. */
.entities-table td:nth-child(2) {
  max-width: 28rem;
  overflow-wrap: anywhere;
}

.entities-table td a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.15em;
}

.entities-table td a:hover {
  text-decoration-color: currentColor;
}

.entities-table th .info-tip__button {
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Provenance/planted/credential-kind chips (ticket 005) — the base pill shape mirrors
   investigations.css's `.chip` rule (that file's own base rule doesn't reach here: it's scoped
   to nothing in particular, but this table gets its own copy so entities.css stays self-
   contained and doesn't depend on load order). Provenance colours reuse the console's existing
   observed/self-reported vocabulary (provenanceLabel() in entity_format.js); planted and
   credential-kind reuse the entity dossier's own gold/muted vocabulary. */
.entities-table .chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: .2rem .65rem;
  font-size: var(--fs-2xs);
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid var(--border-strong);
  white-space: nowrap;
  margin-left: .35rem;
}

.entities-table .chip--observed {
  color: var(--ink-dim);
  border-color: var(--border-strong);
}

.entities-table .chip--self-reported {
  color: var(--st-4xx);
  border-color: var(--st-4xx);
}

.entities-table .chip--planted {
  color: var(--gold-bright);
  border-color: var(--border-gold);
  background: var(--gold-soft);
}

.entities-table .chip--credential-kind {
  color: var(--ink-muted);
  border-color: var(--border);
}

/* The dossier's text-valued tiles (First seen, Last seen on an entity, Last seen on an AI agent) hold a whole
   date and time ("Oct 29, 00:02 UTC"). The UI face at --fs-md keeps one on a single line in a tile of the
   Identity row; where the tile is narrower the value wraps (console.css .stat-tile__value--text) instead
   of ending in an ellipsis. The full value is also the tile's `title` (js/stat_tile.js). */
.entity-dossier-view .stat-tile__value--text {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  letter-spacing: 0;
  line-height: 1.3;
  text-wrap: balance;
}

/* The day-by-day activity table (ticket 001082) shows its first rows, then a "Show more" button; the
   "Notable Case Files" heading below it keeps a gap from the table above (it used to touch it). */
.entity-timeline .show-more-row {
  margin-bottom: 0.75rem;
}

.entity-timeline > h3.section__title {
  margin: 1.25rem 0 0.6rem;
}

/* The AI agent's pixel character, twice the icon size, at the side of its address (tickets 913, 958). */
.entity-ai-agent__character {
  display: flex;
  flex: none;
  justify-content: flex-end;
}

/* The address with the character at the side; the address wraps rather than push the page wider. */
.entity-ai-agent__id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}
.entity-ai-agent__address {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-muted);
}

/* The TL;DR card (ticket 958): the headline and up to three "why you should care" points, first on the
   page. `[data-agent-tldr]` is the hook the LLM summary replaces the text through. */
.agent-tldr {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--card-from), var(--card-to));
  min-width: 0;
}
.agent-tldr__headline {
  margin: 0 0 0.5rem;
  font-size: var(--fs-lg);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.agent-tldr__points {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
}
.agent-tldr__points li {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}
.agent-tldr__source {
  margin: 0;
}

/* "What it was after": one block per goal family, then the checks to run on your own systems. */
.entity-ai-agent__intent-item {
  overflow-wrap: anywhere;
}
.entity-ai-agent__intent-item .body-note {
  margin: 0.15rem 0 0;
}
.entity-ai-agent__subhead {
  margin: 0.75rem 0 0.25rem;
  font-size: var(--fs-md);
}

/* The two collapsed sections (how the score was built, more detail). */
.entity-ai-agent__disclosure {
  margin: 0.75rem 0;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.entity-ai-agent__disclosure > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.25rem 0;
}

/* The heading above the generic entity sections on an AI agent's page. */
.entity-activity-title {
  margin: 1.5rem 0 0.5rem;
}

/* ---- The AI agent's dossier (ticket 001280) -----------------------------------------------------
   An AI agent's address page opens on a header (sprite, address, verdict, the card's own words, four facts),
   then two panels side by side, the card it posted and the stages it reached, then what came back from its
   machine. Tokens only (css/console.css); panels are the content layer's flat `.card` (css/depth.css). */

.agent-dossier > * {
  margin-top: 0;
  margin-bottom: 0;
}

.agent-dossier > * + * {
  margin-top: var(--space-4);
}

.agent-dossier__head {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: linear-gradient(110deg, var(--gold-soft), transparent 55%), var(--panel);
}

/* The sprite on a small lit stage of its own. */
.agent-dossier__sprite {
  flex: none;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.875rem;
  background: radial-gradient(circle at 50% 70%, var(--gold-soft), transparent 70%), var(--panel-deep);
}

.agent-dossier__sprite .agent-icon {
  image-rendering: pixelated;
}

.agent-dossier__ident {
  flex: 1;
  min-width: 0;
}

.agent-dossier__kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font: var(--type-footnote);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.agent-dossier__kicker .home__window {
  letter-spacing: normal;
  text-transform: none;
}

.agent-dossier__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-1);
}

/* The ⓘ belongs to the verdict chip before it, so it sits closer to that chip than to the next one. */
.agent-dossier__title-row .info-tip__button {
  margin-left: calc(-1 * var(--space-2));
}

.agent-dossier__address {
  margin: 0 var(--space-2) 0 0;
  font: var(--type-large-title);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* Who it is in its own words, with the one SELF-REPORTED tag beside them. */
.agent-dossier__who {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-2) 0 0;
}

.agent-dossier__who-text {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.agent-dossier__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-7);
  margin: var(--space-4) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.agent-dossier__fact {
  min-width: 0;
}

.agent-dossier__fact dt {
  font: var(--type-footnote);
  color: var(--ink-muted);
}

.agent-dossier__fact dd {
  margin: var(--space-1) 0 0;
}

.agent-dossier__fact-value {
  font: var(--type-headline);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.agent-dossier__fact-sub {
  margin-left: var(--space-2);
  font: var(--type-footnote);
  color: var(--ink-dim);
}

/* The panels: the card beside the stages, then the proof, then what it was after beside what to do. */
.agent-dossier__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-4);
}

.agent-dossier__grid--even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-dossier__grid--single {
  grid-template-columns: minmax(0, 1fr);
}

/* What it was after and what to do differ in length: each panel keeps its own height. */
.agent-dossier__grid--start {
  align-items: start;
}

.agent-dossier__panel {
  min-width: 0;
  padding: var(--space-5) var(--space-6);
}

.agent-dossier__panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
}

.agent-dossier__panel-title {
  margin: 0;
  font: var(--type-title);
}

.agent-dossier__panel-meta,
.agent-dossier__panel-link {
  margin-left: auto;
  font: var(--type-footnote);
  color: var(--ink-muted);
}

.agent-dossier__panel-link {
  color: var(--gold);
}

.agent-dossier__panel .entity-ai-agent__group > .section__title:first-child {
  margin-top: 0;
}

/* The objective, the agent's own sentence, set as a quotation. */
.agent-dossier__objective {
  margin: 0 0 var(--space-4);
}

.agent-dossier__objective blockquote {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--gold);
  border-radius: 0 0.5rem 0.5rem 0;
  background: var(--gold-soft);
}

.agent-dossier__objective p {
  margin: 0;
  font: 500 var(--fs-md) / 1.45 var(--font-ui);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.agent-dossier__objective p::before {
  content: "\201C";
}

.agent-dossier__objective p::after {
  content: "\201D";
}

.agent-dossier__objective figcaption {
  margin-top: var(--space-2);
  font: var(--type-footnote);
  color: var(--ink-muted);
}

.agent-dossier__extra {
  margin: 0 0 var(--space-4);
  font: var(--type-footnote);
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.agent-dossier__extra-label {
  color: var(--ink-muted);
}

/* The card's fields: a quiet label column and the values in the mono face. */
.agent-dossier__card-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2) var(--space-5);
  margin: 0;
}

.agent-dossier__card-row {
  display: contents;
}

.agent-dossier__card-row dt {
  font: var(--type-footnote);
  line-height: 1.6;
  color: var(--ink-muted);
}

.agent-dossier__card-row dd {
  margin: 0;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--ink-body);
  overflow-wrap: anywhere;
}

.agent-dossier__card-row dd a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.15em;
}

.agent-dossier__card-row dd a:hover {
  text-decoration-color: currentColor;
}

/* "What it did": a time column and a line of dots down the ladder; the card posted and the callback stand out. */
.agent-dossier__steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-dossier__step {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-4);
  padding: 0.4rem 0;
}

.agent-dossier__step-time {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.agent-dossier__step-label {
  position: relative;
  padding-left: 1.4rem;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--ink-body);
}

.agent-dossier__step-label::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.4em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ink-muted);
}

.agent-dossier__step:not(:last-child) .agent-dossier__step-label::after {
  content: "";
  position: absolute;
  left: calc(0.375rem - 0.5px);
  top: calc(0.4em + 0.75rem);
  bottom: -0.65rem;
  width: 1px;
  background: var(--border-strong);
}

.agent-dossier__step--self_disclosure .agent-dossier__step-label,
.agent-dossier__step--callback .agent-dossier__step-label {
  color: var(--ink);
  font-weight: 600;
}

.agent-dossier__step--self_disclosure .agent-dossier__step-label::before {
  background: var(--gold);
}

.agent-dossier__step--callback .agent-dossier__step-label::before {
  background: var(--gold-bright);
  box-shadow: 0 0 0.6rem var(--gold);
}

/* The stages panel is as tall as the card beside it: the last request sits on its foot, level with the card's. */
.agent-dossier__stages {
  display: flex;
  flex-direction: column;
}

.agent-dossier__steps {
  margin-bottom: var(--space-3);
}

.agent-dossier__last {
  margin: auto 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

/* What the product did to the agent: one sentence, then the figures under it. */
.agent-dossier__disruption-line {
  margin: 0;
  color: var(--ink-body);
}

.agent-dossier__disruption .agent-dossier__facts {
  margin-top: var(--space-4);
}

/* What came back from its machine: the output as it arrived, in a dark well. */
.agent-dossier__proof-lead {
  margin: 0 0 var(--space-3);
  color: var(--ink-body);
}

.agent-dossier__proof-lead code {
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
  background: var(--panel-deep);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink);
}

.agent-dossier__terminal {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  background: var(--panel-deep);
  font: 400 var(--fs-xs) / 1.6 var(--font-mono);
  color: var(--ink-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-dossier__proof-caption {
  margin: var(--space-2) 0 0;
}

.agent-dossier .agent-tldr {
  margin-bottom: 0;
  padding: var(--space-5) var(--space-6);
}

@media (max-width: 960px) {
  .agent-dossier__grid,
  .agent-dossier__grid--even {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phone width: the tiles stack in one column and nothing pushes the page wider than the screen. */
@media (max-width: 480px) {
  .agent-dossier__head {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4);
  }
  .agent-dossier__panel,
  .agent-dossier .agent-tldr {
    padding: var(--space-4);
  }
  .agent-dossier__card-list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }
  .agent-dossier__card-row dd {
    margin-bottom: var(--space-2);
  }
  .entity-ai-agent .command-hero-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .entity-ai-agent .stat-tile {
    min-width: 0;
  }
  .agent-tldr {
    padding: 0.85rem 0.8rem;
  }
}
