/* ---------- prompt ledger ---------- */
/* Task 9 (Hub Prompts tab): the session index. Human/LLM is "the
   unmistakable" distinction (task-9-brief.md's Global Constraint) —
   badge-llm is a FILLED chip, the same tier-chip precedent as
   .badge-private-e2ee above (the meaningful one, worn proudly);
   badge-human stays an outline chip, same shape as .badge-public/
   .badge-private. Withheld/redacted chips reuse the gilt-amber private
   tier tokens rather than inventing new colors — tokens only, both
   light and dark ("Ink night" already flips --badge-private/-bg). */

.prompts-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin: 1rem 0;
}
.prompts-filter label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.prompts-count { color: var(--fg-muted); font-size: 0.9rem; margin: 0 0 0.75rem; }

.session-list { list-style: none; padding: 0; margin: 0; max-width: 80ch; }
.session-row {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
}
.session-list li.session-row:last-child { border-bottom: 1px solid var(--border); }

.session-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
}
.session-author { color: var(--fg); font-weight: 600; }
.session-model {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--code-bg);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
}
.session-when { font-variant-numeric: tabular-nums; }
.session-branch {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.session-landed { margin-left: auto; }

.session-summary {
  margin: 0.3rem 0;
  font-weight: 500;
}
.session-first, .session-latest {
  margin: 0.2rem 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.session-first .prompt-label, .session-latest .prompt-label {
  display: inline-block;
  min-width: 3.5rem;
  margin-right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.session-prompts { font-size: 0.8rem; margin: 0.3rem 0 0; }

/* Human/LLM badges — same shape family as .badge (tier chips), reused
   rather than duplicated: outline for human, filled verdigris for LLM. */
.badge-human {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid currentColor;
  color: var(--fg-muted);
  margin-right: 0.4rem;
}
.badge-llm {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  margin-right: 0.4rem;
}

/* Withheld/redacted: amber-tinted via the existing gilt private-tier
   tokens (never a new color for "something is hidden here"). */
.chip-withheld, .chip-redacted {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--badge-private);
  background: var(--badge-private-bg);
  border: 1px solid currentColor;
}

/* Task 10: the ledger transcript page (templates/ledger.html) and the
   commit page's Intent panel (templates/commit.html) — tokens only,
   same family as the session-row rules above; .ledger-entry is the
   ledgerEntryRow (badge.html) shared partial's own wrapper, so both
   surfaces render one entry identically. */
.ledger-title { margin: 0.5rem 0 1rem; }
.ledger-title .branch {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--code-bg);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.ledger-transcript { display: flex; flex-direction: column; gap: 0.6rem; }
.ledger-entry {
  border-top: 1px solid var(--border);
  padding: 0.7rem 0 0;
}
.entry-author { color: var(--fg); font-weight: 600; margin-right: 0.5rem; }
.entry-when { color: var(--fg-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.entry-text { margin: 0.3rem 0 0; }
.ledger-commit-marker {
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.ledger-commit-marker a { color: var(--accent); text-decoration: none; }
.ledger-commit-marker a:hover { text-decoration: underline; }
.ledger-commit-marker .sha {
  background: var(--code-bg);
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.ledger-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.ledger-footer .sha {
  background: var(--code-bg);
  padding: 0 0.35rem;
  border-radius: 4px;
}

.intent-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 1.25rem 0;
}
.intent-heading {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.intent-list .ledger-entry:first-child { border-top: none; padding-top: 0; }
.intent-full-link { margin: 0.6rem 0 0; font-size: 0.85rem; }
.landed-from { margin: 0 0 1rem; font-size: 0.9rem; color: var(--fg-muted); }

/* ---------- tokens page ---------- */

.token-reveal {
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  max-width: 44rem;
}
.token-reveal p { margin: 0 0 0.5rem; }
.token-reveal pre { margin: 0; overflow-x: auto; }
.token-reveal code { font-size: 0.9rem; font-weight: 700; }

table.data {
  border-collapse: collapse;
  width: 100%;
  max-width: 56rem;
  font-size: 0.9rem;
}
table.data th {
  text-align: left;
  font-weight: 600;
  color: var(--fg-muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 0.55rem 0.75rem 0.55rem 0.25rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
table.data td form { margin: 0; }

.hint { color: var(--fg-muted); font-size: 0.9rem; }


/* Carbon attribution figure inside the Intent panel (Task 8): set off
   with a dashed rule from the prompt/reply entries above it, since it
   is a DIFFERENT kind of claim — an attribution computed forward from
   this commit's marker, not a transcript excerpt — and the wording
   itself says so at length, so the visual treatment stays muted rather
   than competing with .intent-heading for attention. */
.intent-attribution {
  margin: 0.75rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  color: var(--fg-muted);
  font-size: 0.85rem;
}


/* Task 7: the Carbon view (templates/carbon.html). Review finding I5 —
   every .carbon-* class previously had zero rules, so the truncation
   warning, fallback notice and exclusions list were visually identical
   to ordinary body prose ("prominent, not footnoted" was achieved only
   by document order), and the accrual chart's <svg> had no intrinsic
   size and collapsed to the browser's 300x150 replaced-element default. */
.carbon-title { margin: 0.5rem 0 0.25rem; }
.carbon-back { margin: 0 0 1rem; font-size: 0.9rem; }
.carbon-subhead { margin: 1.75rem 0 0.6rem; }

/* Truncated/unreadable notices: the amber caution palette
   (--badge-private/-bg) already used for the llm-partial chip and the
   private badge — a caution, not the red .error/--danger treatment,
   because the page itself is working correctly; the underlying read
   was capped. */
.carbon-truncated-warning {
  margin: 0.75rem 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--badge-private);
  border-radius: var(--radius);
  background: var(--badge-private-bg);
  color: var(--fg);
}
.carbon-unreadable-warning { margin: 0.5rem 0; }

.carbon-empty { margin: 1rem 0; }

.carbon-total {
  margin: 1rem 0 0.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.carbon-central { margin: 0; font-size: 1.8rem; font-weight: 700; }
.carbon-band, .carbon-tokens, .carbon-since {
  margin: 0.35rem 0 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* F2 (review round 1): this used to be the ONLY box on the page using
   a left-accent-border device while its neighbours above
   (.carbon-truncated-warning, .carbon-total) both use a full 1px
   border + radius + tinted background — an inconsistency, not (per
   the design-review hook that flagged it) an "AI-UI tell": border-
   left:3px appears exactly once elsewhere in this whole sheet, with
   its own accessibility rationale, predating this branch. Matched to
   its neighbours' box treatment here. --accent/--accent-wash rather
   than --badge-private(-bg): that pairing already means "caution" on
   this page (.carbon-truncated-warning), and both of these notices are
   disclosures about how a number was computed, not warnings that
   something is wrong. Shared with .carbon-unattributed-notice (F1) —
   same kind of disclosure, same treatment, not a second ruleset. */
.carbon-fallback-notice, .carbon-unattributed-notice {
  margin: 0.75rem 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-wash);
  color: var(--fg);
  font-size: 0.9rem;
}

/* The accrual chart needs an explicit box: an <svg> with only a
   viewBox has no intrinsic size and renders at the UA's 300x150
   replaced-element default, which squashes a wide, short bar chart
   into a near-square box. */
.carbon-chart {
  display: block;
  width: 100%;
  height: 8rem;
  margin: 0.5rem 0 1.5rem;
}
.carbon-bar { fill: var(--accent); }

.carbon-sessions, .carbon-sources {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.9rem;
}
.carbon-sessions th, .carbon-sessions td,
.carbon-sources th, .carbon-sources td {
  text-align: left;
  padding: 0.35rem 0.6rem 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.carbon-source-text { color: var(--fg-muted); font-size: 0.85rem; max-width: 40rem; }

.carbon-stamp { color: var(--fg-muted); font-size: 0.9rem; max-width: 48rem; }

.carbon-methodology p { max-width: 48rem; }
.carbon-methodology { margin: 0.5rem 0 1rem; }

.carbon-exclusions { margin: 0.5rem 0; padding-left: 1.25rem; max-width: 48rem; }
.carbon-exclusions li { margin: 0.4rem 0; }
.carbon-floor-note { color: var(--fg-muted); font-size: 0.9rem; max-width: 48rem; }

/* Task 9: the E2EE Prompts panel's entry point into the client-side
   Carbon view (site/js/prompts.js#carbonNavLink) — same page, same
   .carbon-* classes above, just reached by an in-panel link instead of
   a server route (private_e2ee has no server-rendered ?view=carbon). */
.carbon-nav { margin: 0.5rem 0 1rem; }
