/* app-record-proof.css — NEW (v11, 2026-11-27): the tamper-evident record graphic (record-proof.mjs).
   Load after app-ui.css. Every class is `rp-` under `.app`, so nothing here touches another window.
   Two panels: the ledger (paper: entries with their SHA-256, folding into chained seals) and the verifier (ink: the evidence pack
   checked offline). The root's container query picks the form: side by side from 640 px of figure, stacked below it, and the
   phone form (fewer entries, the verifier without its file listing) under 460 px.
   States: [data-state="intact"] (the default, the still, the no-script and reduced-motion frame) and [data-state="altered"].
   Each two-state slot (.rp-two) lays both values in one grid cell, so a swap never moves anything (CLS 0). */

.app.rp {
  --rp-red: 9 69% 39%;           /* rust, darkened for text on white: 6.3:1 */
  --rp-red-soft: 13 70% 96%;
  --rp-term: 205 15% 13%;
  --rp-term-2: 205 15% 10%;
  --rp-mint: 168 52% 62%;        /* on the verifier: 8.9:1 */
  --rp-coral: 12 100% 72%;       /* on the verifier: 7.6:1 */
  --rp-t: 360ms;
  display: block; container-type: inline-size; container-name: rp;
  font-family: Manrope, system-ui, sans-serif; color: hsl(var(--ink-900)); -webkit-font-smoothing: antialiased;
}
.app.rp :where(p, ol, ul, li, dl, dt, dd) { margin: 0; padding: 0; list-style: none; }

.app .rp-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }

/* ---- two-state slots ---- */
.app .rp-two { display: inline-grid; }
.app .rp-two > span { grid-area: 1 / 1; transition: opacity var(--rp-t) ease, visibility var(--rp-t), color var(--rp-t) ease; }
.app .rp-two > .rp-v1 { opacity: 0; visibility: hidden; }
.app.rp[data-state="altered"] .rp-two > .rp-v0 { opacity: 0; visibility: hidden; }
.app.rp[data-state="altered"] .rp-two > .rp-v1 { opacity: 1; visibility: visible; }
.app .rp-ck { width: 12px; height: 12px; flex: none; }

/* ---- the ledger ---- */
.app .rp-ledger { position: relative; z-index: 1; background: #fff; border-radius: 14px; box-shadow: 0 1px 1px rgba(44,51,56,.10), 0 0 0 1px rgba(44,51,56,.08), 0 10px 24px -12px rgba(44,51,56,.22), 0 40px 80px -30px rgba(44,51,56,.30); overflow: hidden; }
.app .rp-lh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid hsl(var(--ink-200)); font-size: 13px; line-height: 18px; color: hsl(var(--ink-600)); }
.app .rp-proj { white-space: nowrap; }
.app .rp-title b { font-weight: 650; color: hsl(var(--ink-900)); }
.app .rp-pill { flex: none; font-size: 12px; line-height: 16px; font-weight: 600; }
.app .rp-pill > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; justify-self: end; }
.app .rp-pill > span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.app .rp-pill > .rp-v0 { background: hsl(var(--brand-subtle)); color: hsl(var(--brand-ink)); }
.app .rp-pill > .rp-v1 { background: hsl(var(--rp-red-soft)); color: hsl(var(--rp-red)); }

.app .rp-list { --g: -18px; position: relative; padding: 4px 18px 6px 40px; }
/* the chain: one rule down the gutter, from the earlier seals to the newest */
.app .rp-list::before { content: ""; position: absolute; left: calc(40px + var(--g) - 1px); top: 16px; bottom: 34px; width: 2px; border-radius: 1px; background: hsl(var(--brand) / .32); }
.app .rp-earlier { position: relative; padding: 6px 0 4px; font-size: 11.5px; line-height: 16px; color: hsl(var(--ink-500)); }
.app .rp-leaf, .app .rp-dia { position: absolute; }
.app .rp-leaf { left: calc(var(--g) + 8px - 4.5px); top: 9px; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px hsl(var(--brand) / .55); transition: box-shadow var(--rp-t) ease; }
.app .rp-dia { left: calc(var(--g) - 6px); top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 2px; background: hsl(var(--brand)); transform: rotate(45deg); box-shadow: 0 0 0 3px #fff; transition: background var(--rp-t) ease; }
.app .rp-dia.is-ghost { top: 14px; margin-top: 0; left: calc(var(--g) - 5px); width: 10px; height: 10px; background: #fff; box-shadow: 0 0 0 3px #fff, inset 0 0 0 2px hsl(var(--brand) / .45); }

.app .rp-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 4px 8px; margin: 0 -8px; border-radius: 6px; transition: background var(--rp-t) ease; }
.app .rp-what { font-size: 13px; line-height: 18px; font-weight: 600; color: hsl(var(--ink-900)); min-width: 0; }
.app .rp-what .rp-two > span { white-space: nowrap; }
.app .rp-meta { grid-column: 1 / -1; font-size: 11.5px; line-height: 16px; color: hsl(var(--ink-500)); }
.app .rp-hash { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px; line-height: 18px; color: hsl(var(--brand-ink)); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.app .rp-hash .rp-two > span { justify-self: end; }

.app .rp-seal { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 1px; align-items: baseline; margin: 3px 0 4px; padding: 6px 12px; border-radius: 8px; background: hsl(var(--brand-subtle)); transition: background var(--rp-t) ease; }
.app .rp-sname { font-size: 12.5px; line-height: 17px; font-weight: 650; color: hsl(var(--ink-900)); white-space: nowrap; }
.app .rp-seal { grid-template-columns: auto minmax(0, 1fr) auto; }
.app .rp-seal > .rp-hash { color: hsl(var(--ink-600)); text-align: left; padding-left: 4px; }
.app .rp-seal > .rp-hash .rp-two > span { justify-self: start; }
.app .rp-st { align-self: center; font-size: 12px; line-height: 16px; font-weight: 600; color: hsl(var(--brand-ink)); }
.app .rp-st, .app .rp-st > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; justify-self: end; }
.app .rp-st.rp-two { display: inline-grid; }
.app .rp-st > .rp-v1 { color: hsl(var(--rp-red)); }

/* the newest seal, open: its Merkle root, the previous seal it is chained to, and its three proofs */
.app .rp-seal.is-open { margin-bottom: 4px; padding-bottom: 10px; }
.app .rp-seal.is-open { grid-template-columns: minmax(0, 1fr) auto; }
.app .rp-seal.is-open > .rp-hash { grid-row: 2; grid-column: 1; }
.app .rp-seal.is-open > .rp-st { grid-row: 1 / span 2; grid-column: 2; }
.app .rp-anat { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 7px ; padding-top: 7px ; border-top: 1px solid hsl(var(--brand) / .16); }
.app .rp-anat > div { display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; line-height: 16px; }
.app .rp-anat dt { color: hsl(var(--ink-600)); }
.app .rp-anat dd { font-family: "JetBrains Mono", ui-monospace, monospace; color: hsl(var(--ink-800)); transition: color var(--rp-t) ease; }
.app .rp-stamps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.app .rp-stamp { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px hsl(var(--brand) / .28); font-size: 11.5px; line-height: 16px; font-weight: 600; color: hsl(var(--brand-ink)); white-space: nowrap; }

.app .rp-foot { padding: 10px 18px 12px; border-top: 1px solid hsl(var(--ink-200)); background: hsl(36 33% 98%); font-size: 12px; line-height: 17px; color: hsl(var(--ink-700)); }

/* ---- the altered state ---- */
.app.rp[data-state="altered"] .rp-row.is-alt { background: hsl(var(--rp-red-soft)); }
.app.rp[data-state="altered"] .rp-row.is-alt .rp-meta { color: hsl(var(--ink-600)); }
.app.rp[data-state="altered"] .rp-row.is-alt .rp-what .rp-v1,
.app.rp[data-state="altered"] .rp-row.is-alt .rp-hash .rp-v1,
.app.rp[data-state="altered"] .rp-seal.is-hit > .rp-hash .rp-v1 { color: hsl(var(--rp-red)); }
.app.rp[data-state="altered"] .rp-row.is-alt .rp-leaf { box-shadow: inset 0 0 0 2px hsl(var(--rp-red)); }
.app.rp[data-state="altered"] .rp-seal.is-hit,
.app.rp[data-state="altered"] .rp-seal.is-next { background: hsl(var(--rp-red-soft)); }
.app.rp[data-state="altered"] .rp-seal.is-hit .rp-dia,
.app.rp[data-state="altered"] .rp-seal.is-next .rp-dia { background: hsl(var(--rp-red)); }
.app.rp[data-state="altered"] .rp-seal.is-next .rp-prev dd { color: hsl(var(--rp-red)); }
/* the sequence: the entry, then its seal, then the next seal, then the verifier (record-proof.js sets data-state; the delays order it) */
.app.rp[data-state="altered"] .rp-seal.is-hit, .app.rp[data-state="altered"] .rp-seal.is-hit * { transition-delay: 420ms; }
.app.rp[data-state="altered"] .rp-seal.is-next, .app.rp[data-state="altered"] .rp-seal.is-next * { transition-delay: 840ms; }
.app.rp[data-state="altered"] .rp-term .rp-two > span, .app.rp[data-state="altered"] .rp-pill > span { transition-delay: 1260ms; }

/* ---- the verifier ---- */
.app .rp-term { position: relative; z-index: 2; margin: 56px 0 0 -10px; border-radius: 12px; overflow: hidden; background: hsl(var(--rp-term)); color: hsl(205 12% 80%); box-shadow: 0 2px 4px rgba(16,24,32,.12), 0 30px 60px -24px rgba(16,24,32,.45); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11.5px; line-height: 19px; font-variant-numeric: tabular-nums; }
.app .rp-term-h { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: hsl(var(--rp-term-2)); color: hsl(205 10% 66%); font-size: 11px; line-height: 16px; }
.app .rp-dots { display: flex; gap: 5px; } .app .rp-dots i { width: 8px; height: 8px; border-radius: 50%; background: hsl(205 10% 28%); }
.app .rp-term-b { padding: 12px 16px 14px; }
.app .rp-cmd { color: hsl(0 0% 96%); }
.app .rp-ps { color: hsl(var(--rp-mint)); }
.app .rp-ls { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 1px 0 8px ; color: hsl(205 14% 76%); }
.app .rp-ls span { white-space: nowrap; }
.app .rp-out { margin: 2px 0 0 ; }
.app .rp-out li { white-space: nowrap; }
.app .rp-out b { font-weight: 600; margin-right: 8px; }
.app .rp-pass { color: hsl(var(--rp-mint)); }
.app .rp-fail { color: hsl(var(--rp-coral)); }
.app .rp-out .rp-v1 { color: hsl(var(--rp-coral)); }
.app .rp-verdict { margin-top: 10px ; padding-top: 9px; border-top: 1px solid hsl(205 10% 24%); font-family: Manrope, system-ui, sans-serif; font-size: 13px; line-height: 18px; font-weight: 650; }
.app .rp-verdict .rp-two > span { display: inline-flex; align-items: center; gap: 6px; }
.app .rp-verdict .rp-v0 { color: hsl(var(--rp-mint)); }
.app .rp-verdict .rp-v1 { color: hsl(var(--rp-coral)); }
.app .rp-verdict .rp-ck { width: 14px; height: 14px; }

/* ---- narrow side by side, 600 to 699 px of figure: a narrower verifier, compact seals without their hash ---- */
@container rp (max-width: 699px) {
  .app .rp-in { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); }
  .app .rp-term { font-size: 11px; line-height: 18px; }
  .app .rp-term-b { padding: 12px 14px 14px; }
  .app .rp-seal:not(.is-open) > .rp-hash { visibility: hidden; }
}
/* ---- stacked: under 600 px of figure the verifier sits under the ledger, overlapping its foot ---- */
@container rp (max-width: 599px) {
  .app .rp-in { grid-template-columns: minmax(0, 1fr); }
  .app .rp-term { font-size: 11.5px; line-height: 19px; }
  .app .rp-seal:not(.is-open) > .rp-hash { visibility: visible; }
  .app .rp-term { margin: -14px 14px 0 auto; width: min(100% - 28px, 400px); }
  .app .rp-foot { padding-bottom: 26px; }
}
/* ---- phone: the entries from 18 Aug, 17:59 on, and the verifier without its file listing ---- */
@container rp (max-width: 459px) {
  .app .rp-ph-hide { display: none; }
  .app .rp-term { margin: -14px 10px 0; width: auto; }
  .app .rp-ls, .app .rp-term-b > .rp-cmd:first-child { display: none; }
  .app .rp-lh { padding: 11px 14px; }
  .app .rp-list { --g: -16px; padding: 4px 12px 6px 34px; }
  .app .rp-list::before { left: calc(34px + var(--g) - 1px); }
  .app .rp-foot { padding: 10px 14px 26px; }
  .app .rp-row { grid-template-columns: minmax(0, 1fr); }
  .app .rp-row > .rp-hash { grid-row: 3; text-align: left; }
  .app .rp-row > .rp-hash .rp-two > span { justify-self: start; }
  .app .rp-what .rp-two > span { white-space: normal; }
  .app .rp-seal, .app .rp-seal.is-open { grid-template-columns: minmax(0, 1fr) auto; }
  .app .rp-seal > .rp-sname { grid-row: 1; grid-column: 1 / -1; }
  .app .rp-seal > .rp-hash, .app .rp-seal.is-open > .rp-hash { grid-row: 2; grid-column: 1; padding-left: 0; }
  .app .rp-seal > .rp-st, .app .rp-seal.is-open > .rp-st { grid-row: 2; grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .app.rp, .app.rp * { transition-duration: 0s !important; transition-delay: 0s !important; }
}
