/* ─────────────────────────────────────────────────────────────────────────
   psc_cinematic.css — Phase 5 cinematic body shell (PSC v2)
   Generalises the Collection Campaigning Launch Studio cinematic
   (`collection_campaign.css:2157-2217`, `psc_collection_campaign.js:2287`,
   `CollectionDistributor.first_unboxed_at`) into a PSC-wide grammar.
   First encounters earn a moment; repeats stay instant.
   See: docs/psc-v2/PSC_Motion_And_Reveal_Grammar.md
        docs/psc-v2/PSC_Body_Grammar.md

   Surface expected from the templates agent (cinematic.html shell):
     .psc-cinematic-stage[data-motion-mode="first-encounter"|"repeat"]
       .psc-cinematic-hero
       .psc-cinematic-body
       .psc-cinematic-drawers[data-drawers-position="right"|"bottom"]
         (existing _psc_drawers_rail.html partial)

   Aesthetic Foundation compliance:
     • no raw hex — all `--bk-*` tokens (or rgba() against tokenised vars)
     • 44×44 hit targets on every interactive element
     • focus-visible rings inherited from design_tokens.css `:focus-visible`
     • motion is opt-in via `data-motion-mode="first-encounter"`; defaults
       to instant (repeat) so a missing attribute never animates.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Stage ─────────────────────────────────────────────────────────────── */
.psc-cinematic-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  background: var(--bk-parchment);
  color: var(--bk-text);
  font-family: var(--bk-font-body, var(--bk-font));
  position: relative;
  isolation: isolate;
}

/* When drawers sit on the right we move the body+drawers into a row pair,
   leaving the hero spanning the full width above. */
.psc-cinematic-stage:has(.psc-cinematic-drawers[data-drawers-position="right"]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "hero hero"
    "body drawers";
  column-gap: var(--bk-space-5);
}

.psc-cinematic-stage:has(.psc-cinematic-drawers[data-drawers-position="right"]) .psc-cinematic-hero {
  grid-area: hero;
}
.psc-cinematic-stage:has(.psc-cinematic-drawers[data-drawers-position="right"]) .psc-cinematic-body {
  grid-area: body;
}
.psc-cinematic-stage:has(.psc-cinematic-drawers[data-drawers-position="right"]) .psc-cinematic-drawers {
  grid-area: drawers;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.psc-cinematic-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--bk-space-10) var(--bk-space-6);
  background:
    radial-gradient(circle at 50% 0%, var(--bk-gold-light) 0%, transparent 60%),
    var(--bk-card);
  border-bottom: 1px solid var(--bk-border);
  font-family: var(--bk-font-serif, var(--bk-font-body));
  gap: var(--bk-space-3);
  /* keep the cinematic cover from spilling beyond the popup */
  overflow: hidden;
  /* default state — visible; animation overrides only on first-encounter */
  opacity: 1;
  transform: none;
}

.psc-cinematic-hero > * {
  /* children default to visible; first-encounter staggers them in */
  opacity: 1;
  transform: none;
}

/* ── Body (the work canvas) ────────────────────────────────────────────── */
.psc-cinematic-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--bk-space-6) var(--bk-space-6);
  /* Bounded vertical scroll so the rail can stay sticky beside it. */
  max-height: 100%;
  overflow-y: auto;
  background: transparent;
  border-top: 1px solid transparent;
  font-family: var(--bk-font-body, var(--bk-font));
  font-size: var(--bk-text-base);
  line-height: 1.55;
  color: var(--bk-text);
}

/* ── Drawers rail (wraps the existing _psc_drawers_rail.html partial) ──── */
.psc-cinematic-drawers {
  position: relative;
  background: var(--bk-card);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-md);
  box-shadow: var(--bk-shadow-sm);
  padding: var(--bk-space-3);
  font-family: var(--bk-font-body, var(--bk-font));
}

/* Right rail — vertical column ~280px. JS adds `position: sticky` when the
   stage is taller than the viewport (see psc_cinematic.js). */
.psc-cinematic-drawers[data-drawers-position="right"] {
  width: 280px;
  max-width: 100%;
  align-self: start;
  margin: var(--bk-space-5) var(--bk-space-5) var(--bk-space-5) 0;
}
[dir="rtl"] .psc-cinematic-drawers[data-drawers-position="right"] {
  margin: var(--bk-space-5) 0 var(--bk-space-5) var(--bk-space-5);
}

/* Bottom rail — horizontal row across the bottom ~120px tall. */
.psc-cinematic-drawers[data-drawers-position="bottom"] {
  width: auto;
  min-height: 120px;
  margin: 0 var(--bk-space-5) var(--bk-space-5);
  border-radius: var(--bk-radius-md);
}

/* The inner rail partial already paints its own pills — we just give it
   a tokenised seat so its background blends with the card. */
.psc-cinematic-drawers .psc-drawers-rail {
  background: transparent;
  border-top: none;
  border-bottom: none;
}

/* ── Motion mode — first-encounter (the moment) ───────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero {
    animation: psc-cin-hero-rise 1.2s ease-out forwards;
  }
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero > * {
    opacity: 0;
    animation: psc-cin-fade-in 0.6s ease-out forwards;
  }
  /* Staggered child reveals — title, subtitle, eyebrow, CTA, etc. */
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero > *:nth-child(1) {
    animation-delay: 0.8s;
  }
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero > *:nth-child(2) {
    animation-delay: 1.0s;
  }
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero > *:nth-child(3) {
    animation-delay: 1.2s;
  }
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero > *:nth-child(4) {
    animation-delay: 1.4s;
  }
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-hero > *:nth-child(n+5) {
    animation-delay: 1.6s;
  }
  /* Body fades in after the hero settles. */
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-body {
    opacity: 0;
    animation: psc-cin-fade-in 0.5s ease-out 1.4s forwards;
  }
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .psc-cinematic-drawers {
    opacity: 0;
    animation: psc-cin-fade-in 0.5s ease-out 1.6s forwards;
  }
}

/* ── Motion mode — repeat (instant, sealed motion contract) ───────────── */
.psc-cinematic-stage[data-motion-mode="repeat"] .psc-cinematic-hero,
.psc-cinematic-stage[data-motion-mode="repeat"] .psc-cinematic-hero > *,
.psc-cinematic-stage[data-motion-mode="repeat"] .psc-cinematic-body,
.psc-cinematic-stage[data-motion-mode="repeat"] .psc-cinematic-drawers {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ── Reduced motion — full bypass (matches collection_campaign.css 2205) ── */
@media (prefers-reduced-motion: reduce) {
  .psc-cinematic-stage .psc-cinematic-hero,
  .psc-cinematic-stage .psc-cinematic-hero > *,
  .psc-cinematic-stage .psc-cinematic-body,
  .psc-cinematic-stage .psc-cinematic-drawers {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── Keyframes (renamed from cr-* so they don't collide with the
       collection-specific reveal in collection_campaign.css) ───────────── */
@keyframes psc-cin-hero-rise {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes psc-cin-fade-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Interactive minimums (Aesthetic Foundation) ──────────────────────── */
.psc-cinematic-stage button,
.psc-cinematic-stage a[role="button"],
.psc-cinematic-stage [data-psc-action] {
  min-height: 44px;
  min-width: 44px;
}

.psc-cinematic-stage button:focus-visible,
.psc-cinematic-stage a:focus-visible,
.psc-cinematic-stage [data-psc-action]:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring);
}

/* ── Mobile — collapse to single column, drawers always at bottom ─────── */
@media (max-width: 768px) {
  .psc-cinematic-stage,
  .psc-cinematic-stage:has(.psc-cinematic-drawers[data-drawers-position="right"]) {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    grid-template-areas: none;
    column-gap: 0;
  }
  .psc-cinematic-hero {
    padding: var(--bk-space-6) var(--bk-space-4);
  }
  .psc-cinematic-body {
    padding: var(--bk-space-4);
  }
  /* Force any rail (regardless of declared data-drawers-position) into the
     bottom row so the work canvas keeps full width on phones. */
  .psc-cinematic-stage .psc-cinematic-drawers,
  .psc-cinematic-stage .psc-cinematic-drawers[data-drawers-position="right"],
  .psc-cinematic-stage .psc-cinematic-drawers[data-drawers-position="bottom"] {
    position: static;
    width: auto;
    max-width: 100%;
    margin: 0 var(--bk-space-3) var(--bk-space-4);
    min-height: 0;
  }
}

/* ── Approval Gate cinematic face ──────────────────────────────────────────
   The approval_gate handler's hero + body slots when its face resolves to
   "cinematic". Subject is shown as a centred decisive moment; the decision
   form lives in the body slot with one primary (Approve) + one outline
   destructive (Reject), 44×44 hit targets, --bk-* tokens only.
   ────────────────────────────────────────────────────────────────────── */

.ag-cinematic-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bk-space-3);
  padding: var(--bk-space-6) var(--bk-space-5);
  text-align: center;
  color: var(--bk-text);
}

.ag-cinematic-hero-eyebrow {
  font-family: var(--bk-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bk-gold-dark);
}

.ag-cinematic-hero-title {
  font-family: var(--bk-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.15;
  margin: 0;
  color: var(--bk-navy);
}

.ag-cinematic-hero-subtitle {
  font-family: var(--bk-font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--bk-gold-dark);
  margin-top: calc(var(--bk-space-1) * -1);
}

.ag-cinematic-subject-card {
  width: 100%;
  max-width: 520px;
  margin-top: var(--bk-space-4);
  padding: var(--bk-space-5);
  border-radius: var(--bk-radius-lg);
  background: linear-gradient(135deg, var(--bk-navy), var(--bk-charcoal));
  color: var(--bk-card);
  box-shadow: var(--bk-shadow-md);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--bk-space-2);
}

.ag-cinematic-subject-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bk-gold-light);
}

.ag-cinematic-subject-card-headline {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bk-card);
}

.ag-cinematic-subject-facets {
  margin: var(--bk-space-2) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--bk-space-1);
}

.ag-cinematic-subject-facet {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr);
  gap: var(--bk-space-3);
  font-size: 0.875rem;
}

.ag-cinematic-subject-facet dt {
  font-weight: 600;
  color: var(--bk-gold-light);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  align-self: center;
}

.ag-cinematic-subject-facet dd {
  margin: 0;
  color: var(--bk-card);
}

.ag-cinematic-subject-meta {
  font-size: 0.8125rem;
  color: var(--bk-gold-light);
  margin-top: var(--bk-space-1);
}

.ag-cinematic-subject-hint {
  font-size: 0.8125rem;
  color: var(--bk-card);
  opacity: 0.85;
  margin-top: var(--bk-space-1);
  font-style: italic;
}

/* ── Body slot ─────────────────────────────────────────────────────────── */
.ag-cinematic-form {
  display: flex;
  flex-direction: column;
  gap: var(--bk-space-3);
  padding: var(--bk-space-5);
}

.ag-cinematic-comment-label {
  display: flex;
  flex-direction: column;
  gap: var(--bk-space-1);
  font-weight: 600;
  color: var(--bk-text);
  font-size: 0.875rem;
}

.ag-cinematic-comment-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--bk-text-muted);
}

.ag-cinematic-comment {
  width: 100%;
  min-height: 44px;
  padding: var(--bk-space-3);
  font-size: 0.9375rem;
  font-family: var(--bk-font-body);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-md);
  background: var(--bk-card);
  color: var(--bk-text);
  resize: vertical;
}

.ag-cinematic-comment:focus-visible {
  outline: 2px solid var(--bk-navy);
  outline-offset: 2px;
  border-color: var(--bk-navy);
}

.ag-cinematic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bk-space-3);
  margin-top: var(--bk-space-2);
}

/* Enforce 44×44 hit target on both decision buttons. */
.ag-cinematic-action {
  min-width: 144px;
  min-height: 44px;
  padding: 0 var(--bk-space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bk-space-2);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--bk-radius-md);
}

.ag-cinematic-action-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Approve = sole primary; tint with --bk-gold per the spec. The base
   .psc-btn-primary rule provides hover/active/focus/disabled states. */
.ag-cinematic-action-approve.psc-btn-primary {
  background: var(--bk-gold-dark);
  border-color: var(--bk-gold-dark);
  color: var(--bk-card);
}
.ag-cinematic-action-approve.psc-btn-primary:hover {
  background: var(--bk-gold);
}
.ag-cinematic-action-approve.psc-btn-primary:active {
  background: var(--bk-gold-dark);
}
.ag-cinematic-action-approve.psc-btn-primary:focus-visible {
  outline: 2px solid var(--bk-gold-dark);
  outline-offset: 2px;
}

/* Reject inherits .psc-btn-destructive — outlined, red focus ring. */

/* ── Result states (post-decision) ─────────────────────────────────────── */
.ag-cinematic-result {
  margin: var(--bk-space-4) var(--bk-space-5);
  padding: var(--bk-space-4);
  border-radius: var(--bk-radius-md);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bk-space-2);
  border: 1px solid var(--bk-border);
  background: var(--bk-surface-2);
  color: var(--bk-text);
}

.ag-cinematic-result-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.ag-cinematic-result-approved {
  border-color: var(--bk-emerald);
  color: var(--bk-emerald);
  background: var(--bk-card);
}

.ag-cinematic-result-rejected {
  border-color: var(--bk-red);
  color: var(--bk-red);
  background: var(--bk-card);
}

.ag-cinematic-result-date {
  font-size: 0.8125rem;
  color: var(--bk-text-muted);
  margin-left: var(--bk-space-2);
}

.ag-cinematic-result-reason {
  flex: 1 1 100%;
  margin-top: var(--bk-space-2);
  font-size: 0.875rem;
  color: var(--bk-text);
  font-style: italic;
}

/* Phone — let the actions stack and stretch full width. */
@media (max-width: 640px) {
  .ag-cinematic-actions {
    flex-direction: column;
  }
  .ag-cinematic-action {
    width: 100%;
  }
}

/* ──── Kit A — Sealed Packet (Phase 6.I.1) ────────────────────────────────
   Ports `docs/psc-widgets/psc_kit_a_sealed_packet_mockup.html` verbatim
   onto live Django-rendered Kit A steps. The mockup's mockup-only `.cin-*`
   / `.wax-*` / `.invoice-table` / `.btn-*` class names are renamed to the
   production `.sp-*` namespace that Agent B's templates emit. Tokens-only;
   all colour references go through --bk-*; new tokens live in
   static/portal/css/design_tokens.css (--bk-wax-red, --bk-wax-red-soft,
   --bk-wax-red-shadow, --bk-ribbon-gold-2, --bk-navy-deep, --bk-aubergine).
   Motion gated by data-motion-mode="first-encounter" on the stage element
   (matches existing PSC cinematic gate) AND the body[data-motion] attr the
   mockup ships; reduced-motion collapses everything to opacity.
   ────────────────────────────────────────────────────────────────────── */

/* ── Stage container (override grid for sealed packet specifically) ─── */
.sp-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--bk-space-5);
  align-items: start;
  isolation: isolate;
}
@media (max-width: 880px) {
  .sp-stage {
    grid-template-columns: 1fr;
  }
}

/* ── HERO ZONE — sealed reveal ──────────────────────────────────────── */
.sp-stage .psc-cinematic-hero {
  position: relative;
  border-radius: var(--bk-radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bk-aubergine) 0%, var(--bk-navy) 60%, var(--bk-navy-deep) 100%);
  min-height: 540px;
  box-shadow: var(--bk-shadow-lg);
  grid-column: 1;
  grid-row: 1;
  isolation: isolate;
  padding: var(--bk-space-8) var(--bk-space-6) var(--bk-space-6);
  border-bottom: none;
}
.sp-stage .psc-cinematic-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 30%, rgba(194,153,84,0.30), transparent 70%),
    radial-gradient(circle at 80% 20%, rgba(245,238,221,0.14), transparent 50%);
  z-index: 1;
  pointer-events: none;
}
.sp-stage .psc-cinematic-hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, transparent 60%, rgba(13,13,24,0.55) 100%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 6px);
  z-index: 2;
  pointer-events: none;
}
.sp-stage .psc-cinematic-hero > * {
  position: relative;
  z-index: 3;
}

/* ── Wax-seal stamp ─────────────────────────────────────────────────── */
.sp-seal {
  width: 132px; height: 132px;
  margin: 0 auto;
  position: relative;
  transform-origin: center top;
}
.sp-seal-disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, var(--bk-wax-red-soft) 0%, var(--bk-wax-red) 38%, var(--bk-wax-red-shadow) 100%);
  box-shadow:
    inset -6px -10px 18px rgba(0,0,0,0.35),
    inset 4px 6px 12px rgba(255,255,255,0.10),
    0 18px 36px rgba(74,14,24,0.45);
}
.sp-seal-disc::after {
  /* Inner rim — dashed gold ring inside the wax */
  content: '';
  position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1.5px dashed rgba(245,238,221,0.35);
  pointer-events: none;
}
.sp-monogram {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font: italic 700 56px/1 var(--bk-font-serif);
  color: var(--bk-gold-soft);
  text-shadow: 0 1px 0 rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.30);
  letter-spacing: -0.02em;
  z-index: 2;
}
/* Ribbons behind the disc */
.sp-ribbon-left,
.sp-ribbon-right {
  position: absolute; top: 70%;
  width: 28px; height: 88px;
  background: linear-gradient(180deg, var(--bk-ribbon-gold) 0%, var(--bk-ribbon-gold-2) 100%);
  z-index: -1;
  transform-origin: top center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}
.sp-ribbon-left  { left:  18px; transform: rotate(-14deg); }
.sp-ribbon-right { right: 18px; transform: rotate( 14deg); }

/* ── Hero text (sp-eyebrow / sp-title / sp-subtitle) ────────────────── */
.sp-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bk-gold-soft);
  text-align: center;
}
.sp-title {
  font-family: var(--bk-font-serif);
  font-weight: 600; font-style: italic;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
  color: var(--bk-card);
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0;
}
.sp-subtitle {
  font-family: var(--bk-font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--bk-gold-soft);
  max-width: 560px;
  text-align: center;
  margin: 0 auto;
}

/* ── Document thumbnail ─────────────────────────────────────────────── */
.sp-thumb {
  width: 200px; height: 260px;
  background: var(--bk-card);
  border-radius: var(--bk-radius-sm);
  box-shadow: var(--bk-shadow-lg);
  padding: 0;
  transform: rotate(-2deg);
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bk-border);
  margin: 0 auto;
}
.sp-thumb-shadow {
  /* Reserved slot — the .sp-thumb rotation creates a shadow naturally via
     box-shadow; this class is a no-op placeholder Agent B's template may
     emit. Keeps the contract honest without imposing visuals. */
  display: none;
}

/* ── Body zone (invoice line-items + actions) ───────────────────────── */
.sp-body {
  grid-column: 1;
  grid-row: 2;
  background: var(--bk-card);
  border-radius: var(--bk-radius-lg);
  box-shadow: var(--bk-shadow-md);
  padding: var(--bk-space-5) var(--bk-space-6);
  margin-top: var(--bk-space-5);
  border: 1px solid var(--bk-border);
  max-height: none;
  overflow-y: visible;
}

/* ── Table ──────────────────────────────────────────────────────────── */
.sp-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.sp-table thead th {
  background: var(--bk-navy); color: var(--bk-card);
  text-align: left; padding: 0.7rem 0.85rem;
  font: 700 11px/1 var(--bk-font-body); letter-spacing: 0.12em; text-transform: uppercase;
}
.sp-table thead th.sp-row-qty,
.sp-table thead th.sp-row-unit,
.sp-table thead th.sp-row-subtotal {
  text-align: right;
}
.sp-table tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--bk-border);
  color: var(--bk-text);
}
.sp-table tbody .sp-row:nth-child(even) td {
  background: var(--bk-stripe);
}
.sp-row-qty, .sp-row-unit, .sp-row-subtotal {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sp-totals td {
  padding: 0.7rem 0.85rem;
  font-weight: 700;
  border-top: 2px solid var(--bk-navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--bk-text);
}
.sp-total-row.subtotal td { color: var(--bk-text-muted); }
.sp-total-row.total td {
  font: italic 700 1.15rem var(--bk-font-serif);
  color: var(--bk-navy);
  background: var(--bk-gold-glow);
}
.sp-total-row.total td.label-cell { text-align: left; }

/* ── Action row ─────────────────────────────────────────────────────── */
.sp-actions {
  display: flex; gap: var(--bk-space-3);
  margin-top: var(--bk-space-5);
  padding-top: var(--bk-space-4);
  border-top: 1px solid var(--bk-border);
  align-items: center;
  flex-wrap: wrap;
}

/* Primary action — gold fill, navy text */
.sp-btn-primary {
  background: var(--bk-gold);
  color: var(--bk-navy);
  border: 1.5px solid var(--bk-gold);
  padding: 0.85rem 1.8rem;
  border-radius: var(--bk-radius-md);
  font: 700 15px var(--bk-font-body);
  cursor: pointer;
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; gap: var(--bk-space-2);
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
  letter-spacing: 0.01em;
  box-shadow: var(--bk-shadow-sm);
}
.sp-btn-primary:hover {
  background: var(--bk-gold-light);
  border-color: var(--bk-gold-light);
  box-shadow: var(--bk-shadow-md);
}
.sp-btn-primary:active {
  transform: translateY(1px);
  box-shadow: var(--bk-shadow-sm);
}
.sp-btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring);
}
.sp-btn-primary:disabled {
  background: var(--bk-border);
  color: var(--bk-text-muted);
  border-color: var(--bk-border);
  cursor: not-allowed;
  box-shadow: none;
}

/* Secondary action — navy outline */
.sp-btn-secondary {
  background: var(--bk-card);
  color: var(--bk-navy);
  border: 1.5px solid var(--bk-navy);
  padding: 0.85rem 1.4rem;
  border-radius: var(--bk-radius-md);
  font: 600 14px var(--bk-font-body);
  cursor: pointer;
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; gap: var(--bk-space-2);
  transition: background 0.15s, transform 0.08s;
}
.sp-btn-secondary:hover { background: var(--bk-gold-glow); }
.sp-btn-secondary:active { transform: translateY(1px); }
.sp-btn-secondary:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring);
}
.sp-btn-secondary:disabled {
  color: var(--bk-text-muted);
  border-color: var(--bk-border);
  cursor: not-allowed;
}

/* ──── Motion — first-encounter only (sealed gate) ──────────────────── */
@keyframes sp-seal-descend {
  from { opacity: 0; transform: translateY(-180px) scale(0.4) rotate(-8deg); }
  to   { opacity: 1; transform: translateY(0)     scale(1)   rotate(0); }
}
@keyframes sp-ribbon-unfurl-left {
  from { transform: rotate(-14deg) scaleY(0); }
  to   { transform: rotate(-14deg) scaleY(1); }
}
@keyframes sp-ribbon-unfurl-right {
  from { transform: rotate(14deg) scaleY(0); }
  to   { transform: rotate(14deg) scaleY(1); }
}
@keyframes sp-stagger-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sp-thumb-place {
  from { opacity: 0; transform: translateY(16px) rotate(-2deg); }
  to   { opacity: 1; transform: translateY(0)    rotate(-2deg); }
}
@keyframes sp-row-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sp-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Gate every animation on the stage attribute OR the body attribute the
   mockup ships. Both forms get the same choreography. */
.sp-stage[data-motion-mode="first-encounter"] .sp-seal,
body[data-motion="first-encounter"] .sp-stage .sp-seal {
  animation: sp-seal-descend 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-ribbon-left,
body[data-motion="first-encounter"] .sp-stage .sp-ribbon-left {
  animation: sp-ribbon-unfurl-left 0.4s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-ribbon-right,
body[data-motion="first-encounter"] .sp-stage .sp-ribbon-right {
  animation: sp-ribbon-unfurl-right 0.4s 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-eyebrow,
body[data-motion="first-encounter"] .sp-stage .sp-eyebrow {
  animation: sp-stagger-fade 0.4s 0.80s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-title,
body[data-motion="first-encounter"] .sp-stage .sp-title {
  animation: sp-stagger-fade 0.5s 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-subtitle,
body[data-motion="first-encounter"] .sp-stage .sp-subtitle {
  animation: sp-stagger-fade 0.4s 1.10s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-thumb,
body[data-motion="first-encounter"] .sp-stage .sp-thumb {
  animation: sp-thumb-place 0.5s 1.20s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-body,
body[data-motion="first-encounter"] .sp-stage .sp-body {
  animation: sp-fade-up 0.7s 1.0s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(1),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(1)  { animation: sp-row-fade 0.3s 1.05s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(2),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(2)  { animation: sp-row-fade 0.3s 1.10s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(3),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(3)  { animation: sp-row-fade 0.3s 1.15s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(4),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(4)  { animation: sp-row-fade 0.3s 1.20s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(5),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(5)  { animation: sp-row-fade 0.3s 1.25s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(6),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(6)  { animation: sp-row-fade 0.3s 1.30s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(7),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(7)  { animation: sp-row-fade 0.3s 1.35s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(8),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(8)  { animation: sp-row-fade 0.3s 1.40s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(9),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(9)  { animation: sp-row-fade 0.3s 1.45s ease-out both; }
.sp-stage[data-motion-mode="first-encounter"] .sp-table tbody tr:nth-child(10),
body[data-motion="first-encounter"] .sp-stage .sp-table tbody tr:nth-child(10) { animation: sp-row-fade 0.3s 1.50s ease-out both; }

/* Repeat mode — skip motion entirely */
.sp-stage[data-motion-mode="repeat"] .sp-seal,
.sp-stage[data-motion-mode="repeat"] .sp-ribbon-left,
.sp-stage[data-motion-mode="repeat"] .sp-ribbon-right,
.sp-stage[data-motion-mode="repeat"] .sp-eyebrow,
.sp-stage[data-motion-mode="repeat"] .sp-title,
.sp-stage[data-motion-mode="repeat"] .sp-subtitle,
.sp-stage[data-motion-mode="repeat"] .sp-thumb,
.sp-stage[data-motion-mode="repeat"] .sp-body,
.sp-stage[data-motion-mode="repeat"] .sp-table tbody tr,
body[data-motion="repeat"] .sp-stage .sp-seal,
body[data-motion="repeat"] .sp-stage .sp-ribbon-left,
body[data-motion="repeat"] .sp-stage .sp-ribbon-right,
body[data-motion="repeat"] .sp-stage .sp-eyebrow,
body[data-motion="repeat"] .sp-stage .sp-title,
body[data-motion="repeat"] .sp-stage .sp-subtitle,
body[data-motion="repeat"] .sp-stage .sp-thumb,
body[data-motion="repeat"] .sp-stage .sp-body,
body[data-motion="repeat"] .sp-stage .sp-table tbody tr {
  animation: none !important;
  opacity: 1;
}
/* Preserve thumb + ribbon rotations in repeat mode */
.sp-stage[data-motion-mode="repeat"] .sp-thumb,
body[data-motion="repeat"] .sp-stage .sp-thumb { transform: rotate(-2deg) !important; }
.sp-stage[data-motion-mode="repeat"] .sp-ribbon-left,
body[data-motion="repeat"] .sp-stage .sp-ribbon-left { transform: rotate(-14deg) !important; }
.sp-stage[data-motion-mode="repeat"] .sp-ribbon-right,
body[data-motion="repeat"] .sp-stage .sp-ribbon-right { transform: rotate(14deg) !important; }

/* Reduced motion — collapse everything to opacity */
@media (prefers-reduced-motion: reduce) {
  .sp-stage .sp-seal,
  .sp-stage .sp-ribbon-left,
  .sp-stage .sp-ribbon-right,
  .sp-stage .sp-eyebrow,
  .sp-stage .sp-title,
  .sp-stage .sp-subtitle,
  .sp-stage .sp-thumb,
  .sp-stage .sp-body,
  .sp-stage .sp-table tbody tr {
    animation: none !important;
    opacity: 1; transform: none;
  }
  .sp-stage .sp-ribbon-left  { transform: rotate(-14deg) !important; }
  .sp-stage .sp-ribbon-right { transform: rotate(14deg) !important; }
  .sp-stage .sp-thumb        { transform: rotate(-2deg) !important; }
}

/* Phone — actions stack, columns collapse */
@media (max-width: 640px) {
  .sp-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .sp-btn-primary,
  .sp-btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ──── Kit C — Copilot Proposer variant (Phase 6.I.2) ────────────────────
   Ports the Copilot-tinted chrome from
   docs/psc-widgets/psc_kit_c_copilot_variant_mockup.html onto live
   Witness Stamp steps that carry [data-ai-proposer="true"]. Visuals layer
   ON TOP of the base .ag-cinematic-* shell:

     • risk-tier pill (red / amber / green) — eyebrow chip with blink dot
     • red-tier glow + pulse — subtle left-border accent on the hero
     • TTL countdown — JetBrains-Mono gold-tinted digits, top-right of hero
     • Copilot eyebrow — 🤖 "COPILOT PROPOSES" prefix on the hero eyebrow
     • Diff table — dry-run before/after rendered in the body slot
     • Edit form — JSON edit-mode swap (alternate body state)

   All gates use `[data-ai-proposer="true"]` on the body or stage element.
   Risk-tier glow is keyed by `[data-risk-tier="red|amber|green"]`. Tokens-
   only — risk-tier vars live in static/portal/css/design_tokens.css.
   ────────────────────────────────────────────────────────────────────── */

/* ── Risk-tier pill ──────────────────────────────────────────────────── */
.ag-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--bk-card);
  padding: 4px 10px;
  border-radius: var(--bk-radius-pill);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 2px 8px rgba(0, 0, 0, 0.25);
  min-height: auto;     /* the chip is informational, not interactive */
  min-width: auto;
}
.ag-tier-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--bk-card);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  animation: ag-tier-blink 1.6s ease-in-out infinite;
}
.ag-tier-pill.ag-tier-red    { background: var(--bk-tier-red); }
.ag-tier-pill.ag-tier-amber  { background: var(--bk-tier-amber); }
.ag-tier-pill.ag-tier-green  { background: var(--bk-tier-green); }

@keyframes ag-tier-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ── Copilot-tinted hero glow (red-tier only) ────────────────────────── */
body[data-ai-proposer="true"][data-risk-tier="red"] .ag-cinematic-hero,
.psc-cinematic-stage[data-ai-proposer="true"][data-risk-tier="red"] .ag-cinematic-hero,
.ag-cinematic-copilot-glow[data-risk-tier="red"] {
  box-shadow:
    inset 4px 0 0 var(--bk-tier-red),
    0 16px 48px rgba(220, 38, 38, 0.14);
  animation: ag-glow-pulse 3.4s ease-in-out infinite;
}
body[data-ai-proposer="true"][data-risk-tier="amber"] .ag-cinematic-hero,
.psc-cinematic-stage[data-ai-proposer="true"][data-risk-tier="amber"] .ag-cinematic-hero,
.ag-cinematic-copilot-glow[data-risk-tier="amber"] {
  box-shadow:
    inset 4px 0 0 var(--bk-tier-amber),
    0 16px 48px rgba(245, 158, 11, 0.12);
}
body[data-ai-proposer="true"][data-risk-tier="green"] .ag-cinematic-hero,
.psc-cinematic-stage[data-ai-proposer="true"][data-risk-tier="green"] .ag-cinematic-hero,
.ag-cinematic-copilot-glow[data-risk-tier="green"] {
  box-shadow:
    inset 4px 0 0 var(--bk-tier-green),
    0 16px 48px rgba(16, 185, 129, 0.12);
}

@keyframes ag-glow-pulse {
  0%, 100% { opacity: 0.92; }
  50%      { opacity: 1; }
}

/* ── Copilot eyebrow ─────────────────────────────────────────────────── */
.ag-copilot-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bk-gold-soft);
}
.ag-copilot-eyebrow .ag-copilot-robot { font-size: 16px; }
.ag-copilot-eyebrow .ag-copilot-dot   { opacity: 0.45; }

/* ── TTL countdown ───────────────────────────────────────────────────── */
.ag-ttl-countdown {
  text-align: right;
  color: var(--bk-gold-soft);
  font-family: var(--bk-font-body);
}
.ag-ttl-countdown .ag-ttl-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bk-gold-soft);
  opacity: 0.9;
}
.ag-ttl-countdown .ag-ttl-digits {
  font-family: var(--bk-font-mono);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--bk-gold);
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 2px;
}
.ag-ttl-countdown[data-ttl-expired="true"] .ag-ttl-digits {
  color: var(--bk-tier-red);
  opacity: 0.7;
}
.ag-ttl-countdown .ag-ttl-expired-slug {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bk-tier-red);
  display: none;
}
.ag-ttl-countdown[data-ttl-expired="true"] .ag-ttl-expired-slug {
  display: block;
}

/* Expired-state mask over the action row */
body[data-ttl-expired="true"] .ag-cinematic-actions,
.psc-cinematic-stage[data-ttl-expired="true"] .ag-cinematic-actions {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Diff table (dry-run before/after) ───────────────────────────────── */
.ag-diff-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  font-family: var(--bk-font-body);
}
.ag-diff-table th,
.ag-diff-table td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--bk-border);
  vertical-align: middle;
}
.ag-diff-table thead th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bk-text-muted);
  background: var(--bk-gold-glow);
  border-bottom: 1px solid var(--bk-border);
}
.ag-diff-table thead th:first-child { border-top-left-radius: var(--bk-radius-sm); }
.ag-diff-table thead th:last-child  { border-top-right-radius: var(--bk-radius-sm); }
.ag-diff-table tbody th {
  font-weight: 600;
  color: var(--bk-text);
  width: 28%;
}
.ag-diff-row .ag-diff-before {
  color: var(--bk-text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.18);
}
.ag-diff-row .ag-diff-arrow {
  color: var(--bk-gold);
  font-weight: 700;
  text-align: center;
  width: 32px;
}
.ag-diff-row .ag-diff-after {
  color: var(--bk-text);
  font-weight: 600;
}
.ag-diff-row .ag-diff-after.ag-diff-unchanged {
  color: var(--bk-text-muted);
  font-weight: 400;
  font-style: italic;
}
.ag-diff-table tbody tr:last-child th,
.ag-diff-table tbody tr:last-child td { border-bottom: none; }

/* Per-row stagger animation on first encounter — gated like the rest */
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ag-diff-table tbody tr,
body[data-motion="first-encounter"] .ag-diff-table tbody tr {
  animation: ag-diff-stagger-fade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ag-diff-table tbody tr:nth-child(1),
body[data-motion="first-encounter"] .ag-diff-table tbody tr:nth-child(1) { animation-delay: 0.70s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ag-diff-table tbody tr:nth-child(2),
body[data-motion="first-encounter"] .ag-diff-table tbody tr:nth-child(2) { animation-delay: 0.76s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ag-diff-table tbody tr:nth-child(3),
body[data-motion="first-encounter"] .ag-diff-table tbody tr:nth-child(3) { animation-delay: 0.82s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ag-diff-table tbody tr:nth-child(4),
body[data-motion="first-encounter"] .ag-diff-table tbody tr:nth-child(4) { animation-delay: 0.88s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ag-diff-table tbody tr:nth-child(n+5),
body[data-motion="first-encounter"] .ag-diff-table tbody tr:nth-child(n+5) { animation-delay: 0.94s; }

@keyframes ag-diff-stagger-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* "Edited" flag on the body eyebrow after operator edits the proposal */
.ag-edited-flag {
  background: rgba(16, 185, 129, 0.16);
  color: var(--bk-emerald);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--bk-radius-pill);
  margin-left: var(--bk-space-2);
}

/* ── Edit form (JSON edit-mode swap of the body slot) ────────────────── */
.ag-edit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bk-space-3);
  animation: ag-edit-fade-up 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ag-edit-form[hidden] { display: none; }

.ag-edit-field {
  display: flex;
  flex-direction: column;
  gap: var(--bk-space-1);
}

.ag-edit-field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bk-text-muted);
}
.ag-edit-field-label .ag-edit-req { color: var(--bk-tier-red); }

.ag-edit-input,
.ag-edit-textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid var(--bk-border);
  border-radius: var(--bk-radius-md);
  font-family: var(--bk-font-body);
  font-size: 14px;
  color: var(--bk-text);
  background: var(--bk-gold-glow);
  min-height: 44px;
}
.ag-edit-textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}
.ag-edit-input:focus-visible,
.ag-edit-textarea:focus-visible {
  outline: none;
  border-color: var(--bk-gold);
  box-shadow: var(--bk-focus-ring);
}

.ag-edit-actions {
  display: flex;
  gap: var(--bk-space-2);
  justify-content: flex-end;
  margin-top: var(--bk-space-2);
  padding-top: var(--bk-space-3);
  border-top: 1px solid var(--bk-border);
}

@keyframes ag-edit-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduced motion — collapse pulse + stagger + edit transition ─────── */
@media (prefers-reduced-motion: reduce) {
  body[data-ai-proposer="true"] .ag-cinematic-hero,
  .psc-cinematic-stage[data-ai-proposer="true"] .ag-cinematic-hero,
  .ag-cinematic-copilot-glow {
    animation: none !important;
  }
  .ag-tier-pill::before {
    animation: none !important;
  }
  .ag-diff-table tbody tr {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .ag-edit-form {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* ────────────────────────────────────────────────────────────────────────
   Kit B — Showcase Reveal (Phase 6.I.3)
   Mockup: docs/psc-widgets/psc_kit_b_showcase_reveal_mockup.html
   Handler: apps/workflow/cards/renderers/showcase_reveal_handler.py
   Sections: workflow/step_bodies/sections/_showcase_hero.html
             workflow/step_bodies/sections/_showcase_gallery.html

   Aesthetic Foundation compliance:
     • only --bk-* tokens — no raw hex outside swatch data (which is content)
     • all interactive elements ≥ 44×44px
     • focus-visible rings via --bk-focus-ring
     • motion is opt-in via the parent stage's data-motion-mode="first-encounter"
       attribute (set by ShowcaseRevealHandler when the cinematic shell is
       active); repeats stay instant.
   ──────────────────────────────────────────────────────────────────────── */

/* ── Stage hook — Kit B sits inside the .psc-cinematic-stage grid ────── */
.sr-stage {
  display: contents;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.sr-hero {
  position: relative;
  width: 100%;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--bk-space-10) var(--bk-space-6) var(--bk-space-8);
  background:
    radial-gradient(ellipse 60% 80% at 30% 40%,
      rgba(194, 153, 84, 0.30) 0%,
      rgba(194, 153, 84, 0.08) 35%,
      transparent 70%),
    linear-gradient(160deg,
      var(--bk-navy) 0%,
      var(--bk-navy-deep, var(--bk-navy)) 60%,
      var(--bk-navy) 100%);
  overflow: hidden;
  isolation: isolate;
  font-family: var(--bk-font-serif, var(--bk-font-body));
}
.sr-hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      transparent 55%,
      rgba(0, 0, 0, 0.35) 100%);
  z-index: 1;
  pointer-events: none;
}
.sr-hero-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
}
.sr-hero-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sr-hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bk-space-4);
}

.sr-eyebrow {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 700;
  font-size: var(--bk-text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bk-gold-soft);
  opacity: 0.85;
}

.sr-title {
  font-family: var(--bk-font-serif, var(--bk-font-body));
  font-style: italic;
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--bk-gold-glow);
  text-shadow: 0 2px 24px rgba(194, 153, 84, 0.45);
  margin: var(--bk-space-2) 0;
}

.sr-mood {
  font-family: var(--bk-font-serif, var(--bk-font-body));
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--bk-gold-soft);
  line-height: 1.4;
  display: inline-flex;
  justify-content: center;
  min-height: 1.8em;
  margin: 0;
}
.sr-typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
}

.sr-signature {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 400;
  font-size: var(--bk-text-sm);
  color: var(--bk-gold-soft);
  opacity: 0.7;
  letter-spacing: 0.04em;
  margin: var(--bk-space-2) 0 0;
}

/* ── Palette swatches ─────────────────────────────────────────────────── */
.sr-palette-row {
  display: flex;
  gap: var(--bk-space-6);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--bk-space-2);
}
.sr-palette-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bk-space-2);
}
.sr-palette-label {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bk-gold-soft);
  opacity: 0.7;
}
.sr-palette-swatches {
  display: flex;
  gap: 6px;
}
.sr-palette-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(194, 153, 84, 0.22);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3),
              inset 0 1px 2px rgba(255, 255, 255, 0.08);
  display: inline-block;
}

/* ── Greeting CTA ─────────────────────────────────────────────────────── */
.sr-greeting-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--bk-space-2);
  background: var(--bk-gold);
  color: var(--bk-navy);
  border: 1px solid var(--bk-gold-soft);
  padding: 0 var(--bk-space-5);
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--bk-radius-pill);
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 700;
  font-size: var(--bk-text-sm);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--bk-shadow-md);
  transition: background 0.2s, transform 0.1s;
  margin-top: var(--bk-space-2);
}
.sr-greeting-btn:hover  { background: var(--bk-gold-soft); }
.sr-greeting-btn:active { transform: translateY(1px); }
.sr-greeting-btn:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring);
}
.sr-greeting-btn[data-playing="true"] {
  animation: sr-pulse-soft 1.4s ease-in-out infinite;
}
.sr-greeting-icon {
  font-size: 14px;
  width: 18px;
  display: inline-block;
  text-align: center;
}
.sr-greeting-wave {
  display: none;
  gap: 2px;
  height: 14px;
  align-items: flex-end;
}
.sr-greeting-btn[data-playing="true"] .sr-greeting-wave {
  display: inline-flex;
}
.sr-greeting-wave i {
  display: block;
  width: 3px;
  background: var(--bk-navy);
  border-radius: 2px;
  animation: sr-wave-bar 0.9s ease-in-out infinite;
}
.sr-greeting-wave i:nth-child(1) { animation-delay: 0s; }
.sr-greeting-wave i:nth-child(2) { animation-delay: 0.1s; }
.sr-greeting-wave i:nth-child(3) { animation-delay: 0.2s; }
.sr-greeting-wave i:nth-child(4) { animation-delay: 0.3s; }

@keyframes sr-wave-bar {
  0%, 100% { height: 20%; }
  50%      { height: 90%; }
}
@keyframes sr-pulse-soft {
  0%, 100% { box-shadow: var(--bk-shadow-md); }
  50%      { box-shadow: 0 4px 22px rgba(194, 153, 84, 0.45); }
}

/* ── Body (gallery surface) ───────────────────────────────────────────── */
.sr-body {
  padding: var(--bk-space-6) 0;
}
.sr-body-eyebrow {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 700;
  font-size: var(--bk-text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bk-gold);
  text-align: center;
  margin-bottom: var(--bk-space-5);
}

/* ── Masonry gallery ──────────────────────────────────────────────────── */
.sr-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--bk-space-4);
}
@media (max-width: 720px) {
  .sr-gallery { grid-template-columns: 1fr; }
}

.sr-card {
  background: var(--bk-card);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.25s;
  box-shadow: var(--bk-shadow-sm);
  min-height: 44px;
}
.sr-card:hover {
  box-shadow: var(--bk-shadow-md);
  transform: translateY(-2px);
}
.sr-card:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring);
}
.sr-card.is-open {
  box-shadow: var(--bk-shadow-lg);
}

.sr-card-thumb {
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    var(--bk-navy) 0%,
    var(--bk-navy-deep, var(--bk-navy)) 100%);
  overflow: hidden;
}
.sr-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%,
    rgba(194, 153, 84, 0.25) 0%,
    transparent 60%);
  pointer-events: none;
}
.sr-card-thumb-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sr-card-monogram {
  position: relative;
  z-index: 2;
  font-family: var(--bk-font-serif, var(--bk-font-body));
  font-style: italic;
  font-weight: 300;
  font-size: 5rem;
  color: var(--bk-gold-glow);
  text-shadow: 0 2px 16px rgba(194, 153, 84, 0.5);
  line-height: 1;
}

.sr-card-meta {
  padding: var(--bk-space-4) var(--bk-space-4) var(--bk-space-3);
}
.sr-card-name {
  font-family: var(--bk-font-serif, var(--bk-font-body));
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--bk-navy);
  line-height: 1.2;
}
.sr-card-hook {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 700;
  font-size: var(--bk-text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bk-gold);
  margin-top: var(--bk-space-1);
}
.sr-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--bk-space-3);
}
.sr-card-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--bk-text-muted);
  background: var(--bk-parchment);
  border: 1px solid rgba(194, 153, 84, 0.22);
  padding: 4px 9px;
  border-radius: var(--bk-radius-pill);
}

/* ── Card expanded body (tap to expand) ──────────────────────────────── */
.sr-card-expanded-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.4s ease;
  padding: 0 var(--bk-space-4);
  border-top: 0px solid transparent;
}
.sr-card.is-open .sr-card-expanded-body {
  max-height: 480px;
  padding: var(--bk-space-3) var(--bk-space-4) var(--bk-space-4);
  border-top: 1px solid rgba(194, 153, 84, 0.22);
}
.sr-card-story {
  font-family: var(--bk-font-serif, var(--bk-font-body));
  font-style: italic;
  font-weight: 400;
  color: var(--bk-text);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 var(--bk-space-3);
}
.sr-card-style-label {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bk-text-muted);
  margin-bottom: var(--bk-space-1);
}
.sr-card-style-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.sr-card-style-pill {
  font-family: var(--bk-font-body, var(--bk-font));
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--bk-navy);
  background: var(--bk-gold-glow);
  border: 1px solid rgba(194, 153, 84, 0.22);
  padding: 3px 9px;
  border-radius: var(--bk-radius-pill);
}

/* ── Next-hint + empty ───────────────────────────────────────────────── */
.sr-next-hint {
  text-align: center;
  font-family: var(--bk-font-serif, var(--bk-font-body));
  font-style: italic;
  color: var(--bk-text-muted);
  font-size: 0.95rem;
  margin: var(--bk-space-6) 0 var(--bk-space-3);
}
.sr-gallery-empty {
  text-align: center;
  padding: var(--bk-space-10) var(--bk-space-4);
  color: var(--bk-text-muted);
  font-size: 0.95rem;
}

/* ── Motion — first-encounter only; repeat stays instant ──────────────── */
@keyframes sr-cover-in {
  0%   { opacity: 0; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes sr-title-rise {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sr-typewriter {
  from { width: 0; }
  to   { width: 24ch; }
}
@keyframes sr-caret-blink {
  0%, 49%   { border-right-color: var(--bk-gold); }
  50%, 100% { border-right-color: transparent; }
}
@keyframes sr-swatch-in {
  0%   { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes sr-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sr-greeting-in {
  0%   { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-hero {
  animation: sr-cover-in 1.4s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-eyebrow {
  animation: sr-fade-up 0.6s 0.2s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-title {
  animation: sr-title-rise 1.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-mood .sr-typewriter {
  border-right: 2px solid var(--bk-gold);
  width: 24ch;
  animation:
    sr-typewriter 1.2s 1.0s steps(24, end) both,
    sr-caret-blink 0.7s 1.0s step-end infinite;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-swatch {
  opacity: 0;
  animation: sr-swatch-in 0.4s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-swatch:nth-child(1) { animation-delay: 1.50s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-swatch:nth-child(2) { animation-delay: 1.58s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-swatch:nth-child(3) { animation-delay: 1.66s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-swatch:nth-child(4) { animation-delay: 1.74s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-group .sr-palette-label {
  animation: sr-fade-up 0.45s 1.45s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-greeting-btn {
  animation: sr-greeting-in 0.55s 2.0s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-signature {
  animation: sr-fade-up 0.6s 2.2s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-body-eyebrow {
  animation: sr-fade-up 0.55s 2.3s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card {
  opacity: 0;
  animation: sr-fade-up 0.7s ease-out both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card:nth-child(1) { animation-delay: 2.50s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card:nth-child(2) { animation-delay: 2.60s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card:nth-child(3) { animation-delay: 2.70s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card:nth-child(4) { animation-delay: 2.80s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card:nth-child(5) { animation-delay: 2.90s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card:nth-child(6) { animation-delay: 3.00s; }
.psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-next-hint {
  animation: sr-fade-up 0.55s 3.2s ease-out both;
}

/* Repeat — typewriter stays at full width with no caret. */
.psc-cinematic-stage[data-motion-mode="repeat"] .sr-mood .sr-typewriter {
  width: auto;
  border-right: none;
  animation: none;
}

/* Reduced motion — collapse to opacity-only (sealed contract). */
@media (prefers-reduced-motion: reduce) {
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-hero,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-eyebrow,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-title,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-mood .sr-typewriter,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-swatch,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-palette-label,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-greeting-btn,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-signature,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-body-eyebrow,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-card,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .sr-next-hint {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .sr-mood .sr-typewriter {
    width: auto !important;
    border-right: none !important;
    animation: none !important;
  }
  .sr-greeting-btn[data-playing="true"] {
    animation: none !important;
  }
}

/* ──── Kit E — Iterative Rounds (Phase 6.I.5) ──── */
/* Side-by-side submitted/target comparison hero + decision row + round
 * history strip. All chrome 100% token-driven; swatch backgrounds carry
 * REAL product color (lab dip hex), not chrome.
 * Mockup: docs/psc-widgets/psc_kit_e_iterative_rounds_mockup.html
 */
.ir-stage {
  position: relative; z-index: 3;
  padding: 2.25rem 2.5rem 2rem;
  display: flex; flex-direction: column;
  gap: 1.4rem;
  min-height: 440px;
}
.ir-eyebrow-row {
  display: flex; flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.ir-round-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bk-gold);
  color: var(--bk-navy);
  padding: 5px 12px;
  border-radius: var(--bk-radius-pill);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.ir-state-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(245,158,11,0.18);
  color: var(--bk-amber-soft);
  border: 1px solid rgba(245,158,11,0.4);
  padding: 5px 12px;
  border-radius: var(--bk-radius-pill);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.ir-state-pill.ir-state-approved_final {
  background: rgba(16,185,129,0.18);
  color: var(--bk-gold-glow);
  border-color: rgba(16,185,129,0.45);
}
.ir-state-pill.ir-state-revision_requested {
  background: var(--bk-red-soft);
  color: var(--bk-red);
  border-color: rgba(220,38,38,0.45);
}
.ir-title {
  font-family: var(--bk-font-display);
  font-weight: 600; font-style: italic;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
  color: white;
  letter-spacing: -0.01em;
}
.ir-subtitle {
  font-family: var(--bk-font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--bk-gold-soft);
  max-width: 560px;
}
.ir-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: 0.5rem;
}
.ir-compare-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(194,153,84,0.10) 100%);
  border: 1px solid rgba(245,238,221,0.20);
  border-radius: var(--bk-radius);
  padding: 1rem 1.1rem 1.1rem;
  color: white;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.ir-compare-card.ir-target {
  border-color: var(--bk-gold-soft);
  box-shadow: inset 0 0 0 1px rgba(212,178,117,0.18);
}
.ir-compare-eyebrow {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bk-gold-soft);
}
.ir-swatch-block {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  border-radius: var(--bk-radius-sm);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.18),
    inset 0 -10px 24px rgba(0,0,0,0.12),
    0 4px 12px rgba(0,0,0,0.28);
  transition: opacity 0.25s ease;
}
.ir-swatch-block.ir-swatch-empty {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(245,238,221,0.20);
  box-shadow: none;
}
.ir-swatch-img {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--bk-radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.28);
}
.ir-compare-label {
  font-size: 13px; font-weight: 700;
  color: white;
  text-align: center;
}
.ir-compare-meta {
  font-size: 11px;
  font-family: var(--bk-font-mono);
  color: rgba(245,238,221,0.72);
  letter-spacing: 0.04em;
}
.ir-compare-arrow {
  align-self: center;
  font-size: 1.4rem;
  color: var(--bk-gold-soft);
  padding: 0 0.25rem;
  font-family: var(--bk-font-display);
  user-select: none;
}
.ir-delta-pill-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}
.ir-delta-pill {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: rgba(245,158,11,0.18);
  color: var(--bk-amber-soft);
  border: 1px solid rgba(245,158,11,0.45);
  padding: 7px 16px;
  border-radius: var(--bk-radius-pill);
  font-family: var(--bk-font-mono);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em;
}
.ir-delta-symbol {
  font-family: var(--bk-font-display);
  font-style: italic;
  font-weight: 700;
}
.ir-delta-qualifier {
  font-family: var(--bk-font-body);
  font-style: italic;
  font-weight: 500;
  color: rgba(245,238,221,0.75);
  font-size: 12px;
}

/* ── Body zone ───────────────────────────────────────────────────── */
.ir-body {
  background: var(--bk-card);
  border-radius: var(--bk-radius-lg);
  box-shadow: var(--bk-shadow-md);
  padding: 1.75rem 2rem;
  border: 1px solid var(--bk-border);
}
.ir-body-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bk-gold);
  margin-bottom: 1rem;
}
.ir-decision-block { display: block; }
.ir-decision-block[hidden] { display: none; }
.ir-actions-row {
  display: flex; gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.ir-actions-help {
  font-size: 13px; color: var(--bk-text-muted);
  margin-right: auto;
  font-style: italic;
  max-width: 380px;
}
.ir-btn {
  cursor: pointer;
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; gap: 0.5rem;
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
}
.ir-btn-approve {
  background: var(--bk-gold);
  color: var(--bk-navy);
  border: 1.5px solid var(--bk-gold);
  padding: 0.85rem 1.6rem;
  border-radius: var(--bk-radius);
  font: 700 15px var(--bk-font-body);
  letter-spacing: 0.01em;
  box-shadow: var(--bk-shadow-sm);
}
.ir-btn-approve:hover {
  background: var(--bk-gold-soft);
  border-color: var(--bk-gold-soft);
  box-shadow: var(--bk-shadow-md);
}
.ir-btn-approve:active { transform: translateY(1px); box-shadow: var(--bk-shadow-sm); }
.ir-btn-approve:focus-visible { outline: none; box-shadow: var(--bk-focus-ring); }
.ir-btn-approve:disabled {
  background: var(--bk-border); color: var(--bk-text-muted);
  border-color: var(--bk-border);
  cursor: not-allowed; box-shadow: none;
}
.ir-btn-revision {
  background: white;
  color: var(--bk-navy);
  border: 1.5px solid var(--bk-navy);
  padding: 0.85rem 1.4rem;
  border-radius: var(--bk-radius);
  font: 600 14px var(--bk-font-body);
}
.ir-btn-revision:hover {
  background: var(--bk-gold-glow);
  border-color: var(--bk-gold);
}
.ir-btn-revision:active { transform: translateY(1px); }
.ir-btn-revision:focus-visible { outline: none; box-shadow: var(--bk-focus-ring); }
.ir-btn-ghost {
  background: transparent;
  color: var(--bk-text-muted);
  border: 1.5px solid var(--bk-border);
  padding: 0.7rem 1.1rem;
  border-radius: var(--bk-radius);
  font: 600 13px var(--bk-font-body);
}
.ir-btn-ghost:hover {
  color: var(--bk-text);
  border-color: var(--bk-text-muted);
  background: var(--bk-parchment);
}
.ir-btn-ghost:active { transform: translateY(1px); }
.ir-btn-ghost:focus-visible { outline: none; box-shadow: var(--bk-focus-ring); }

.ir-revision-form {
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--bk-border);
  display: grid;
  gap: 0.85rem;
  animation: ir-history-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ir-revision-form[hidden] { display: none; }
.ir-form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.ir-form-field label {
  font-size: 12px; font-weight: 700;
  color: var(--bk-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ir-req { color: var(--bk-red); margin-left: 0.2rem; }
.ir-form-hint {
  font-size: 11px;
  color: var(--bk-text-muted);
  font-style: italic;
}
.ir-form-select,
.ir-form-textarea {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--bk-border);
  border-radius: var(--bk-radius);
  font-family: var(--bk-font-body);
  font-size: 14px;
  color: var(--bk-text);
  background: var(--bk-gold-glow);
  min-height: 44px;
}
.ir-form-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}
.ir-form-select:focus-visible,
.ir-form-textarea:focus-visible {
  outline: none; border-color: var(--bk-gold);
  box-shadow: var(--bk-focus-ring);
}
.ir-form-actions {
  display: flex; gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}
.ir-form-spacer { flex: 1; }

/* ── Round history strip ────────────────────────────────────────── */
.ir-history-strip {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bk-border);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.ir-history-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bk-text-muted);
  margin-right: 0.4rem;
}
.ir-round-btn {
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  border: 2px solid var(--bk-border);
  background: white;
  color: var(--bk-text);
  font: 700 13px var(--bk-font-body);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 1px;
  position: relative;
  transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.2s;
  padding: 0;
}
.ir-round-label { font-size: 13px; font-weight: 800; line-height: 1; }
.ir-round-mark { font-size: 11px; line-height: 1; margin-top: 1px; }
.ir-round-btn:hover {
  border-color: var(--bk-gold-soft);
  background: var(--bk-gold-glow);
}
.ir-round-btn:active { transform: translateY(1px); }
.ir-round-btn:focus-visible { outline: none; box-shadow: var(--bk-focus-ring); }
.ir-round-btn.ir-is-rejected {
  border-color: var(--bk-red);
  color: var(--bk-red);
  background: var(--bk-red-soft);
}
.ir-round-btn.ir-is-rejected:hover { background: #fbcfcf; }
.ir-round-btn.ir-is-current {
  border-color: var(--bk-gold);
  background: var(--bk-gold);
  color: var(--bk-navy);
  box-shadow: 0 0 0 4px rgba(194,153,84,0.22), var(--bk-shadow-md);
  animation: ir-current-pulse 2.4s ease-in-out infinite;
}
.ir-round-btn.ir-is-current:hover {
  background: var(--bk-gold-soft);
}
.ir-round-btn.ir-is-future {
  border-style: dashed;
  border-color: var(--bk-border);
  color: var(--bk-text-muted);
  background: var(--bk-parchment);
  cursor: not-allowed;
  opacity: 0.7;
}

@keyframes ir-current-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(194,153,84,0.22), var(--bk-shadow-md); }
  50%      { box-shadow: 0 0 0 7px rgba(194,153,84,0.10), var(--bk-shadow-md); }
}

/* ── Motion: keyframes + first-encounter bindings ──────────────── */
@keyframes ir-comparison-crossfade {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes ir-delta-write-on {
  0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes ir-history-slide-in {
  from { opacity: 0; transform: translateY(-8px); max-height: 0; }
  to   { opacity: 1; transform: translateY(0);    max-height: 600px; }
}
@keyframes ir-hero-rise {
  from { opacity: 0; transform: translateY(40px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes ir-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ir-slide-from-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-stage {
  animation: ir-hero-rise 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-compare-card.ir-submitted {
  animation: ir-comparison-crossfade 0.6s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-compare-card.ir-target {
  animation: ir-comparison-crossfade 0.6s 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-compare-arrow {
  animation: ir-fade-up 0.5s 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-delta-pill {
  animation: ir-delta-write-on 0.6s 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-body {
  animation: ir-fade-up 0.55s 1.0s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-history-strip {
  animation: ir-slide-from-left 0.5s 1.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 600px) {
  .ir-comparison {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .ir-compare-arrow { display: none; }
}

/* Reduced motion — collapse everything to opacity-only (sealed). */
@media (prefers-reduced-motion: reduce) {
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-stage,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-compare-card.ir-submitted,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-compare-card.ir-target,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-compare-arrow,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-delta-pill,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-body,
  .psc-cinematic-stage[data-motion-mode="first-encounter"] .ir-history-strip {
    animation: none !important;
    opacity: 1; transform: none;
    clip-path: none;
  }
  .ir-round-btn.ir-is-current { animation: none !important; }
  .ir-revision-form { animation: none !important; }
}

/* ──── Kit F — Allocation + Lock Seal (Phase 6.I.4) ──────────────────────
   Ports docs/psc-widgets/psc_kit_f_allocation_lock_seal_mockup.html verbatim
   onto live Django-rendered Kit F steps. Mockup-only class names are
   renamed to the `.kf-*` namespace that the section template emits.
   Tokens-only — uses --bk-* throughout; --bk-status-sent and
   --bk-status-sending shade aliases are declared in :root below.
   ────────────────────────────────────────────────────────────────────── */

:root {
  --bk-status-sent: var(--bk-emerald, #10B981);
  --bk-status-sending: var(--bk-amber, #F59E0B);
}

/* ── Working face — stage + toolbar ─────────────────────────────────── */
.kf-stage {
  position: relative;
  background: var(--bk-card, #fff);
  border-radius: var(--bk-radius-lg, 18px);
  border: 1px solid var(--bk-border, #e9e4d8);
  box-shadow: var(--bk-shadow-md, 0 4px 18px rgba(40,30,15,0.07));
  padding: 1.5rem 1.75rem 1.75rem;
  transition: opacity 0.4s ease, filter 0.4s ease;
}
.kf-stage.is-sealing {
  opacity: 0.25;
  filter: saturate(0.4) blur(1px);
  pointer-events: none;
}
.kf-stage.is-sealed-gone {
  animation: kf-body-dim 0.6s ease-in forwards;
}
.kf-stage-toolbar {
  display: flex; align-items: center; gap: 0.85rem;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px dashed var(--bk-border, #e9e4d8);
}
.kf-stage-toolbar-left {
  font-size: 12px; color: var(--bk-text-muted, #72727e);
}
.kf-stage-toolbar-left strong { color: var(--bk-text, #2d2d3a); }
.kf-toolbar-spacer { flex: 1; }
.kf-btn-save-draft {
  background: var(--bk-card, #fff);
  color: var(--bk-text, #2d2d3a);
  border: 1px solid var(--bk-border, #e9e4d8);
  padding: 0.55rem 1rem;
  border-radius: var(--bk-radius, 12px);
  font: 600 13px var(--bk-font-body, sans-serif);
  cursor: pointer;
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.kf-btn-save-draft:hover {
  background: var(--bk-gold-glow, #f5eedd);
  border-color: var(--bk-gold-soft, #d4b275);
}
.kf-btn-save-draft:active { transform: translateY(1px); }
.kf-btn-save-draft:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring, 0 0 0 3px rgba(194,153,84,0.35));
}

/* ── Allocation matrix ─────────────────────────────────────────────── */
.kf-matrix-wrap {
  overflow-x: auto;
  border-radius: var(--bk-radius, 12px);
  border: 1px solid var(--bk-border, #e9e4d8);
}
.kf-matrix-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  background: var(--bk-card, #fff);
}
.kf-matrix-table thead th {
  background: var(--bk-navy, #1a1a2e);
  color: #fff;
  text-align: center;
  padding: 0.75rem 0.6rem;
  font: 700 10.5px/1.2 var(--bk-font-body, sans-serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.08);
  vertical-align: middle; white-space: nowrap;
}
.kf-matrix-table thead th:first-child {
  text-align: left; padding-left: 1rem;
}
.kf-matrix-table thead th.kf-col-total {
  background: var(--bk-navy-deep, #0d0d18);
  color: var(--bk-gold-soft, #d4b275);
}
.kf-col-sublabel {
  font: 500 10px var(--bk-font-mono, monospace);
  opacity: 0.75;
}
.kf-matrix-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--bk-border, #e9e4d8);
  border-right: 1px solid var(--bk-border, #e9e4d8);
  text-align: center; vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.kf-matrix-table tbody tr:nth-child(even) td {
  background: var(--bk-stripe, #f8f9fb);
}
.kf-matrix-table tbody td.kf-row-label {
  text-align: left; padding-left: 1rem;
  font-weight: 600;
  color: var(--bk-text, #2d2d3a);
  background: var(--bk-parchment, #f8f5ef) !important;
  border-right: 1px solid var(--bk-border, #e9e4d8);
  min-width: 160px;
}
.kf-row-cap {
  display: block;
  font: 500 10px var(--bk-font-mono, monospace);
  color: var(--bk-text-muted, #72727e);
  margin-top: 2px;
}
.kf-matrix-table tbody td.kf-row-total {
  font-weight: 700;
  background: var(--bk-gold-glow, #f5eedd) !important;
  color: var(--bk-navy, #1a1a2e);
  font-size: 13.5px;
}
.kf-matrix-table tfoot td {
  padding: 0.75rem 0.6rem;
  background: var(--bk-navy, #1a1a2e);
  color: #fff;
  font: 700 12px var(--bk-font-mono, monospace);
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.kf-matrix-table tfoot td.kf-foot-label {
  text-align: left; padding-left: 1rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 11px;
}
.kf-matrix-table tfoot td.kf-grand-total {
  background: var(--bk-gold, #c29954);
  color: var(--bk-navy, #1a1a2e);
  font: 700 italic 14px var(--bk-font-display, serif);
}
.kf-cell {
  width: 100%;
  padding: 0.5rem 0.4rem;
  border: 1px solid transparent;
  border-radius: var(--bk-radius-sm, 6px);
  background: transparent;
  font: 600 13px var(--bk-font-mono, monospace);
  color: var(--bk-text, #2d2d3a);
  text-align: center;
  min-height: 44px;
  -moz-appearance: textfield;
}
.kf-cell::-webkit-outer-spin-button,
.kf-cell::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.kf-cell:hover {
  border-color: var(--bk-border, #e9e4d8);
  background: #fff;
}
.kf-cell:focus {
  outline: none;
  border-color: var(--bk-gold, #c29954);
  background: #fff;
  box-shadow: var(--bk-focus-ring, 0 0 0 3px rgba(194,153,84,0.35));
}
.kf-cell.is-warn {
  background: var(--bk-amber-soft, #fef3c7);
  border-color: var(--bk-amber, #F59E0B);
  color: var(--bk-text, #2d2d3a);
}
.kf-cell.is-warn:focus {
  box-shadow: 0 0 0 3px rgba(245,158,11,0.30);
}

/* ── Validation chips ──────────────────────────────────────────────── */
.kf-totals {
  margin-top: 1rem;
  display: flex; align-items: center; gap: 0.65rem;
  flex-wrap: wrap;
}
.kf-validation-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--bk-radius-pill, 9999px);
  font: 600 12px var(--bk-font-body, sans-serif);
  border: 1px solid;
  min-height: 36px;
}
.kf-validation-chip.is-ok {
  background: var(--bk-emerald-soft, #d1fae5);
  border-color: var(--bk-emerald, #10B981);
  color: #065f46;
}
.kf-validation-chip.is-warn {
  background: var(--bk-amber-soft, #fef3c7);
  border-color: var(--bk-amber, #F59E0B);
  color: #92400e;
}
.kf-validation-chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.kf-validation-chip.is-ok .kf-validation-chip-dot {
  background: var(--bk-emerald, #10B981);
}
.kf-validation-chip.is-warn .kf-validation-chip-dot {
  background: var(--bk-amber, #F59E0B);
}

/* ── LOCK CTA ──────────────────────────────────────────────────────── */
.kf-lock-zone {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bk-border, #e9e4d8);
}
.kf-lock-hint {
  display: block;
  font-size: 12px;
  color: var(--bk-text-muted, #72727e);
  margin-bottom: 0.6rem;
  font-style: italic;
}
.kf-lock-cta {
  width: 100%;
  background: linear-gradient(180deg, var(--bk-gold-soft, #d4b275) 0%, var(--bk-gold, #c29954) 50%, var(--bk-ribbon-gold-2, #b07b2f) 100%);
  color: var(--bk-navy, #1a1a2e);
  border: 1.5px solid var(--bk-gold, #c29954);
  padding: 1rem 2rem;
  border-radius: var(--bk-radius, 12px);
  font: 700 17px var(--bk-font-body, sans-serif);
  letter-spacing: 0.04em;
  cursor: pointer;
  min-height: 64px;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
  text-transform: uppercase;
  box-shadow: var(--bk-shadow-md, 0 4px 18px rgba(40,30,15,0.07)), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: filter 0.2s, transform 0.08s, box-shadow 0.15s;
}
.kf-lock-cta:not(:disabled):hover {
  filter: brightness(1.06);
  box-shadow: var(--bk-shadow-lg, 0 16px 48px rgba(40,30,15,0.12)), inset 0 1px 0 rgba(255,255,255,0.5);
}
.kf-lock-cta:not(:disabled):active { transform: translateY(1px); }
.kf-lock-cta:focus-visible {
  outline: none;
  box-shadow: var(--bk-focus-ring, 0 0 0 3px rgba(194,153,84,0.35)), inset 0 1px 0 rgba(255,255,255,0.4);
}
.kf-lock-cta:disabled {
  cursor: not-allowed;
  background: var(--bk-border, #e9e4d8);
  color: var(--bk-text-muted, #72727e);
  border-color: var(--bk-border, #e9e4d8);
  box-shadow: none; filter: none;
}
.kf-lock-cta-icon { font-size: 22px; }
.kf-lock-tooltip {
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--bk-amber, #F59E0B);
  font-weight: 600;
  background: var(--bk-amber-soft, #fef3c7);
  border: 1px solid var(--bk-amber, #F59E0B);
  padding: 0.5rem 0.85rem;
  border-radius: var(--bk-radius, 12px);
}
.kf-lock-tooltip[hidden] { display: none; }

/* ── Seal overlay (full-viewport stamp moment) ─────────────────────── */
.kf-seal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  pointer-events: none;
  background: rgba(13, 13, 24, 0);
  transition: background 0.4s ease;
}
.kf-seal-overlay.is-active {
  display: block;
  pointer-events: auto;
  background: rgba(13, 13, 24, 0.55);
}
.kf-seal-stage {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -200%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; padding-top: 18vh;
  pointer-events: none;
}
.kf-seal-overlay.is-active .kf-seal-stage {
  animation: kf-seal-descend 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.kf-seal-disc-wrap {
  width: 148px; height: 148px;
  position: relative;
}
.kf-seal-disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%,
    var(--bk-gold-soft, #d4b275) 0%,
    var(--bk-gold, #c29954) 38%,
    var(--bk-ribbon-gold-2, #b07b2f) 100%);
  box-shadow:
    inset -6px -10px 18px rgba(0,0,0,0.35),
    inset 4px 6px 12px rgba(255,255,255,0.20),
    0 18px 36px rgba(74,14,24,0.45);
}
.kf-seal-rim {
  position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,0.45);
  pointer-events: none;
}
.kf-seal-monogram {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font: italic 700 56px/1 var(--bk-font-display, serif);
  color: var(--bk-navy, #1a1a2e);
  text-shadow: 0 1px 0 rgba(255,255,255,0.25), 0 2px 6px rgba(0,0,0,0.25);
  letter-spacing: -0.02em;
}
.kf-seal-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 148px; height: 148px;
  border-radius: 50%;
  border: 3px solid var(--bk-gold, #c29954);
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  pointer-events: none;
}
.kf-seal-overlay.is-active .kf-seal-ring {
  animation: kf-seal-impact-ring 0.9s ease-out 0.7s forwards;
}
.kf-seal-caption {
  margin-top: 1.5rem;
  font-family: var(--bk-font-display, serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--bk-gold-soft, #d4b275);
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
}
.kf-seal-overlay.is-active .kf-seal-caption {
  animation: kf-seal-caption 0.8s ease-out 0.95s forwards;
}

@keyframes kf-seal-descend {
  0%   { transform: translate(-50%, -200%); }
  70%  { transform: translate(-50%, 4%); }
  85%  { transform: translate(-50%, -1%); }
  100% { transform: translate(-50%, 0%); }
}
@keyframes kf-seal-impact-ring {
  0%   { transform: translate(-50%, -50%) scale(0.85); opacity: 1; border-width: 4px; }
  100% { transform: translate(-50%, -50%) scale(2.4);  opacity: 0; border-width: 1px; }
}
@keyframes kf-seal-caption {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes kf-body-dim {
  to { transform: translateY(-30px); opacity: 0; }
}
@keyframes kf-packet-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Post-lock seal handoff (cinematic packet preview) ─────────────── */
.kf-sealed-hero {
  background: linear-gradient(180deg,
    var(--bk-aubergine, #2a2030) 0%,
    var(--bk-navy, #1a1a2e) 60%,
    var(--bk-navy-deep, #0d0d18) 100%);
  color: #fff;
  border-radius: var(--bk-radius-lg, 18px);
  padding: 2.25rem 2rem 1.75rem;
  box-shadow: var(--bk-shadow-lg, 0 16px 48px rgba(40,30,15,0.12));
  border: 1px solid rgba(194, 153, 84, 0.30);
  position: relative;
  overflow: hidden;
  opacity: 1;
  animation: kf-packet-fade-in 1.2s ease forwards;
}
.kf-sealed-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(194,153,84,0.25), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 6px);
  pointer-events: none;
}
.kf-sealed-eyebrow {
  position: relative;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--bk-gold-soft, #d4b275);
  text-align: center;
}
.kf-sealed-title {
  position: relative;
  font-family: var(--bk-font-display, serif);
  font-weight: 600; font-style: italic;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.1;
  color: #fff;
  text-align: center;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}
.kf-sealed-sub {
  position: relative;
  font-size: 13px; color: rgba(255,255,255,0.65);
  text-align: center;
  font-family: var(--bk-font-mono, monospace);
  letter-spacing: 0.05em;
}
.kf-packet-preview-list {
  position: relative;
  margin-top: 1.5rem;
  background: rgba(13, 13, 24, 0.4);
  border: 1px solid rgba(194, 153, 84, 0.18);
  border-radius: var(--bk-radius, 12px);
  overflow: hidden;
}
.kf-packet-preview-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center; gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13.5px;
  min-height: 44px;
}
.kf-packet-preview-row:last-child { border-bottom: none; }
.kf-packet-preview-num {
  font: 700 11px var(--bk-font-mono, monospace);
  color: rgba(255,255,255,0.40);
  text-align: right;
}
.kf-packet-preview-name {
  color: #fff;
  font-weight: 600;
}
.kf-packet-preview-channel {
  font: 500 11px var(--bk-font-mono, monospace);
  color: rgba(255,255,255,0.45);
  margin-left: 0.5rem;
}
.kf-packet-preview-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--bk-radius-pill, 9999px);
  font: 700 11px var(--bk-font-body, sans-serif);
  letter-spacing: 0.05em;
}
.kf-packet-preview-status.is-sent {
  background: rgba(16, 185, 129, 0.18);
  color: var(--bk-status-sent);
  border: 1px solid rgba(16, 185, 129, 0.40);
}
.kf-packet-preview-status.is-sending {
  background: rgba(245, 158, 11, 0.18);
  color: var(--bk-status-sending);
  border: 1px solid rgba(245, 158, 11, 0.40);
}
.kf-packet-preview-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.kf-packet-preview-status.is-sent .kf-packet-preview-status-dot {
  background: var(--bk-status-sent);
  box-shadow: 0 0 6px var(--bk-status-sent);
}
.kf-packet-preview-status.is-sending .kf-packet-preview-status-dot {
  background: var(--bk-status-sending);
  box-shadow: 0 0 6px var(--bk-status-sending);
  animation: kf-pulse-amber 1.2s ease-in-out infinite;
}
@keyframes kf-pulse-amber {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ── Reduced motion — collapse animations to opacity-only ──────────── */
@media (prefers-reduced-motion: reduce) {
  .kf-stage,
  .kf-stage.is-sealing,
  .kf-stage.is-sealed-gone,
  .kf-seal-overlay.is-active .kf-seal-stage,
  .kf-seal-overlay.is-active .kf-seal-ring,
  .kf-seal-overlay.is-active .kf-seal-caption,
  .kf-sealed-hero,
  .kf-packet-preview-status.is-sending .kf-packet-preview-status-dot {
    animation: none !important;
    transition: opacity 0.3s ease !important;
  }
  .kf-seal-stage {
    transform: translate(-50%, 0) !important;
    padding-top: 22vh;
  }
  .kf-seal-caption {
    opacity: 1 !important; transform: none !important;
  }
  .kf-seal-ring { display: none !important; }
  .kf-stage.is-sealed-gone {
    opacity: 0 !important; transform: none !important;
  }
  .kf-sealed-hero {
    opacity: 1 !important; transform: none !important;
  }
}
