:root {
  color-scheme: dark;
  --bg: #0a0b0a;
  --bg-panel: #101210;
  --bg-raised: #171a17;
  --bg-soft: #1d211d;
  --line: rgba(230, 235, 225, 0.12);
  --line-strong: rgba(230, 235, 225, 0.22);
  --text: #edf2ea;
  --muted: #a3aea2;
  --dim: #687367;
  --green: #37d67a;
  --blue: #5bb8ff;
  --amber: #f0b84a;
  --red: #ff6b6b;
  --violet: #b692ff;
  --accent: #37d67a;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", Consolas, ui-monospace, monospace;
  --motion-fast: 120ms;
  --motion-base: 220ms;
  --motion-slow: 420ms;
  --motion-proof: 700ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-verify: cubic-bezier(0.22, 1, 0.36, 1);
  --topbar-height: 70px;
  --rail-width: clamp(184px, 18vw, 232px);
  --receipt-width: clamp(280px, 24vw, 318px);
  --shell-height: calc(100svh - var(--topbar-height));
  --zone-pad: clamp(16px, 2vw, 26px);
  --header-canvas-height: clamp(142px, 20svh, 196px);
  --packet-field-height: clamp(108px, 12svh, 136px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

* {
  scrollbar-color: rgba(55, 214, 122, 0.36) rgba(5, 7, 6, 0.92);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: rgba(5, 7, 6, 0.92);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(5, 7, 6, 0.92);
  border-radius: 999px;
  background: rgba(55, 214, 122, 0.34);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(55, 214, 122, 0.52);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* Entry gate */
body:has(.entry-layer:not([hidden])) {
  overflow: hidden;
}

.entry-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  overflow: hidden;
  isolation: isolate;
  width: 100vw;
  height: 100svh;
  min-height: 650px;
  padding: clamp(32px, 5vw, 74px);
  background:
    linear-gradient(180deg, rgba(9, 13, 12, 0.1) 0%, rgba(3, 5, 4, 0.92) 88%),
    linear-gradient(112deg, rgba(91, 184, 255, 0.1) 0%, transparent 31%, transparent 70%, rgba(55, 214, 122, 0.08) 100%),
    linear-gradient(140deg, #040606 0%, #0a120f 52%, #050706 100%);
}

.entry-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(237, 242, 234, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 242, 234, 0.025) 1px, transparent 1px);
  background-position: 0 0;
  background-size: 78px 78px;
  opacity: 0.34;
}

.entry-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 32%, rgba(91, 184, 255, 0.12), transparent 34%),
    radial-gradient(circle at 78% 34%, rgba(55, 214, 122, 0.12), transparent 36%),
    linear-gradient(180deg, transparent 54%, rgba(0, 0, 0, 0.58) 100%);
  opacity: 0.72;
  pointer-events: none;
}

.entry-layer.leaving {
  animation: entry-leave var(--motion-slow) var(--ease-out) forwards;
}

.entry-layer.story-launching .entry-content {
  animation: entry-demo-launch var(--motion-slow) var(--ease-verify) both;
}

.entry-layer.story-launching .entry-receipt-stack {
  animation: entry-receipt-launch var(--motion-slow) var(--ease-verify) both;
}

.entry-layer.story-launching::after {
  opacity: 0.42;
  transition: opacity var(--motion-slow) var(--ease-out);
}

.entry-receipt-stack {
  position: absolute;
  right: clamp(62px, 8vw, 150px);
  top: 50%;
  z-index: 1;
  width: clamp(380px, 28vw, 520px);
  min-height: clamp(460px, 36vw, 560px);
  transform: translateY(-50%);
  pointer-events: none;
}

.entry-receipt-card {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(230, 235, 225, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(91, 184, 255, 0.11), transparent 30%),
    linear-gradient(180deg, rgba(237, 242, 234, 0.095), transparent 34%),
    rgba(8, 14, 12, 0.84);
  box-shadow:
    0 36px 120px rgba(0, 0, 0, 0.58),
    0 0 120px rgba(55, 214, 122, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.9;
  backdrop-filter: blur(22px);
  padding: 28px;
}

.receipt-card-pass {
  animation: receipt-idle-glow 7s var(--ease-out) infinite;
}

.entry-receipt-card::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(55, 214, 122, 0.22);
  border-radius: 6px;
}

.entry-receipt-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.12), transparent 34%);
  opacity: 0.54;
}

.receipt-card-review {
  z-index: -1;
  border-color: rgba(240, 184, 74, 0.22);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.44), 0 0 80px rgba(240, 184, 74, 0.08);
  opacity: 0.42;
  transform: translate(22px, 24px) rotate(2deg) scale(0.96);
}

.receipt-card-fail {
  z-index: -2;
  border-color: rgba(255, 107, 107, 0.2);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36), 0 0 74px rgba(255, 107, 107, 0.07);
  opacity: 0.34;
  transform: translate(44px, 48px) rotate(4deg) scale(0.92);
}

.receipt-card-govern {
  z-index: -3;
  border-color: rgba(182, 146, 255, 0.18);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32), 0 0 66px rgba(182, 146, 255, 0.06);
  opacity: 0.2;
  transform: translate(66px, 72px) rotate(6deg) scale(0.88);
}

.receipt-card-review > *,
.receipt-card-fail > *,
.receipt-card-govern > * {
  opacity: 0;
}

.receipt-card-review strong {
  color: var(--amber);
  text-shadow: 0 0 30px rgba(240, 184, 74, 0.18);
}

.receipt-card-fail strong {
  color: var(--red);
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.16);
}

.receipt-card-govern strong {
  color: var(--violet);
  text-shadow: 0 0 30px rgba(182, 146, 255, 0.16);
}

.receipt-kicker,
.entry-receipt-card small {
  display: block;
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.entry-receipt-card strong {
  position: relative;
  z-index: 2;
  display: block;
  margin: 48px 0 24px;
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(54px, 4.8vw, 78px);
  line-height: 0.9;
  text-shadow: 0 0 36px rgba(55, 214, 122, 0.22);
}

.entry-receipt-card div {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0 0 10px;
  border: 1px solid rgba(230, 235, 225, 0.09);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.014)),
    rgba(2, 6, 5, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 10px 24px rgba(0, 0, 0, 0.14);
  min-height: 50px;
  padding: 12px 14px;
}

.entry-receipt-card span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.entry-receipt-card b {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.entry-receipt-card small {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(55, 214, 122, 0.22);
  border-radius: 999px;
  background: rgba(55, 214, 122, 0.07);
  box-shadow: 0 0 28px rgba(55, 214, 122, 0.11);
  padding: 7px 10px;
  color: var(--green);
  animation: seal-idle 5.5s var(--ease-out) infinite;
}

.entry-content {
  position: absolute;
  left: clamp(56px, 8vw, 154px);
  top: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(760px, calc(100vw - 610px));
  text-align: left;
  transform: translateY(-50%);
}

.entry-mark,
.entry-content h1,
.entry-content p,
.entry-identities,
.entry-pipeline,
.entry-status-strip,
.entry-actions {
  opacity: 1;
}

.entry-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(91, 184, 255, 0.22);
  border-radius: 999px;
  background: rgba(91, 184, 255, 0.065);
  box-shadow: 0 0 34px rgba(91, 184, 255, 0.05);
  color: rgba(211, 231, 255, 0.82);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
  padding: 8px 12px;
  animation-delay: 0ms;
}

.entry-content h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(70px, 7.1vw, 118px);
  font-weight: 820;
  line-height: 1.3;
  letter-spacing: 0;
  text-wrap: balance;
  animation-delay: 80ms;
  text-shadow: 0 22px 70px rgba(0, 0, 0, 0.56);
}

.entry-content p {
  margin: 4px 0 0;
  max-width: 680px;
  color: rgba(223, 231, 220, 0.76);
  font-size: clamp(19px, 1.45vw, 24px);
  line-height: 1.42;
  animation-delay: 160ms;
}

.entry-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 34px;
  animation-delay: 240ms;
}

.entry-actions .primary-button,
.entry-actions .secondary-button {
  min-height: 50px;
  padding: 12px 22px;
  font-size: 13px;
}

.entry-actions .primary-button {
  background: var(--blue);
  color: #041018;
  box-shadow: 0 18px 44px rgba(91, 184, 255, 0.24);
}

.entry-actions .secondary-button {
  background: rgba(255, 255, 255, 0.055);
  color: rgba(237, 242, 234, 0.82);
}

.entry-identities {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  margin: 30px 0 0;
  width: auto;
  animation-delay: 320ms;
}

.entry-identities button,
.entry-status-strip span,
.entry-pipeline button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 12, 10, 0.72);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.entry-identities button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(230, 235, 225, 0.12);
  background: rgba(7, 11, 10, 0.62);
  padding: 8px 10px;
  color: rgba(237, 242, 234, 0.78);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.entry-identities button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(55, 214, 122, 0.48);
}

.entry-identities button:hover,
.entry-identities button.active,
.entry-pipeline button:hover,
.entry-pipeline button:focus-visible {
  border-color: rgba(91, 184, 255, 0.34);
  background: rgba(91, 184, 255, 0.12);
  color: var(--text);
}

.entry-identities button.active::before {
  background: var(--blue);
  box-shadow: 0 0 18px rgba(91, 184, 255, 0.52);
  animation: active-agent-pulse 3.4s ease-in-out infinite;
}

.entry-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  width: min(740px, 100%);
  margin-top: 24px;
  border: 1px solid rgba(230, 235, 225, 0.1);
  border-radius: var(--radius);
  background: rgba(5, 8, 7, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 9px;
  backdrop-filter: blur(16px);
  animation-delay: 400ms;
}

.entry-pipeline i {
  display: none;
}

.entry-pipeline button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(55, 214, 122, 0.12);
  background: rgba(55, 214, 122, 0.045);
  padding: 7px 8px;
  color: rgba(203, 218, 201, 0.76);
  text-align: center;
  backdrop-filter: none;
  cursor: pointer;
  animation: pipeline-idle 14s ease-in-out infinite;
}

.entry-pipeline button:nth-child(3) {
  animation-delay: 2.4s;
}

.entry-pipeline button:nth-child(5) {
  animation-delay: 4.8s;
}

.entry-pipeline button:nth-child(7) {
  animation-delay: 7.2s;
}

.entry-pipeline button:nth-child(9) {
  animation-delay: 9.6s;
}

.entry-status-strip {
  position: static;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 14px;
  max-width: min(720px, 100%);
  width: auto;
  margin: 20px 0 0;
  animation-delay: 480ms;
}

.entry-status-strip span {
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(163, 174, 162, 0.78);
  font-family: var(--mono);
  font-size: 11px;
  backdrop-filter: none;
}

/* Guided story mode */
body.story-open {
  overflow: hidden;
}

.story-mode {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(12px, 2vw, 28px);
  background:
    linear-gradient(rgba(237, 242, 234, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 242, 234, 0.018) 1px, transparent 1px),
    linear-gradient(135deg, rgba(4, 7, 8, 0.98), rgba(9, 13, 14, 0.99) 48%, rgba(8, 8, 7, 0.99));
  background-size: 56px 56px, 56px 56px, auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease-verify);
}

.story-mode.active {
  opacity: 1;
  pointer-events: auto;
}

.story-mode.closing {
  opacity: 0;
}

.story-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.5vw, 18px);
  width: min(1200px, 100%);
  height: min(820px, calc(100svh - clamp(24px, 4vw, 56px)));
  min-height: 620px;
  border: 1px solid rgba(230, 235, 225, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(237, 242, 234, 0.052), transparent 32%),
    rgba(9, 12, 12, 0.96);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.46);
  padding: clamp(14px, 2vw, 24px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 480ms var(--ease-verify),
    transform 480ms var(--ease-verify);
}

.story-mode.active .story-shell {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.story-mode.closing .story-shell {
  opacity: 0;
  transform: translateY(10px) scale(0.99);
}

.story-topbar,
.story-controls,
.story-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-topbar {
  justify-content: space-between;
}

.story-kicker {
  display: block;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.story-topbar h2 {
  margin-top: 4px;
  font-size: clamp(20px, 2vw, 28px);
}

.story-icon-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}

.story-progress {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.story-progress button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--dim);
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
}

.story-progress button.active {
  border-color: rgba(91, 184, 255, 0.5);
  background: rgba(91, 184, 255, 0.1);
  color: var(--text);
}

.story-progress span,
.story-progress small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-progress span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.story-progress small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 800;
}

.story-frame {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(14px, 2vw, 24px);
  min-height: 0;
  overflow: hidden;
}

.story-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: clamp(16px, 2vw, 24px);
}

.story-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
}

.story-copy p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.25vw, 18px);
}

.story-points {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.story-points span {
  position: relative;
  border-left: 3px solid var(--blue);
  background: rgba(91, 184, 255, 0.07);
  color: var(--text);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 750;
}

.story-mode [data-reveal] {
  opacity: 0;
  transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 12px), 0) scale(var(--reveal-scale, 0.985));
  will-change: opacity, transform, filter;
}

.story-mode[data-direction="back"] [data-reveal] {
  --reveal-x: -10px;
}

.story-mode[data-direction="forward"] [data-reveal] {
  --reveal-x: 10px;
}

.story-mode [data-reveal="meta"],
.story-mode [data-reveal="copy"],
.story-mode [data-reveal="point"] {
  --reveal-x: 0;
}

.story-mode [data-reveal="headline"] {
  --reveal-x: 0;
  --reveal-y: 18px;
  --reveal-scale: 0.99;
}

.story-mode [data-reveal="panel"],
.story-mode [data-reveal="actor"],
.story-mode [data-reveal="card"],
.story-mode [data-reveal="receipt-shell"],
.story-mode [data-reveal="verify-panel"],
.story-mode [data-reveal="console"] {
  --reveal-y: 16px;
}

.story-mode [data-reveal="row"],
.story-mode [data-reveal="item"],
.story-mode [data-reveal="receipt-row"],
.story-mode [data-reveal="check"],
.story-mode [data-reveal="console-step"] {
  --reveal-y: 8px;
  --reveal-scale: 1;
}

.story-mode [data-reveal="actor-left"],
.story-mode [data-reveal="sender"],
.story-mode [data-reveal="tamper-left"] {
  --reveal-x: -42px;
  --reveal-y: 0;
  --reveal-scale: 0.98;
}

.story-mode [data-reveal="actor-right"],
.story-mode [data-reveal="receiver"],
.story-mode [data-reveal="tamper-right"] {
  --reveal-x: 42px;
  --reveal-y: 0;
  --reveal-scale: 0.98;
}

.story-mode [data-reveal="package"],
.story-mode [data-reveal="fact-stack"] {
  --reveal-x: 0;
  --reveal-y: -12px;
  --reveal-scale: 0.96;
}

.story-mode [data-reveal="package-item"],
.story-mode [data-reveal="fact"] {
  --reveal-x: 0;
  --reveal-y: 0;
  --reveal-scale: 0.94;
}

.story-mode [data-reveal="lock-card"] {
  --reveal-x: 0;
  --reveal-y: 18px;
  --reveal-scale: 0.92;
}

.story-mode [data-reveal="compute-core"] {
  --reveal-x: 0;
  --reveal-y: 0;
  --reveal-scale: 0.9;
}

.story-mode [data-reveal="seal-icon"],
.story-mode [data-reveal="receipt-label"],
.story-mode [data-reveal="console-label"],
.story-mode [data-reveal="console-title"] {
  --reveal-x: 0;
}

.story-mode [data-reveal="stamp"] {
  --reveal-x: 0;
  --reveal-y: 0;
  --reveal-scale: 1.18;
}

.story-mode [data-reveal="fracture"] {
  --reveal-x: 0;
  --reveal-y: 0;
  --reveal-scale: 0.82;
}

.story-mode.is-sequencing [data-reveal] {
  animation: story-reveal-up var(--reveal-duration, 620ms) var(--ease-verify) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.story-mode.is-sequencing [data-reveal="bridge"] {
  animation-name: story-reveal-line;
  transform-origin: center;
}

.story-mode.is-sequencing [data-reveal="package"],
.story-mode.is-sequencing [data-reveal="package-item"],
.story-mode.is-sequencing [data-reveal="fact"],
.story-mode.is-sequencing [data-reveal="console-step"] {
  animation-name: story-reveal-pop;
}

.story-mode.is-sequencing [data-reveal="lock-card"] {
  animation-name: story-reveal-lock;
}

.story-mode.is-sequencing [data-reveal="compute-core"] {
  --reveal-duration: 760ms;
  animation-name: story-reveal-core;
}

.story-mode.is-sequencing [data-reveal="receipt-shell"] {
  --reveal-duration: 760ms;
  animation-name: story-reveal-seal-card;
}

.story-mode.is-sequencing [data-reveal="stamp"] {
  --reveal-duration: 520ms;
  animation-name: story-reveal-stamp;
}

.story-mode.is-sequencing [data-reveal="receipt-row"] {
  animation-name: story-reveal-row;
}

.story-mode.is-sequencing [data-reveal="check"] {
  animation-name: story-reveal-check;
}

.story-mode.is-sequencing [data-reveal="fracture"] {
  --reveal-duration: 540ms;
  animation-name: story-reveal-fracture;
}

.story-mode.is-sequencing [data-reveal="console"] {
  animation-name: story-reveal-console;
}

.story-mode.is-sequencing .story-progress button.active {
  animation: story-progress-active 900ms var(--ease-verify) both;
}

.story-visual {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(230, 235, 225, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(237, 242, 234, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 242, 234, 0.018) 1px, transparent 1px),
    #090c0d;
  background-size: 42px 42px;
  overflow: hidden;
}

.story-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 2.4vw, 34px);
}

.story-actor,
.story-compute-card,
.story-compute-core,
.story-receipt-card,
.story-verify-panel,
.story-tamper-card,
.story-fracture,
.story-live-console,
.story-work-package,
.story-term-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 18, 16, 0.86);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.story-actor,
.story-compute-card,
.story-compute-core,
.story-receipt-card,
.story-verify-panel,
.story-tamper-card,
.story-fracture,
.story-live-console {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  padding: 18px;
}

.story-stage img {
  width: clamp(70px, 9vw, 116px);
  height: auto;
  margin-bottom: 12px;
}

.story-actor strong,
.story-compute-card strong,
.story-compute-core strong,
.story-receipt-card strong,
.story-verify-panel strong,
.story-tamper-card strong,
.story-fracture strong,
.story-live-console strong {
  color: var(--text);
  font-size: clamp(18px, 1.9vw, 27px);
}

.story-actor span,
.story-compute-card small,
.story-compute-core span,
.story-receipt-card span,
.story-tamper-card span,
.story-fracture small,
.story-live-console span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.story-stage-problem,
.story-stage-submission {
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.1fr) minmax(150px, 0.9fr);
  align-items: center;
  gap: 18px;
}

.story-payment-line {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  color: var(--amber);
  font-family: var(--mono);
  font-weight: 900;
  text-transform: uppercase;
}

.story-payment-line i {
  width: min(100%, 240px);
  height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--blue), var(--green));
  animation: story-scan 1800ms var(--ease-verify) infinite;
}

.story-payment-line small {
  color: var(--muted);
}

.story-work-package {
  display: grid;
  gap: 9px;
  padding: 18px;
  animation: story-slide-package 1400ms var(--ease-verify) both;
}

.story-work-package span {
  border: 1px solid rgba(91, 184, 255, 0.28);
  border-radius: 6px;
  background: rgba(91, 184, 255, 0.08);
  color: var(--text);
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
}

.story-stage-terms {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 14px;
}

.story-term-card {
  min-height: 136px;
  padding: 18px;
  animation: story-lock var(--motion-proof) var(--ease-verify) both;
  animation-delay: var(--term-delay);
}

.story-term-card span {
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.story-term-card strong,
.story-term-card small {
  display: block;
}

.story-term-card strong {
  margin-top: 18px;
  color: var(--text);
  font-size: clamp(19px, 2vw, 28px);
}

.story-term-card small {
  margin-top: 8px;
  color: var(--muted);
}

.story-stage-compute,
.story-stage-receipt,
.story-stage-verify,
.story-stage-live {
  place-items: center;
}

.story-stage-receipt,
.story-stage-verify {
  padding: clamp(12px, 1.4vw, 20px);
}

.story-compute-core {
  position: relative;
  width: min(520px, 100%);
  min-height: 300px;
  border-color: rgba(91, 184, 255, 0.35);
  background:
    linear-gradient(180deg, rgba(91, 184, 255, 0.12), transparent),
    rgba(12, 17, 20, 0.94);
}

.story-compute-core::before,
.story-compute-core::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(91, 184, 255, 0.18);
  border-radius: 7px;
  animation: story-compute-pulse 2200ms var(--ease-verify) infinite;
}

.story-compute-core::after {
  inset: 42px;
  border-color: rgba(55, 214, 122, 0.16);
  animation-delay: 360ms;
}

.story-app-facts {
  position: absolute;
  right: clamp(22px, 4vw, 48px);
  bottom: clamp(22px, 4vw, 48px);
  display: grid;
  gap: 8px;
}

.story-app-facts span {
  border: 1px solid rgba(55, 214, 122, 0.24);
  border-radius: 6px;
  background: rgba(55, 214, 122, 0.07);
  color: var(--green);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
}

.story-receipt-card {
  width: min(420px, 100%);
  max-height: 100%;
  border-color: rgba(55, 214, 122, 0.34);
  background:
    linear-gradient(180deg, rgba(55, 214, 122, 0.11), transparent),
    #101410;
  animation: story-seal var(--motion-proof) var(--ease-verify) both;
}

.story-receipt-card img {
  width: clamp(62px, 7vw, 88px);
  margin-bottom: 8px;
}

.story-verify-panel img {
  width: clamp(52px, 6vw, 72px);
  margin-bottom: 4px;
}

.story-receipt-card strong {
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
}

.story-receipt-card dl {
  width: 100%;
  margin: 12px 0 0;
}

.story-receipt-card div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  text-align: left;
}

.story-receipt-card dt {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.story-receipt-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
}

.story-verify-panel {
  width: min(520px, 100%);
  max-height: 100%;
  align-content: start;
  justify-items: stretch;
  gap: 5px;
  border-color: rgba(55, 214, 122, 0.32);
  text-align: left;
}

.story-verify-panel img {
  justify-self: center;
}

.story-verify-panel strong {
  justify-self: center;
  margin-bottom: 4px;
  font-size: clamp(19px, 1.9vw, 24px);
}

.story-check {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(55, 214, 122, 0.06);
  min-height: 34px;
  padding: 5px 9px;
  animation: story-check-in var(--motion-base) var(--ease-out) both;
}

.story-check span {
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
}

.story-check small {
  color: var(--text);
  font-weight: 800;
}

.story-stage-tamper {
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 0.8fr) minmax(130px, 1fr);
  align-items: center;
  gap: 16px;
}

.story-tamper-card {
  min-height: 260px;
}

.story-tamper-card.original strong {
  color: var(--green);
}

.story-tamper-card.edited {
  border-color: rgba(255, 107, 107, 0.38);
  animation: story-glitch 1500ms steps(2, end) infinite;
}

.story-tamper-card.edited strong,
.story-fracture strong {
  color: var(--red);
}

.story-fracture {
  min-height: 220px;
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.08);
}

.story-live-console {
  width: min(560px, 100%);
  align-items: stretch;
  justify-items: stretch;
  border-color: rgba(240, 184, 74, 0.36);
  text-align: left;
}

.story-live-console strong {
  color: var(--text);
}

.story-live-console ol {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 18px);
}

.story-live-console li + li {
  margin-top: 10px;
}

.story-controls {
  justify-content: space-between;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.story-controls .danger-button {
  color: #ffd1d1;
}

.live-handoff-banner {
  position: sticky;
  top: var(--topbar-height);
  z-index: 35;
  display: grid;
  grid-template-columns: 170px minmax(0, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(91, 184, 255, 0.26);
  background:
    linear-gradient(90deg, rgba(91, 184, 255, 0.14), rgba(55, 214, 122, 0.08), rgba(240, 184, 74, 0.08)),
    #0b1112;
  padding: 11px 24px;
}

.live-handoff-banner span,
.live-handoff-banner small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.live-handoff-banner strong {
  color: var(--text);
}

.live-handoff-banner.done {
  border-color: rgba(55, 214, 122, 0.36);
  background: rgba(55, 214, 122, 0.11);
}

.live-handoff-banner.error {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.11);
}

/* Shell */
.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-height);
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 10, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(55, 214, 122, 0.46);
  border-radius: var(--radius);
  color: var(--green);
  font-family: var(--mono);
  font-weight: 800;
  background: rgba(55, 214, 122, 0.08);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.receipt-actions,
.verify-actions,
.presenter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill,
.icon-link,
.quiet-button,
.primary-button,
.secondary-button,
.danger-button,
.tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.status-pill {
  cursor: default;
  color: var(--green);
  border-color: rgba(55, 214, 122, 0.28);
  background: rgba(55, 214, 122, 0.08);
}

.primary-button {
  border-color: transparent;
  background: var(--accent);
  color: #071008;
}

.secondary-button:hover,
.danger-button:hover,
.quiet-button:hover,
.icon-link:hover,
.tab:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.quiet-button.strong {
  color: var(--green);
  border-color: rgba(55, 214, 122, 0.28);
}

.danger-button {
  color: #ff9a9a;
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none !important;
}

.block {
  display: flex;
  align-items: center;
  justify-content: center;
}

.console-grid {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--receipt-width);
  min-height: var(--shell-height);
}

.app-shell[data-motion="settling"] .workbench {
  pointer-events: none;
}

.workbench.motion-enter {
  animation: surface-enter 180ms var(--ease-verify) both;
}

.case-rail,
.receipt-rail {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  min-height: var(--shell-height);
  overflow: visible;
  border-right: 1px solid var(--line);
  background: #0d100d;
}

.receipt-rail {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.case-rail {
  padding: 14px;
}

.rail-heading,
.queue-heading,
.section-title,
.receipt-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.case-rail .rail-heading {
  display: none;
}

.case-rail .rail-heading small {
  display: none;
}

.rail-heading span,
.queue-heading span,
.section-title span,
.receipt-header span,
.presenter-panel span {
  color: var(--text);
  font-weight: 800;
}

.rail-heading small,
.queue-heading small,
.section-title small,
.presenter-panel small {
  color: var(--dim);
  font-size: 11px;
}

.case-rail .rail-note,
.case-rail .demo-queue {
  display: none;
}

.case-card,
.queue-card,
.registry-card {
  width: 100%;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  text-align: left;
}

.case-card {
  display: block;
  padding: 12px;
  cursor: pointer;
}

.case-card.active,
.queue-card.active,
.registry-card.active {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.case-card strong,
.case-card small,
.queue-card strong,
.queue-card p,
.queue-card small {
  display: block;
}

.case-card strong {
  margin: 4px 0 3px;
  color: var(--text);
}

.case-card small,
.queue-card small {
  color: var(--dim);
}

.case-kicker {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.rail-note,
.trust-disclaimer {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(240, 184, 74, 0.24);
  border-radius: var(--radius);
  background: rgba(240, 184, 74, 0.07);
  color: #e4c784;
  font-size: 12px;
}

.demo-queue {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.queue-card {
  padding: 12px;
}

.queue-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
}

.queue-card div {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.workbench {
  min-width: 0;
  padding: var(--zone-pad);
}

.surface-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab.active {
  color: #071008;
  border-color: transparent;
  background: var(--text);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: panel-rise var(--motion-base) var(--ease-out);
}

.panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 14px;
}

.panel-header.compact {
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.12;
}

h1 {
  max-width: 760px;
  font-size: clamp(30px, 3vw, 44px);
}

h2 {
  font-size: 24px;
}

.panel-header p:not(.eyebrow) {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--muted);
}

.settlement-gate,
.receipt-settlement {
  border: 1px solid rgba(230, 235, 225, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(237, 242, 234, 0.045), transparent 45%),
    #101210;
  padding: 16px;
}

.settlement-gate span,
.receipt-settlement span,
.receipt-facts dt,
.identity-strip span,
.diff-grid span {
  display: block;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.settlement-gate strong,
.receipt-settlement strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--text);
  font-size: 20px;
}

.settlement-gate small,
.receipt-settlement small {
  color: var(--muted);
}

.settlement-gate.pass,
.receipt-settlement.pass {
  border-color: rgba(55, 214, 122, 0.38);
  background: rgba(55, 214, 122, 0.08);
}

.settlement-gate.revise,
.receipt-settlement.revise {
  border-color: rgba(240, 184, 74, 0.42);
  background: rgba(240, 184, 74, 0.08);
}

.settlement-gate.fail,
.receipt-settlement.fail {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.08);
}

.gate-checks {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.gate-checks span {
  position: relative;
  padding-left: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: none;
}

.gate-checks span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.gate-checks.pending span::before {
  background: var(--dim);
}

.identity-strip {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.identity-strip div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.identity-strip strong,
.identity-strip a {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--text);
}

.identity-strip a {
  color: var(--accent);
}

.proof-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 18px;
  overflow-x: auto;
}

.proof-step {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 28px;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.proof-step span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dim);
}

.proof-step.active {
  color: var(--text);
}

.proof-step.active span {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.proof-step.done {
  color: var(--accent);
}

.proof-step.done span {
  background: var(--accent);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.app-shell[data-receipt="pending"] .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell[data-receipt="pending"] .evidence-panel,
.app-shell[data-receipt="pending"] .receipt-facts,
.app-shell[data-receipt="pending"] .receipt-actions {
  display: none;
}

.app-shell[data-receipt="pending"] .identity-strip,
.app-shell[data-receipt="pending"] .case-rail .rail-note,
.app-shell[data-receipt="pending"] .case-rail .demo-queue,
.app-shell[data-receipt="pending"] .receipt-rail {
  display: none;
}

.app-shell[data-receipt="pending"] .console-grid {
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  height: var(--shell-height);
  min-height: var(--shell-height);
  overflow: hidden;
}

.app-shell[data-receipt="pending"] .case-rail {
  min-height: var(--shell-height);
  overflow: hidden;
}

.app-shell[data-receipt="pending"] .workbench {
  display: flex;
  flex-direction: column;
  height: var(--shell-height);
  min-height: 0;
  overflow: hidden;
}

.app-shell[data-receipt="pending"] .surface-tabs {
  flex: 0 0 auto;
}

.app-shell[data-receipt="pending"] #view-evaluate.view-panel.active {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.app-shell[data-receipt="pending"] .panel-header {
  grid-template-columns: minmax(0, 1fr) clamp(236px, 22vw, 280px);
  align-items: start;
  min-height: var(--header-canvas-height);
  margin-bottom: clamp(10px, 1.5svh, 16px);
}

.app-shell[data-receipt="pending"] .panel-header > div:first-child {
  align-self: center;
}

.app-shell[data-receipt="pending"] .settlement-gate {
  align-self: start;
  min-height: 0;
}

.app-shell[data-receipt="pending"] .proof-stepper {
  margin: 8px 0 clamp(10px, 1.6svh, 18px);
  min-height: 28px;
  overflow: hidden;
}

.app-shell[data-receipt="pending"] .workspace-grid {
  min-height: 0;
  align-items: stretch;
}

.app-shell[data-receipt="pending"] .case-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: none;
  padding: 14px;
  align-self: start;
  align-content: start;
  overflow: hidden;
}

.app-shell[data-receipt="pending"] .case-form .form-toolbar,
.app-shell[data-receipt="pending"] .case-form .field:nth-of-type(4),
.app-shell[data-receipt="pending"] .case-form .primary-button {
  grid-column: 1 / -1;
}

.app-shell[data-receipt="pending"] .case-form .primary-button {
  border-color: rgba(237, 242, 234, 0.18);
  background: var(--text);
  box-shadow: none;
  color: #071008;
}

.app-shell[data-receipt="pending"] .case-form .field {
  margin: 0;
}

.app-shell[data-receipt="pending"] .case-form .field:has(textarea) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(var(--packet-field-height) + 25px);
  min-height: calc(var(--packet-field-height) + 25px);
  max-height: calc(var(--packet-field-height) + 25px);
}

.app-shell[data-receipt="pending"] .case-form textarea {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
  resize: none;
}

.app-shell[data-receipt="pending"] #rubric,
.app-shell[data-receipt="pending"] #submittedArtifact {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.app-shell[data-receipt="pending"] #submitter {
  min-height: 42px;
}

.case-form,
.evidence-panel,
.reasoning-panel,
.verification-checklist,
.tamper-diff,
.presenter-panel,
.json-drawer,
.archive-table,
.architecture-diagram {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101210;
}

.case-form,
.evidence-panel {
  padding: 16px;
}

.form-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0d0b;
  color: var(--text);
  padding: 11px 12px;
  resize: none;
  outline: none;
}

textarea {
  min-height: 110px;
  max-height: 240px;
  overflow: auto;
}

#rubric {
  min-height: 164px;
}

#submittedArtifact {
  min-height: 218px;
}

textarea:focus,
input:focus,
.field.spotlight textarea,
.field.spotlight input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.field.spotlight {
  animation: spotlight var(--motion-proof) var(--ease-verify);
}

.primary-button {
  width: auto;
}

.case-form .primary-button {
  width: 100%;
  min-height: 44px;
}

.primary-button.loading {
  position: relative;
  overflow: hidden;
}

.primary-button.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-100%);
  animation: shimmer 1000ms linear infinite;
}

.evidence-grid {
  display: grid;
  gap: 8px;
}

.evidence-row,
.verify-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 10px;
  animation: row-in var(--motion-base) var(--ease-out) both;
  animation-delay: var(--row-delay, 0ms);
}

.evidence-row span,
.verify-row span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.evidence-row strong,
.verify-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.evidence-row small,
.verify-row small {
  color: var(--dim);
}

.reasoning-panel {
  margin-top: 14px;
  padding: 14px;
}

.reasoning-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.reasoning-list li + li {
  margin-top: 8px;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.025);
}

/* Receipt rail */
.receipt-rail {
  padding: 18px 16px;
}

.receipt-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101210;
  box-shadow: none;
  padding: 16px;
}

.receipt-rail[data-state="pending"] .receipt-card {
  position: sticky;
  top: 88px;
}

.receipt-header strong {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.receipt-header strong.sealed {
  color: var(--green);
}

.receipt-facts {
  margin: 14px 0;
}

.receipt-facts div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-facts div:last-child {
  border-bottom: 0;
}

.receipt-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.decision-text.pass,
.table-decision.pass {
  color: var(--green);
}

.decision-text.revise,
.table-decision.revise {
  color: var(--amber);
}

.decision-text.fail,
.table-decision.fail {
  color: var(--red);
}

.receipt-actions {
  flex-direction: column;
  align-items: stretch;
}

.receipt-actions .secondary-button,
.receipt-actions .icon-link {
  width: 100%;
}

/* Verification */
.verify-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.verify-actions {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 14px;
}

.verification-checklist,
.tamper-diff {
  margin-top: 16px;
  padding: 14px;
}

.verification-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.verification-summary.ok {
  border-color: rgba(55, 214, 122, 0.36);
  background: rgba(55, 214, 122, 0.08);
}

.verification-summary.fail {
  border-color: rgba(255, 107, 107, 0.38);
  background: rgba(255, 107, 107, 0.08);
}

.verify-row.ok span {
  color: var(--green);
}

.verify-row.fail span,
.verify-row.fail strong {
  color: var(--red);
}

.verify-row.warn span,
.verify-row.warn strong {
  color: var(--amber);
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.diff-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.diff-grid strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

/* Registry and demo */
.registry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.registry-card {
  padding: 14px;
}

.registry-card span,
.registry-card strong,
.registry-card small,
.registry-card a {
  display: block;
}

.registry-card strong {
  margin: 8px 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--mono);
}

.registry-card a {
  margin-top: 10px;
  color: var(--accent);
  font-weight: 800;
}

.architecture-diagram {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 24px minmax(110px, 1fr) 24px minmax(130px, 1.08fr) 24px minmax(136px, 1.12fr) 24px minmax(132px, 1.08fr);
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
}

.diagram-node {
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 800;
}

.diagram-node.strong {
  color: var(--text);
  border-color: rgba(55, 214, 122, 0.34);
  background: rgba(55, 214, 122, 0.08);
}

.diagram-arrow {
  color: var(--accent);
  font-family: var(--mono);
  text-align: center;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 900;
}

.presenter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
}

.presenter-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--accent);
}

.demo-script {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.demo-script li {
  margin-bottom: 12px;
}

/* Archive and JSON */
.archive-table {
  margin-top: 18px;
  overflow: auto;
}

.archive-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.archive-table th,
.archive-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.archive-table th {
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.archive-table td {
  color: var(--muted);
}

.table-decision {
  font-weight: 900;
  text-transform: uppercase;
}

.json-drawer {
  margin-top: 16px;
  overflow: hidden;
}

.json-drawer summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 800;
}

.json-drawer pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #080a08;
  padding: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: 360px;
  border: 1px solid rgba(55, 214, 122, 0.3);
  border-radius: var(--radius);
  background: #101710;
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 12px 14px;
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.42);
  background: #1a1010;
}

@keyframes entry-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes entry-leave {
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

@keyframes entry-demo-launch {
  from {
    opacity: 1;
    transform: translateY(-50%);
  }
  to {
    opacity: 0.18;
    transform: translateY(calc(-50% - 18px)) scale(0.985);
  }
}

@keyframes entry-receipt-launch {
  from {
    opacity: 1;
    transform: translateY(-50%);
  }
  to {
    opacity: 0.24;
    transform: translateY(calc(-50% + 16px)) scale(0.98);
  }
}

@keyframes entry-demo-launch-mobile {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0.18;
    transform: translateY(-14px) scale(0.985);
  }
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes surface-enter {
  from {
    opacity: 0.86;
  }
  to {
    opacity: 1;
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes spotlight {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes story-reveal-up {
  from {
    opacity: 0;
    filter: blur(5px);
    transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 12px), 0) scale(var(--reveal-scale, 0.985));
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes story-reveal-line {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: scaleX(0.45);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scaleX(1);
  }
}

@keyframes story-reveal-pop {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 0), 0) scale(var(--reveal-scale, 0.94));
  }
  68% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1.025);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes story-reveal-lock {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 18px), 0) scale(var(--reveal-scale, 0.92));
    box-shadow: 0 0 0 rgba(55, 214, 122, 0);
  }
  60% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, -2px, 0) scale(1.015);
    box-shadow: 0 0 36px rgba(55, 214, 122, 0.12);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  }
}

@keyframes story-reveal-core {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: scale(var(--reveal-scale, 0.9));
    box-shadow: 0 0 0 rgba(91, 184, 255, 0);
  }
  62% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1.035);
    box-shadow: 0 0 72px rgba(91, 184, 255, 0.18);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes story-reveal-seal-card {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(22px) scale(0.94);
  }
  64% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-2px) scale(1.018);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes story-reveal-stamp {
  0% {
    opacity: 0;
    filter: blur(4px);
    transform: scale(var(--reveal-scale, 1.18)) rotate(-2deg);
    text-shadow: 0 0 0 rgba(55, 214, 122, 0);
  }
  55% {
    opacity: 1;
    filter: blur(0);
    transform: scale(0.96) rotate(1deg);
    text-shadow: 0 0 44px rgba(55, 214, 122, 0.32);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) rotate(0);
  }
}

@keyframes story-reveal-row {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateX(-14px) scaleX(0.96);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scaleX(1);
  }
}

@keyframes story-reveal-check {
  0% {
    opacity: 0;
    filter: blur(3px);
    transform: translateX(18px);
    border-color: rgba(55, 214, 122, 0.04);
  }
  70% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(-2px);
    border-color: rgba(55, 214, 122, 0.42);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

@keyframes story-reveal-fracture {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: scale(var(--reveal-scale, 0.82)) rotate(-4deg);
  }
  42% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1.08) rotate(3deg);
  }
  70% {
    transform: scale(0.97) rotate(-1deg);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) rotate(0);
  }
}

@keyframes story-reveal-console {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-18px) scale(0.98);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@keyframes story-progress-active {
  from {
    box-shadow: 0 0 0 rgba(91, 184, 255, 0);
  }
  50% {
    box-shadow: 0 0 32px rgba(91, 184, 255, 0.18);
  }
  to {
    box-shadow: 0 0 0 rgba(91, 184, 255, 0);
  }
}

@keyframes receipt-idle-glow {
  0%,
  100% {
    border-color: rgba(230, 235, 225, 0.18);
    box-shadow:
      0 36px 120px rgba(0, 0, 0, 0.58),
      0 0 110px rgba(55, 214, 122, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  50% {
    border-color: rgba(55, 214, 122, 0.25);
    box-shadow:
      0 36px 120px rgba(0, 0, 0, 0.58),
      0 0 138px rgba(55, 214, 122, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

@keyframes active-agent-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 14px rgba(91, 184, 255, 0.44);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 22px rgba(91, 184, 255, 0.68);
  }
}

@keyframes pipeline-idle {
  0%,
  18%,
  100% {
    border-color: rgba(55, 214, 122, 0.12);
    background: rgba(55, 214, 122, 0.045);
    color: rgba(203, 218, 201, 0.76);
  }
  8% {
    border-color: rgba(55, 214, 122, 0.25);
    background: rgba(55, 214, 122, 0.075);
    color: rgba(237, 242, 234, 0.9);
  }
}

@keyframes seal-idle {
  0%,
  100% {
    border-color: rgba(55, 214, 122, 0.22);
    box-shadow: 0 0 24px rgba(55, 214, 122, 0.1);
  }
  50% {
    border-color: rgba(55, 214, 122, 0.34);
    box-shadow: 0 0 34px rgba(55, 214, 122, 0.17);
  }
}

@keyframes story-scan {
  0% {
    transform: scaleX(0.7);
    opacity: 0.52;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(0.7);
    opacity: 0.52;
  }
}

@keyframes story-slide-package {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes story-lock {
  from {
    opacity: 0;
    transform: translateY(16px);
    border-color: rgba(240, 184, 74, 0.42);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    border-color: rgba(55, 214, 122, 0.32);
  }
}

@keyframes story-compute-pulse {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.86;
    transform: scale(1);
  }
}

@keyframes story-seal {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes story-check-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes story-glitch {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(2px);
  }
}

@media (max-width: 1280px) {
  .entry-receipt-stack {
    right: clamp(24px, 4vw, 52px);
    width: clamp(300px, 30vw, 360px);
    min-height: 430px;
    opacity: 0.7;
  }

  .entry-content {
    left: clamp(34px, 5vw, 64px);
    width: min(640px, calc(100vw - 430px));
  }

  .console-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .receipt-rail {
    position: static;
    grid-column: 1 / -1;
    min-height: 0;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .receipt-card {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 210px;
    gap: 14px;
    align-items: start;
  }

  .receipt-facts {
    margin: 0;
  }
}

@media (max-height: 900px) and (min-width: 901px) {
  :root {
    --topbar-height: 64px;
    --zone-pad: 16px;
    --header-canvas-height: 136px;
    --packet-field-height: 108px;
  }

  .topbar {
    padding-block: 8px;
  }

  .surface-tabs {
    margin-bottom: 16px;
  }

  h1 {
    font-size: clamp(28px, 2.7vw, 38px);
  }

  .panel-header p:not(.eyebrow) {
    margin-top: 8px;
  }

  .settlement-gate {
    padding: 14px;
  }

  .gate-checks {
    margin-top: 10px;
    padding-top: 10px;
  }
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-mode {
    place-items: start center;
    overflow-y: auto;
  }

  .story-shell {
    height: auto;
    min-height: calc(100svh - 24px);
    overflow: visible;
  }

  .story-progress {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .story-frame {
    grid-template-columns: 1fr;
  }

  .story-copy {
    justify-content: start;
  }

  .story-stage {
    min-height: 360px;
  }

  .story-stage-problem,
  .story-stage-submission,
  .story-stage-tamper {
    grid-template-columns: 1fr;
  }

  .story-payment-line i {
    width: 2px;
    height: 54px;
  }

  .story-app-facts {
    position: static;
    margin-top: 14px;
  }

  .story-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .story-control-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-control-group:last-child {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-handoff-banner {
    grid-template-columns: 1fr;
    top: 0;
    padding-inline: 16px;
  }

  .topbar-actions {
    width: 100%;
  }

  .console-grid {
    display: flex;
    flex-direction: column;
  }

  .workbench {
    order: 1;
  }

  .receipt-rail {
    order: 2;
  }

  .case-rail {
    order: 3;
  }

  .case-rail,
  .receipt-rail {
    position: static;
    min-height: 0;
    height: auto;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
  }

  .rail-heading,
  .rail-note,
  .demo-queue {
    grid-column: 1 / -1;
  }

  .workspace-grid,
  .verify-layout,
  .panel-header {
    grid-template-columns: 1fr;
  }

  .identity-strip,
  .proof-stepper,
  .registry-grid,
  .architecture-diagram {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .receipt-card {
    display: block;
  }

  .entry-layer {
    min-height: 100svh;
    padding: clamp(28px, 7vw, 58px);
    overflow-y: auto;
  }

  .entry-content {
    position: relative;
    left: auto;
    top: auto;
    width: min(720px, 100%);
    transform: none;
    padding-top: clamp(30px, 7svh, 72px);
  }

  .entry-layer.story-launching .entry-content {
    animation-name: entry-demo-launch-mobile;
  }

  .entry-receipt-stack {
    display: none;
  }

  .entry-content h1 {
    font-size: clamp(64px, 13vw, 108px);
  }

  .entry-identities,
  .entry-status-strip {
    position: static;
    display: flex;
    justify-content: flex-start;
    width: min(640px, 100%);
    max-width: none;
    margin: 24px 0 0;
  }

  .entry-pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell[data-receipt="pending"] .console-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: var(--shell-height);
    overflow: visible;
  }

  .app-shell[data-receipt="pending"] .workbench {
    height: auto;
    overflow: visible;
  }

  .app-shell[data-receipt="pending"] #view-evaluate.view-panel.active {
    display: block;
    overflow: visible;
  }

  .app-shell[data-receipt="pending"] .panel-header {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .app-shell[data-receipt="pending"] .panel-header > div:first-child,
  .app-shell[data-receipt="pending"] .settlement-gate {
    align-self: start;
  }

  .app-shell[data-receipt="pending"] .case-form {
    grid-template-columns: 1fr;
  }

  .app-shell[data-receipt="pending"] .case-form textarea,
  .app-shell[data-receipt="pending"] #rubric,
  .app-shell[data-receipt="pending"] #submittedArtifact {
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .app-shell[data-receipt="pending"] .case-form .field:has(textarea) {
    height: 118px;
    min-height: 118px;
    max-height: 118px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .story-mode {
    padding: 8px;
  }

  .story-shell {
    min-height: calc(100svh - 16px);
    padding: 12px;
  }

  .story-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .story-stage-terms,
  .story-control-group,
  .story-control-group:last-child {
    grid-template-columns: 1fr;
  }

  .story-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-frame {
    grid-row: 4;
  }

  .story-controls {
    grid-row: 3;
  }

  .story-copy h3 {
    font-size: clamp(28px, 10vw, 42px);
  }

  .story-copy p:not(.eyebrow) {
    font-size: 16px;
  }

  .story-stage {
    min-height: 320px;
    padding: 14px;
  }

  .story-receipt-card div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .workbench,
  .case-rail,
  .receipt-rail {
    padding: 12px;
  }

  .case-rail,
  .identity-strip,
  .proof-stepper,
  .registry-grid,
  .architecture-diagram,
  .diff-grid {
    grid-template-columns: 1fr;
  }

  .case-rail {
    display: block;
  }

  .entry-content h1 {
    font-size: clamp(48px, 14vw, 64px);
  }

  .entry-layer {
    height: auto;
    min-height: 100svh;
    padding: 28px 16px;
    overflow-y: auto;
  }

  .entry-content p {
    font-size: 16px;
    line-height: 1.45;
  }

  .entry-receipt-stack {
    display: none;
  }

  .entry-identities,
  .entry-status-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  .entry-actions,
  .presenter-panel,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-actions {
    width: 100%;
  }

  .entry-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-status-strip {
    display: none;
  }

  .entry-actions .primary-button,
  .entry-actions .secondary-button,
  .topbar-actions > *,
  .presenter-controls > * {
    width: 100%;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .topbar-actions > * {
    width: auto;
  }

  .entry-identities {
    gap: 10px 18px;
  }

  .entry-identities button {
    justify-content: center;
  }

  .entry-status-strip {
    flex-direction: column;
    gap: 8px;
  }

  .surface-tabs,
  .proof-stepper {
    flex-wrap: wrap;
    overflow: visible;
  }

  .tab {
    flex: 1 1 calc(50% - 6px);
  }

  .proof-step {
    flex: 1 1 calc(50% - 10px);
  }

  .evidence-row,
  .verify-row {
    grid-template-columns: 1fr;
  }

  .receipt-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .entry-receipt-stack {
    opacity: 0.92;
    transform: translateY(-50%);
  }
}
