/* The home page story: drawn by /site/story.js on one stage. Transforms and opacity only. */
.story .stage { position: relative; aspect-ratio: 16 / 9.4; overflow: hidden; border-radius: var(--r-card); background: var(--glass); box-shadow: var(--sh-glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.story .layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.story #docs { z-index: 1; }

.story .count { position: absolute; z-index: 4; margin: 0; color: var(--ink-2); font-size: .875rem; font-variant-numeric: tabular-nums; opacity: 0; }
.story .count b { color: var(--ink); font-weight: 500; }
.story .glabel { position: absolute; z-index: 4; margin: 0; color: var(--ink-3); font-size: .8125rem; opacity: 0; }
.story .glabel b { margin-left: 6px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* under the stage: what is happening now, and the steps to jump between */
.story .story-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 44px; margin-top: 12px; }
.story .cap { min-height: 1.4em; margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.4; } /* reserved so the first caption does not push the page */

.story .doc { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 8px 24px -12px rgba(0, 0, 0, .35); will-change: transform; }
.story .doc img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.story .sheet { transform-origin: 50% 50%; }
:root[data-theme="dark"] .story .doc { box-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px -10px rgba(0, 0, 0, .8); }

.story .sheet { position: absolute; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 18px 40px -20px rgba(0, 0, 0, .4); }
.story .sheet img { display: block; width: 100%; height: auto; }
.story .ocr { position: absolute; border-radius: 2px; background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); opacity: 0; }
.story .scanline { position: absolute; left: -3%; right: -3%; top: 0; height: 2px; background: var(--accent); opacity: 0; }
.story .box { position: absolute; border: 2px solid var(--accent); border-radius: 4px; background: var(--accent-wash); opacity: 0; }
.story .box.bad { border-color: var(--no); background: rgba(180, 35, 24, .08); }

.story .chip { position: absolute; z-index: 3; display: flex; align-items: baseline; gap: 8px; padding: 7px 10px 7px 12px; border-radius: 10px; background: var(--glass-solid); box-shadow: var(--sh-row); font-size: .875rem; white-space: nowrap; opacity: 0; }
.story .chip small { color: var(--ink-3); font-size: .8125rem; }
.story .chip b { font-weight: 500; font-variant-numeric: tabular-nums; }
.story .chip i { font-style: normal; font-size: .75rem; padding: 1px 6px; border-radius: 6px; background: var(--accent-wash); color: var(--accent); }
.story #lines path { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: .7; }

.story .checks { position: absolute; z-index: 3; transform-origin: 0 0; }
.story .checks .rules { position: static; }
.story .rules { position: absolute; z-index: 3; margin: 0; padding: 0; list-style: none; overflow: hidden; border-radius: 12px; background: var(--glass-solid); box-shadow: var(--sh-row); }
.story .rules li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--hair); font-size: 1rem; opacity: 0; }
.story .rules li:first-child { border-top: 0; }
.story .rules .mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-wash); color: var(--ok); font-size: .8125rem; font-weight: 600; }
.story .rules .no .mark { background: rgba(180, 35, 24, .1); color: var(--no); }
.story .rules .no b { color: var(--no); font-weight: 500; }
.story .rules small { display: block; margin-top: 2px; color: var(--ink-3); font-size: .84375rem; }

.story .ledger { position: absolute; z-index: 3; overflow: hidden; border-radius: 16px; background: var(--glass-solid); box-shadow: var(--sh-row); font-size: .9375rem; }
.story .lrow { display: grid; grid-template-columns: 1.6fr 1.2fr .9fr 1.1fr; gap: 16px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--hair); opacity: 0; font-variant-numeric: tabular-nums; }
.story .ltitle { margin: 0; padding: 14px 20px 4px; font-size: 1rem; font-weight: 500; }
.story .lrow.head { border-top: 0; color: var(--ink-3); font-size: .8125rem; opacity: 1; }
.story .lrow .amt { text-align: right; }
.story .lrow .st { color: var(--ok); }
.story .lrow.held .st { color: var(--no); }
.story .lrow.head .st { color: var(--ink-3); }
.story .ledger.tight .lrow { padding: 6px 16px; font-size: .84375rem; }
.story .ledger.tight .ltitle { padding-bottom: 4px; }
.story .lrow.ok .st { color: var(--ok); font-weight: 600; }
.story .approve.done { background: var(--ok-wash); color: var(--ok); box-shadow: none; }
.story .approve { position: absolute; z-index: 4; padding: 12px 22px; border-radius: var(--r-ctl); background: var(--key-bg); color: var(--key-ink); box-shadow: var(--sh-key); font-size: .9375rem; opacity: 0; }

.story .replay { position: absolute; z-index: 6; top: 6px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-3); cursor: pointer; transition: color .2s; }
.story .replay svg { width: 20px; height: 20px; }
.story .replay:hover { color: var(--ink); }
.story .replay:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.story .chapters { display: flex; flex: none; gap: 0; }
.story .chapters button { position: relative; width: 40px; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.story .chapters button::after, .story .chapters .bar { content: ""; position: absolute; left: 4px; right: 4px; top: 21px; height: 3px; border-radius: 2px; background: var(--hair-2); transition: background .2s; }
.story .chapters button:hover::after { background: var(--ink-3); }
.story .chapters .bar { z-index: 1; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.story .chapters button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
@media (min-width: 980px) { .story .stage { aspect-ratio: 5 / 4; } }
@media (max-width: 979px) { .story .story-foot { flex-direction: column; justify-content: center; text-align: center; } }

@media (max-width: 640px) {
  .story .stage { aspect-ratio: 3 / 5.2; }
  .story .chip { padding: 6px 9px; font-size: .8125rem; }
  .story .rules li { padding: 10px 12px; font-size: .90625rem; }
  .story .lrow { grid-template-columns: 1.5fr .9fr .9fr; gap: 10px; padding: 11px 12px; font-size: .84375rem; }
  .story .lrow .id { display: none; }
    .story .chapters button { width: 44px; }
}
@media (max-width: 359px) { .story .cap { min-height: 2.8em; } }
