/* ════════════════════════════════════════════════════════════════════════════
   EVIDENCE CLICKBACK
   ────────────────────────────────────────────────────────────────────────────
   One evidence presentation system in three modes: compact, summary, full.

   Every rule is scoped to `.evc-*` (or `.evc-page`, which exists only on the
   evidence page), so embedding compact or summary evidence inside a brief, an
   entity view or Ask cannot restyle the host page.

   The full view is meant to read like an editorial page, not an admin screen:
   the claim and the exact words that support it carry the weight, and the
   metadata recedes. Dark is the application default; light activates on the
   existing <html data-se-theme="light"> switch — no new appearance control.

   No webfont is loaded. The extract uses the platform serif, which is a
   restrained treatment available everywhere and costs no blocking request.
   ══════════════════════════════════════════════════════════════════════════ */

.evc-compact, .evc-summary, .evc-page, .evc-panel {
  --evc-fg:      var(--text, #dce6f0);
  --evc-fg-2:    var(--muted, #7a90a8);
  --evc-fg-3:    var(--faint, #4a5f72);
  --evc-line:    var(--border, #1e2d3d);
  --evc-surface: var(--surface, #0d1520);
  --evc-surface-2: var(--surface-2, #111c2b);
  --evc-accent:  var(--accent, #1a6bfa);
  --evc-serif:   ui-serif, Georgia, 'Times New Roman', serif;
}

/* The evidence PAGE needs a ground, the same way every other reader-facing page
   sets one in its own stylesheet (market-forces.css, styles.css). Without it the
   body stays transparent and the page renders on the browser canvas — dark text
   on white under a light UA default. Scoped to :has(.evc-page) so embedding
   compact or summary evidence in a host page changes nothing there. */
body:has(.evc-page) {
  background: var(--bg, #08101a);
  color: var(--text, #dce6f0);
  min-height: 100vh;
}

/* ── Level 1 — the minimum evidence unit ─────────────────────────────────── */
/* Stacked by default: source, then headline, then the timestamp under its own
   label. The hierarchy IS the meaning — the source and what it said carry the
   weight, and the system clock recedes below them. */
.evc-compact {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12.5px; line-height: 1.45; color: var(--evc-fg-2);
  font-variant-numeric: tabular-nums;
}
.evc-compact .evc-src { color: var(--evc-fg); font-weight: 600; font-size: 12.5px; }
.evc-compact .evc-title {
  color: var(--evc-fg); font-weight: 500; font-size: 13.5px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.evc-compact .evc-stamp { color: var(--evc-fg-3); font-size: 11.5px; }
.evc-compact time { color: inherit; font-style: normal; }
.evc-compact .evc-sep { color: var(--evc-fg-3); }

/* The tighter one-line form, for dense rows. Same facts, same labels. */
.evc-compact.evc-inline {
  display: inline-flex; flex-direction: row; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.evc-compact.evc-inline .evc-title {
  font-size: 12.5px; font-weight: 500; -webkit-line-clamp: 1;
  max-width: 44ch; white-space: nowrap; text-overflow: ellipsis; display: inline-block; overflow: hidden;
}

/* ── Level 2 — short evidence ────────────────────────────────────────────── */
.evc-summary { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.evc-summary .evc-line { max-width: 62ch; }
.evc-headline {
  font-size: 13.5px; line-height: 1.45; color: var(--evc-fg); font-weight: 550;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.evc-snippet {
  max-width: 64ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--evc-serif); font-size: 13.5px; line-height: 1.5; color: var(--evc-fg-2);
  quotes: '“' '”';
}
.evc-view {
  font-size: 12.5px; font-weight: 600; color: var(--evc-accent);
  text-decoration: none; border-bottom: 1px solid transparent; padding: 1px 0;
}
.evc-view:hover, .evc-view:focus-visible { border-bottom-color: currentColor; }

/* ⚠ THE DISCLOSURE STACKS UNDER THE PROVENANCE, IT DOES NOT SIT BESIDE IT.
   The host row is `.evidence-footer` (styles.css): `display:flex;
   align-items:center`, a horizontal row from when the footer held a hostname
   link and a match percentage. Once the compact unit became a vertical stack,
   that row placed the control next to it and vertically centred — so it landed
   on the headline's line and read as part of the headline. The order has to be
   source → headline → captured → control, so the container stacks too.
   evidence-clickback.css loads after styles.css, so this wins at equal
   specificity without an override. */
.evc-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* A disclosure that reveals Level 2 from Level 1, inside a reading view. */
.evc-disclose {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--evc-fg-2);
}
.evc-disclose:hover { color: var(--evc-fg); }
.evc-disclose .evc-caret {
  width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s; flex: 0 0 auto; margin-bottom: 1px;
}
.evc-disclose[aria-expanded="true"] .evc-caret { transform: rotate(45deg); }
.evc-more { margin-top: 8px; }
.evc-count { font-size: 12.5px; color: var(--evc-fg-2); }

.evc-compact :focus-visible, .evc-summary :focus-visible,
.evc-page :focus-visible, .evc-disclose:focus-visible {
  outline: 2px solid var(--evc-accent); outline-offset: 2px; border-radius: 3px;
}

/* ── Level 3 — the full evidence page ────────────────────────────────────── */
.evc-page {
  max-width: 780px; margin: 0 auto; padding: 28px 24px 96px;
  color: var(--evc-fg); font-size: 16px; line-height: 1.65;
}
.evc-back {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px;
  color: var(--evc-fg-2); background: none; border: none; padding: 6px 10px 6px 6px;
  border-radius: 7px; cursor: pointer; font-family: inherit; margin-bottom: 22px;
}
.evc-back:hover { background: var(--evc-surface-2); color: var(--evc-fg); }
.evc-back .evc-arrow { font-size: 15px; line-height: 1; }

.evc-eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--evc-fg-3); font-weight: 700; margin-bottom: 12px;
}
.evc-claim {
  font-family: var(--evc-serif);
  font-size: clamp(25px, 4vw, 33px); line-height: 1.25; letter-spacing: -.015em;
  font-weight: 500; margin: 0 0 16px; text-wrap: balance; color: var(--evc-fg);
}
.evc-standfirst { font-size: 15px; line-height: 1.6; color: var(--evc-fg-2); margin: 0 0 22px; max-width: 60ch; }

.evc-provenance {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--evc-line); margin-bottom: 26px;
}

.evc-section { margin-bottom: 30px; }
.evc-section-title {
  font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--evc-fg-3); font-weight: 700; margin-bottom: 12px;
}

/* The exact words. This is the thing the reader came for. */
.evc-extract {
  background: var(--evc-surface); border: 1px solid var(--evc-line);
  border-left: 3px solid var(--evc-accent); border-radius: 0 10px 10px 0;
  padding: 22px 26px;
}
.evc-extract blockquote {
  margin: 0; font-family: var(--evc-serif);
  font-size: 20px; line-height: 1.55; color: var(--evc-fg); text-wrap: pretty;
}
.evc-extract .evc-attrib {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--evc-line);
  font-size: 12.5px; color: var(--evc-fg-3);
}
.evc-headline-line { font-size: 14.5px; font-weight: 600; color: var(--evc-fg); margin-bottom: 10px; }

.evc-why {
  background: var(--evc-surface-2); border: 1px solid var(--evc-line); border-radius: 10px;
  padding: 17px 20px; font-size: 15px; line-height: 1.62; color: var(--evc-fg-2); text-wrap: pretty;
}
.evc-why strong { color: var(--evc-fg); font-weight: 600; }

.evc-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 650; border: 1px solid var(--evc-line); color: var(--evc-fg-2);
}
.evc-badge-primary { border-color: var(--evc-accent); color: var(--evc-accent); }

.evc-others { display: flex; flex-direction: column; gap: 10px; }
.evc-other {
  background: var(--evc-surface); border: 1px solid var(--evc-line); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 7px;
}

.evc-article {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--evc-surface); border: 1px solid var(--evc-line); border-radius: 10px; padding: 15px 17px;
}
.evc-article-title { font-size: 14.5px; font-weight: 600; color: var(--evc-fg); }
.evc-article-domain { font-size: 12.5px; color: var(--evc-fg-3); margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Secondary by construction: the external article is an outcome of reading the
   evidence, not the evidence itself. */
.evc-external {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px;
  border-radius: 8px; border: 1px solid var(--evc-line); background: var(--evc-surface-2);
  font-size: 13.5px; font-weight: 550; color: var(--evc-fg); text-decoration: none; white-space: nowrap;
}
.evc-external:hover { border-color: var(--evc-accent); }

.evc-kv { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--evc-line); font-size: 13.5px; }
.evc-kv:last-child { border-bottom: none; }
.evc-kv dt { color: var(--evc-fg-3); margin: 0; }
.evc-kv dd { margin: 0; text-align: right; color: var(--evc-fg); font-weight: 500; }

/* The chain — the one place all the system times appear, each under its name. */
.evc-chain { display: flex; flex-direction: column; }
.evc-step { display: flex; gap: 12px; }
.evc-step .evc-rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.evc-step .evc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--evc-line); margin-top: 6px; border: 1px solid var(--evc-fg-3); }
.evc-step.evc-here .evc-dot { background: var(--evc-accent); border-color: var(--evc-accent); }
.evc-step .evc-bar { flex: 1; width: 1px; background: var(--evc-line); min-height: 14px; }
.evc-step:last-child .evc-bar { display: none; }
.evc-step .evc-body { padding-bottom: 14px; min-width: 0; }
.evc-step .evc-label { font-size: 13.5px; font-weight: 550; color: var(--evc-fg); }
.evc-step .evc-detail { font-size: 12.5px; color: var(--evc-fg-3); margin-top: 2px; }
.evc-step .evc-unknown { font-size: 12.5px; color: var(--evc-fg-3); margin-top: 2px; font-style: italic; }

.evc-empty {
  border: 1px dashed var(--evc-line); border-radius: 10px; padding: 22px;
  text-align: center; color: var(--evc-fg-2); font-size: 14.5px;
}
.evc-note { font-size: 12.5px; color: var(--evc-fg-3); margin-top: 10px; line-height: 1.55; }

@media (max-width: 620px) {
  .evc-page { padding: 20px 16px 72px; }
  .evc-extract { padding: 18px 18px; border-radius: 0 8px 8px 0; }
  .evc-extract blockquote { font-size: 18px; }
  .evc-article { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .evc-disclose .evc-caret, .evc-view, .evc-external { transition: none; }
}

/* The entity Signal History row — an inline, explicitly labelled crawl time
   where a bare unlabelled date used to sit. */
.evc-page .evc-note { margin-top: 4px; max-width: 46ch; }
