/* The seal report: verdict band, proof chain and signer cards.
 * Used by /verifiser, /verifiser/{sha256} and the sender's agreement page, on top of the
 * brand tokens in style.css. Markup comes from templates/_parts.html (seal_hero) and
 * public/js/verify/report-ui.js. */

/* ── Verdict band ─────────────────────────────────────────────────────────── */
.sealv { --se-a: #F3D97F; --se-b: #D4AF37; --se-c: #A97F12; --se-disc: #0B1D35; --se-glyph: #F3D97F;
  position: relative; overflow: hidden; display: grid; grid-template-columns: 112px 1fr; gap: var(--space-xl); align-items: center;
  padding: var(--space-xl) var(--space-2xl) var(--space-xl) var(--space-xl); border-radius: var(--radius-xl); color: var(--text-on-dark);
  background: radial-gradient(120% 140% at 0% 0%, rgba(230, 194, 82, 0.16), transparent 46%), linear-gradient(155deg, #0B1D35 0%, #112B4D 62%, #163a66 100%);
  border: 1px solid rgba(230, 194, 82, 0.28); box-shadow: var(--shadow-lg); }
.sealv[hidden] { display: none; }
.sealv::after { content: ""; position: absolute; inset: auto -60px -90px auto; width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.025), 0 0 0 64px rgba(255, 255, 255, 0.018); pointer-events: none; }
#seal-root + .card, .sealv + .card, .sealv + .sealr, .sealr + .card, .card + .sealr, .sealv + .note-line { margin-top: var(--space-lg); }
.sealv__emblem { width: 112px; height: 112px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)); }
.sealv__title { margin: 0 0 6px; font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; color: #fff; }
.sealv__text { margin: 0; max-width: 62ch; color: #C9D3E0; line-height: 1.65; }
.b2b .sealv a { color: var(--gold-300); }
.sealv__facts { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sealv__facts:empty { display: none; }
.sealv__fact { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-full); font-size: var(--font-size-sm); font-weight: 600;
  color: #fff; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); backdrop-filter: blur(4px); }
.sealv__fact .icon { color: var(--gold-300); }
.sealv__fact-label { color: #9FB0C6; font-weight: 500; margin-right: 6px; }
.sealv__fact--ok { border-color: rgba(134, 239, 172, 0.4); background: rgba(34, 197, 94, 0.14); }
.sealv__fact--wait { border-color: rgba(243, 217, 127, 0.4); background: rgba(212, 175, 55, 0.14); }
.sealv__fact--bad { border-color: rgba(252, 165, 165, 0.5); background: rgba(239, 68, 68, 0.18); }
.sealv__fact.is-new { animation: seal-pop 420ms var(--ease-out) both; }

/* Emblem: one glyph per state */
.seal-emblem { width: 100%; height: 100%; display: block; }
.se-stop-a { stop-color: var(--se-a); } .se-stop-b { stop-color: var(--se-b); } .se-stop-c { stop-color: var(--se-c); }
.se-disc { fill: var(--se-disc); }
.se-ring { stroke: var(--se-glyph); opacity: 0.45; }
.se-glyph > * { display: none; stroke: var(--se-glyph); fill: none; }
.se-glyph--busy circle { fill: var(--se-glyph); }
.sealv--ok .se-glyph--ok, .sealv--bad .se-glyph--bad, .sealv--warn .se-glyph--warn, .sealv--info .se-glyph--info, .sealv--busy .se-glyph--busy { display: inline; }
.sealv--info { --se-a: #E3EAF5; --se-b: #A9BBD3; --se-c: #6F86A6; --se-glyph: #E3EAF5; border-color: rgba(180, 199, 217, 0.3);
  background: radial-gradient(120% 140% at 0% 0%, rgba(180, 199, 217, 0.14), transparent 46%), linear-gradient(155deg, #0B1D35 0%, #112B4D 62%, #163a66 100%); }
.sealv--busy { --se-a: #E3EAF5; --se-b: #A9BBD3; --se-c: #6F86A6; --se-glyph: #E3EAF5; }
.sealv--warn { --se-a: #FDE68A; --se-b: #F59E0B; --se-c: #B45309; --se-glyph: #FDE68A; border-color: rgba(245, 158, 11, 0.45);
  background: radial-gradient(120% 140% at 0% 0%, rgba(245, 158, 11, 0.18), transparent 46%), linear-gradient(155deg, #1d1606 0%, #2b2110 62%, #3a2b12 100%); }
.sealv--bad { --se-a: #FCA5A5; --se-b: #EF4444; --se-c: #991B1B; --se-glyph: #FECACA; border-color: rgba(239, 68, 68, 0.5);
  background: radial-gradient(120% 140% at 0% 0%, rgba(239, 68, 68, 0.2), transparent 46%), linear-gradient(155deg, #1f0a0d 0%, #2d1015 62%, #3b141b 100%); }
.sealv--ok .se-glyph--ok { stroke-dasharray: 48; stroke-dashoffset: 48; animation: seal-draw 520ms 180ms var(--ease-out) forwards; }
.sealv--ok .se-rosette { transform-origin: 50% 50%; animation: seal-stamp 520ms var(--ease-out) both; }
.sealv--busy .se-glyph--busy circle { animation: seal-dot 1s infinite ease-in-out; }
.sealv--busy .se-glyph--busy circle:nth-child(2) { animation-delay: 0.15s; }
.sealv--busy .se-glyph--busy circle:nth-child(3) { animation-delay: 0.3s; }

/* ── Report: proof chain + signers ─────────────────────────────────────────── */
.sealr { background: var(--surface-100); border: 1px solid var(--surface-300); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); overflow: hidden; }
.sealr[hidden] { display: none; }
.sealr__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px var(--space-md); padding: var(--space-lg) var(--space-xl) 0; }
.sealr__head h2 { margin: 0; font-size: var(--font-size-lg); font-weight: 800; letter-spacing: -0.01em; color: var(--navy-800); }
.sealr__where { display: inline-flex; align-items: center; gap: 6px; font-size: var(--font-size-xs); color: var(--text-muted); }
.sealr__where .icon { color: var(--gold-600); }

.chain { list-style: none; margin: 0; padding: var(--space-lg) var(--space-xl) var(--space-md); }
.chain__step { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: var(--space-md); padding-bottom: var(--space-lg); }
.chain__step::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-400), rgba(212, 175, 55, 0.15)); }
.chain__step:last-child { padding-bottom: 0; }
.chain__step:last-child::before { display: none; }
.chain__node { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--navy-800); color: var(--gold-300); box-shadow: 0 0 0 4px var(--surface-100), 0 0 0 5px rgba(212, 175, 55, 0.35); z-index: 1; }
.chain__step--ok .chain__node { background: linear-gradient(135deg, #0F5132, #15803D); color: #DCFCE7; box-shadow: 0 0 0 4px var(--surface-100), 0 0 0 5px rgba(34, 197, 94, 0.35); }
.chain__step--wait .chain__node { background: linear-gradient(135deg, var(--gold-500), var(--gold-300)); color: var(--navy-900); }
.chain__step--warn .chain__node { background: linear-gradient(135deg, #B45309, #F59E0B); color: #fff; box-shadow: 0 0 0 4px var(--surface-100), 0 0 0 5px rgba(245, 158, 11, 0.35); }
.chain__step--bad .chain__node { background: linear-gradient(135deg, #991B1B, #EF4444); color: #fff; box-shadow: 0 0 0 4px var(--surface-100), 0 0 0 5px rgba(239, 68, 68, 0.35); }
.chain__step--skip .chain__node { background: var(--surface-300); color: var(--text-muted); box-shadow: 0 0 0 4px var(--surface-100), 0 0 0 5px var(--surface-400); }
.chain__step--skip .chain__title, .chain__step--skip .chain__text { color: var(--text-muted); }
.chain__main { min-width: 0; padding-top: 2px; }
.chain__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 1rem; font-weight: 700; color: var(--navy-800); }
.chain__tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-full); background: var(--surface-200); color: var(--text-secondary); border: 1px solid var(--surface-300); }
.chain__step--ok .chain__tag { background: var(--success-light); color: #0F5132; border-color: #BBF7D0; }
.chain__step--wait .chain__tag { background: #FFF4D6; color: #7A4B00; border-color: #F6E2A8; }
.chain__step--warn .chain__tag { background: #FFEDD5; color: #9A3412; border-color: #FED7AA; }
.chain__step--bad .chain__tag { background: #FEE2E2; color: #8A1C1C; border-color: #FECACA; }
.chain__text { margin: 4px 0 0; color: var(--text-secondary); line-height: 1.6; font-size: 0.95rem; }
.chain__text strong { color: var(--text-primary); }
.chain__step.is-new { animation: seal-rise 460ms var(--ease-out) both; }

.tech { margin-top: 8px; }
.tech > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 3px 0; border-radius: 4px; }
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--duration-fast); }
.tech[open] > summary::before { transform: rotate(45deg); }
.tech > summary:hover, .tech > summary:focus-visible { color: var(--navy-700); outline: none; }
.tech__list { margin: 8px 0 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-200); border: 1px solid var(--surface-300); display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: var(--font-size-xs); }
.tech__list dt { color: var(--text-muted); font-weight: 600; }
.tech__list dd { margin: 0; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem; word-break: break-all; color: var(--navy-700); }
.tech__list dd.is-prose { font-family: inherit; font-size: var(--font-size-xs); word-break: normal; color: var(--text-secondary); }

.signers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-md); padding: 0 var(--space-xl) var(--space-xl); }
.sealr__sub { margin: 0; padding: var(--space-md) var(--space-xl) var(--space-md); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); border-top: 1px solid var(--surface-300); }
.signer { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: var(--space-md); border-radius: var(--radius-lg); border: 1px solid var(--surface-300);
  background: linear-gradient(180deg, #fff, var(--surface-200)); }
.signer.is-new { animation: seal-rise 460ms var(--ease-out) both; }
.signer__avatar { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; letter-spacing: 0.02em;
  color: var(--gold-300); background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--gold-500); }
.signer__name { margin: 0; font-weight: 700; color: var(--navy-800); line-height: 1.3; overflow-wrap: anywhere; }
.signer__mail { font-size: var(--font-size-sm); color: var(--text-secondary); overflow-wrap: anywhere; }
.signer__rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--font-size-sm); color: var(--text-secondary); line-height: 1.5; }
.signer__rows li { display: flex; gap: 8px; }
.signer__rows .icon { color: var(--gold-600); margin-top: 3px; }
.signer__claim { display: block; color: var(--text-muted); font-size: var(--font-size-xs); }

.sealr__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm) var(--space-lg); padding: var(--space-md) var(--space-xl); background: var(--surface-200); border-top: 1px solid var(--surface-300); }
.sealr__foot p { margin: 0; font-size: var(--font-size-xs); color: var(--text-muted); line-height: 1.55; max-width: 60ch; }
.sealr__foot .btn-row { flex-shrink: 0; flex-wrap: wrap; max-width: 100%; }

.note-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-100); border: 1px dashed var(--surface-400); color: var(--text-secondary); font-size: var(--font-size-sm); line-height: 1.6; }
.note-line .icon { color: var(--gold-600); margin-top: 4px; }

/* ── Sender's agreement page: the seal strip ───────────────────────────────── */
.sealstrip { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-md); align-items: center; }
.sealstrip__emblem { width: 56px; height: 56px; }
.sealstrip__emblem.sealv { display: block; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.sealstrip__emblem.sealv::after { display: none; }
.sealstrip h2 { margin-bottom: 2px; }
.sealstrip p { margin: 0; font-size: var(--font-size-sm); }
.sealtrack { list-style: none; margin: var(--space-lg) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.sealtrack li { position: relative; padding-top: 22px; font-size: var(--font-size-sm); color: var(--text-muted); line-height: 1.45; padding-right: var(--space-md); }
.sealtrack li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--surface-400); }
.sealtrack li::after { content: ""; position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-100); border: 2px solid var(--surface-400); }
.sealtrack li b { display: block; color: var(--text-secondary); font-weight: 700; }
.sealtrack li.is-done { color: var(--text-secondary); }
.sealtrack li.is-done b { color: var(--navy-800); }
.sealtrack li.is-done::before { background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); }
.sealtrack li.is-done::after { background: var(--gold-500); border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2); }
.sealtrack li.is-current::after { border-color: var(--gold-500); animation: seal-pulse 1.8s infinite; }
.sealtrack li.is-failed::after { background: var(--error); border-color: var(--error); }

@keyframes seal-draw { to { stroke-dashoffset: 0; } }
@keyframes seal-stamp { 0% { transform: scale(1.18) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes seal-dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes seal-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes seal-pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes seal-pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.45); } 70% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); } 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); } }

@media (prefers-reduced-motion: reduce) {
  .sealv *, .sealr *, .sealtrack * { animation: none !important; }
  .sealv--ok .se-glyph--ok { stroke-dashoffset: 0; }
}
@media (max-width: 720px) {
  .sealv { grid-template-columns: 1fr; gap: var(--space-md); padding: var(--space-lg); text-align: left; }
  .sealv__emblem { width: 76px; height: 76px; }
  .sealr__head, .chain, .sealr__sub { padding-left: var(--space-lg); padding-right: var(--space-lg); }
  .signers { padding: 0 var(--space-lg) var(--space-lg); grid-template-columns: 1fr; }
  .sealr__foot { padding: var(--space-md) var(--space-lg); }
  .tech__list { grid-template-columns: 1fr; gap: 2px; }
  .tech__list dd { margin-bottom: 8px; }
  .sealstrip { grid-template-columns: 44px 1fr; }
  .sealstrip__emblem { width: 44px; height: 44px; }
  .sealstrip .btn-row { grid-column: 1 / -1; }
  .sealtrack { grid-template-columns: 1fr; gap: var(--space-sm); }
  .sealtrack li { padding: 0 0 0 24px; }
  .sealtrack li::before { display: none; }
  .sealtrack li::after { top: 4px; }
}
