/* 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;
}

/* Phone width: the tiles stack in one column and nothing pushes the page wider than the screen. */
@media (max-width: 480px) {
  .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;
  }
}
