/* See it work — The Busywork Co. Static, no dependencies. */
:root {
  --deep: #132824; --deep2: #1c3a33; --paper: #fffdf7; --ink: #17221f; --muted: #55605c; --line: #d9ddd4;
  --avail: calc(100svh - 60px); /* height available to the stage; set from the host page when embedded */
  --accent: #ef5a3c; --accent-hover: #d94327; --signal: #e5f14b; --ok: #2f8f5b; --deep-ink: #f7f4e9; --deep-muted: #c9d3cc;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
body {
  margin: 0; min-height: 100svh; color: var(--deep-ink); font-family: "Source Sans 3", system-ui, sans-serif; font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; background: #0c1b18;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.2px), radial-gradient(1100px 760px at 30% 38%, #234a40 0%, #132824 58%, #0c1b18 100%);
  background-size: 28px 28px, 100% 100%; background-attachment: scroll, fixed;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono, #cards .nm, #cards .ms, #cards pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

header.site { width: min(1380px, calc(100% - 48px)); margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
header.site .brand { font-family: "Source Serif 4", serif; font-size: 21px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.toplink { text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(247, 244, 233, .55); padding-bottom: 3px; line-height: 1.25; }
.toplink:hover { border-color: var(--signal); }

/* ---------- embedded in the homepage (iframe, ?embed=1) ---------- */
html.embed { --avail: 760px; }
html.embed body { min-height: 0; background: #132824; background-image: radial-gradient(900px 620px at 32% 44%, #1f443b 0%, #132824 70%); overflow: hidden; }
@media (prefers-color-scheme: dark) { html.embed body { background: #0a2420; background-image: radial-gradient(900px 620px at 32% 44%, #143a31 0%, #0a2420 70%); } }
html.embed header.site, html.embed .after { display: none; }
html.embed #top { justify-content: flex-end; min-height: 18px; }
html.embed #top h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
html.embed #stage { padding-top: 10px; }

/* ---------- stage (desktop: three columns) ---------- */
#stage {
  position: relative; width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 4px 0 10px;
  display: grid; grid-template-columns: minmax(300px, 1.2fr) minmax(240px, .72fr) minmax(330px, 1fr); column-gap: 44px; row-gap: 18px; align-items: start;
  grid-template-areas: "top top top" "paper rail bill" "ctl ctl ctl";
}
#top { grid-area: top; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
#top h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--deep-ink); }
#top h1 span { font-weight: 400; color: var(--deep-muted); }
#top .note { margin: 0; font-size: 13px; color: var(--deep-muted); opacity: .8; }

#paperWrap { grid-area: paper; position: relative; justify-self: center; width: min(100%, calc((var(--avail) - 155px) * .7647)); min-width: 300px; aspect-ratio: 520 / 680; }
#paperMove, #paperWin { position: absolute; inset: 0; }
#paperCam, #paperScale { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.paper {
  position: absolute; left: 0; top: 0; width: 520px; height: 680px; background: var(--paper); border-radius: 6px; padding: 34px 36px; overflow: hidden;
  font-size: 13.5px; line-height: 1.45; color: #26302d; transform: rotate(-1.2deg); box-shadow: 0 30px 70px rgba(0, 0, 0, .38), 0 2px 0 rgba(255, 255, 255, .6) inset;
}
.paper h4 { margin: 0; font-family: "Source Serif 4", serif; font-size: 23px; font-weight: 600; color: #17221f; display: flex; align-items: center; gap: 10px; }
.mark { width: 30px; height: 30px; border-radius: 50%; background: #1c3a33; display: inline-grid; place-items: center; color: var(--signal); font-size: 16px; flex: none; }
.paper .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 20px 0 18px; padding: 12px 0; border-top: 1.5px solid #17221f; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.paper .meta i { font-style: normal; color: var(--muted); display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.svc { border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; margin-bottom: 11px; }
.svc .a { font-weight: 600; color: #17221f; }
.svc .r { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); }
.svc .r b { color: #17221f; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; margin: 14px 0 4px; }
.bars span { flex: 1; background: #dfe5dc; border-radius: 2px 2px 0 0; }
.bars span.on { background: #1c3a33; }
.tot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1.5px solid #17221f; font-family: "Source Serif 4", serif; font-size: 19px; font-weight: 600; }
.fine { margin-top: 16px; }
.fine div { height: 6px; background: #e9ece4; border-radius: 3px; margin-bottom: 7px; }
[data-f] { position: relative; border-radius: 4px; }
/* supplier invoice */
.mark.sq { border-radius: 7px; font-family: "Source Serif 4", serif; font-weight: 600; font-size: 17px; }
.inv-top { display: flex; justify-content: space-between; align-items: center; }
.doc-kind { font-size: 12.5px; letter-spacing: .2em; color: var(--muted); font-weight: 700; }
.tbl { margin-top: 2px; }
.tbl .th, .tbl .tr { display: grid; grid-template-columns: 46px 1fr auto; align-items: baseline; border-bottom: 1px solid var(--line); }
.tbl .th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 7px; }
.tbl .tr { padding: 12px 0; }
.tbl .tr [data-f] { justify-self: start; }
.tbl .tr b { font-weight: 600; color: #17221f; justify-self: end; }
.tbl .tr.cr, .tbl .tr.cr b { color: #a13d22; }
.tbl + .tot { margin-top: 20px; }
/* store receipt */
.paper.receipt { background: transparent; box-shadow: none; padding: 0; overflow: visible; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .36)); }
.strip { position: absolute; left: 92px; top: 16px; width: 336px; padding: 28px 28px 34px; background: #fffdf7 linear-gradient(100deg, rgba(0, 0, 0, .04), transparent 28%, rgba(0, 0, 0, .035) 61%, transparent 82%); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.4; color: #2b332f; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), 98.21% 100%, 96.43% calc(100% - 7px), 94.64% 100%, 92.86% calc(100% - 7px), 91.07% 100%, 89.29% calc(100% - 7px), 87.50% 100%, 85.71% calc(100% - 7px), 83.93% 100%, 82.14% calc(100% - 7px), 80.36% 100%, 78.57% calc(100% - 7px), 76.79% 100%, 75.00% calc(100% - 7px), 73.21% 100%, 71.43% calc(100% - 7px), 69.64% 100%, 67.86% calc(100% - 7px), 66.07% 100%, 64.29% calc(100% - 7px), 62.50% 100%, 60.71% calc(100% - 7px), 58.93% 100%, 57.14% calc(100% - 7px), 55.36% 100%, 53.57% calc(100% - 7px), 51.79% 100%, 50.00% calc(100% - 7px), 48.21% 100%, 46.43% calc(100% - 7px), 44.64% 100%, 42.86% calc(100% - 7px), 41.07% 100%, 39.29% calc(100% - 7px), 37.50% 100%, 35.71% calc(100% - 7px), 33.93% 100%, 32.14% calc(100% - 7px), 30.36% 100%, 28.57% calc(100% - 7px), 26.79% 100%, 25.00% calc(100% - 7px), 23.21% 100%, 21.43% calc(100% - 7px), 19.64% 100%, 17.86% calc(100% - 7px), 16.07% 100%, 14.29% calc(100% - 7px), 12.50% 100%, 10.71% calc(100% - 7px), 8.93% 100%, 7.14% calc(100% - 7px), 5.36% 100%, 3.57% calc(100% - 7px), 1.79% 100%, 0.00% calc(100% - 7px)); }
.paper.receipt #beam { left: 92px; right: 92px; }
.rc-h { text-align: center; font-weight: 700; font-size: 16px; letter-spacing: .05em; }
.rc-c { text-align: center; margin-top: 3px; }
.rc-rule { border-top: 1.5px dashed #9aa39c; margin: 13px 0; }
.rc-r { display: flex; justify-content: space-between; padding: 4px 0; }
.rc-r b { font-weight: 500; }
.rc-r.big { font-size: 17px; font-weight: 700; padding-top: 8px; }
.rc-r.big b { font-weight: 700; }
.strip .dim { color: #7b857f; }
.smudge { filter: blur(.75px); }
.smudge::after { content: ""; position: absolute; inset: -7px -12px; background: radial-gradient(closest-side, rgba(74, 52, 30, .42), rgba(74, 52, 30, 0)); transform: rotate(-12deg) scaleX(1.25); pointer-events: none; }
.hand { margin-top: 20px; text-align: center; font-family: "Caveat", "Bradley Hand", cursive; font-weight: 600; font-size: 31px; line-height: 1; color: #1f3f8f; transform: rotate(-3deg); }
.rc-bar { height: 34px; margin-top: 20px; background: repeating-linear-gradient(90deg, #2b332f 0 2px, transparent 2px 5px, #2b332f 5px 6px, transparent 6px 9px, #2b332f 9px 12px, transparent 12px 14px); opacity: .85; }
.hl { position: absolute; border: 2px solid var(--accent); background: rgba(239, 90, 60, .09); border-radius: 6px; pointer-events: none; opacity: 0; transition: background .2s, box-shadow .2s; }
.paper.focusing .hl { opacity: .28 !important; }
.paper.focusing .hl.on { opacity: 1 !important; background: rgba(229, 241, 75, .5); box-shadow: 0 0 0 5px rgba(229, 241, 75, .35); }
#beam { position: absolute; left: 0; right: 0; top: 0; height: 90px; opacity: 0; pointer-events: none; mix-blend-mode: multiply; background: linear-gradient(180deg, rgba(229, 241, 75, 0) 0%, rgba(229, 241, 75, .22) 78%, rgba(229, 241, 75, .85) 98%, rgba(229, 241, 75, 0) 100%); }

/* ---------- agent rail ---------- */
#railSlot { grid-area: rail; position: relative; min-height: 420px; }
#rail .hd { all: unset; display: flex; align-items: center; gap: 9px; color: var(--deep-muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 12px; width: 100%; }
#rail .hd .more { display: none; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); animation: pulse 1.6s ease-out infinite; flex: none; }
#stage.paused .pulse, #stage.done .pulse { animation: none; opacity: .6; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 241, 75, .55); } 100% { box-shadow: 0 0 0 9px rgba(229, 241, 75, 0); } }
#say { margin: 0 0 14px; min-height: 3.1em; font-family: "Source Serif 4", serif; font-size: 20px; line-height: 1.3; color: var(--deep-ink); }
#say::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--signal); margin-left: 3px; vertical-align: -2px; opacity: 0; }
#stage.typing #say::after { opacity: 1; }
.card { display: block; width: 100%; text-align: left; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; padding: 10px 13px; margin: 0 0 9px; color: var(--deep-ink); opacity: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
button.card:hover { border-color: rgba(229, 241, 75, .5); }
.card .n { all: unset; display: flex; align-items: center; gap: 9px; width: 100%; cursor: pointer; font-size: 13.5px; }
.card .n:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
.card .ms { margin-left: auto; font-size: 11.5px; color: #9fb0a7; }
.card .res { display: block; font-size: 13.5px; color: var(--deep-muted); margin-top: 4px; padding-left: 25px; }
.card pre { display: none; margin: 9px 0 2px; padding: 9px 10px; border-radius: 8px; background: rgba(0, 0, 0, .28); color: #d7e0d9; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.card.open pre { display: block; }
.card .tw { margin-left: 8px; font-size: 10px; color: #9fb0a7; transition: transform .2s; }
.card.open .tw { transform: rotate(90deg); }
.ic { width: 16px; height: 16px; border-radius: 50%; flex: none; position: relative; }
.ic.spin { border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--signal); }
.ic.done { background: var(--ok); }
.ic.done::after, .tk::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ic.stop { background: var(--accent); }
.ic.stop::after { content: ""; position: absolute; left: 4px; right: 4px; top: 7px; height: 2px; background: #fff; border-radius: 1px; }
.pill { border-radius: 12px; padding: 9px 13px; margin: 0 0 9px; background: rgba(229, 241, 75, .14); border: 1px solid rgba(229, 241, 75, .45); color: #f3f7c9; font-size: 13.5px; opacity: 0; }
.card.pending, .pill.pending { visibility: hidden; }

/* ---------- the bill ---------- */
#bill { grid-area: bill; position: relative; background: var(--paper); color: var(--ink); border-radius: 18px; box-shadow: 0 34px 80px rgba(0, 0, 0, .42); padding: 24px 26px 22px; max-width: 460px; width: 100%; justify-self: end; }
#bill .bh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
#bill .bh b { font-family: "Source Serif 4", serif; font-size: 23px; font-weight: 600; line-height: 1.1; }
#bill .bh small { display: block; color: var(--muted); font-size: 12.5px; font-family: "Source Sans 3", sans-serif; font-weight: 400; letter-spacing: .04em; margin-top: 3px; }
#status { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 6px 12px; background: #eceee6; color: var(--muted); white-space: nowrap; }
.fld { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 16px; }
.f.wide { grid-column: 1 / 3; }
.f i { font-style: normal; display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.v { position: relative; min-height: 25px; border-radius: 6px; font-size: 16px; font-weight: 600; padding: 1px 5px; margin-left: -5px; }
.v .sk { position: absolute; left: 5px; top: 7px; height: 11px; width: 62%; border-radius: 5px; background: linear-gradient(90deg, #eceee6, #f6f7f1, #eceee6); }
.v .tx { opacity: 0; white-space: nowrap; }
.ln { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--line); padding: 9px 0; min-height: 57px; border-radius: 4px; transition: opacity .3s; }
.ln.out { opacity: .55; }
.ln.out .v .tx, .ln.out .amt { text-decoration: line-through; }
.sl { position: relative; }
.sumchip { display: inline-flex; align-items: center; height: 22px; font-family: "Source Sans 3", sans-serif; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 0 9px; margin-left: 10px; white-space: nowrap; opacity: 0; transform-origin: 0 50%; }
.sumchip.q { position: absolute; left: 100%; top: 0; border: 1.5px dashed var(--accent); color: var(--accent); }
.sumchip.set { background: #1c3a33; color: var(--signal); }
.ln .d { flex: 1; min-width: 0; }
.ln .v { font-size: 14.5px; }
.ln .amt { font-weight: 700; font-size: 15.5px; opacity: 0; border-radius: 6px; padding: 1px 4px; margin-top: 1px; }
.locw { position: relative; height: 26px; display: flex; align-items: center; gap: 10px; }
.loc { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; height: 22px; }
.loc.q { border: 1.5px dashed var(--accent); color: var(--accent); opacity: 0; position: absolute; left: 0; top: 2px; }
.loc.set { background: #1c3a33; color: var(--signal); opacity: 0; transform-origin: 0 50%; padding: 0; }
.loc.set select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; padding: 2px 9px; margin: 0; height: 22px; border-radius: 999px; opacity: 1; }
.loc.set select:disabled { opacity: 1; color: var(--signal); }
#stage.done .loc.set select { padding-right: 22px; cursor: pointer; background: no-repeat right 8px center / 8px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23e5f14b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.why { all: unset; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px dashed var(--muted); line-height: 1.2; display: none; }
#stage.done .why { display: inline-block; }
.why:hover { color: var(--ink); }
.because { margin: 6px 0 0; font-size: 13px; color: #3a4541; background: #f1f3ea; border-radius: 8px; padding: 7px 10px; }
.tk { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); flex: none; position: relative; opacity: 0; margin-top: 3px; }
.tk::after { left: 6px; top: 3px; height: 9px; }
.tk.on { opacity: 1; width: 15px; height: 15px; margin: 0; }
.tk.on::after { left: 5px; top: 2px; height: 8px; }
.sum { display: flex; justify-content: space-between; align-items: baseline; border-top: 1.5px solid #17221f; padding-top: 13px; margin-top: 2px; border-radius: 4px; font-weight: 600; }
.sum b { font-family: "Source Serif 4", serif; font-size: 27px; font-weight: 600; border-radius: 6px; padding: 0 5px; }
#math { font-size: 13.5px; color: var(--ok); font-weight: 600; margin-top: 7px; opacity: 0; display: flex; gap: 7px; align-items: center; }
.ft { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; min-height: 44px; }
#clip { font-size: 13px; background: #eceee6; border-radius: 8px; padding: 7px 10px; color: #3a4541; opacity: 0; }
#approve { border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 15.5px; border-radius: 999px; padding: 11px 22px; opacity: 0; }
#approve:disabled { cursor: default; }
#stage.done #approve:not(:disabled) { animation: ring 1.5s ease-out infinite; }
#stage.done #approve:not(:disabled):hover { background: var(--accent-hover); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(239, 90, 60, .5); } 100% { box-shadow: 0 0 0 16px rgba(239, 90, 60, 0); } }
#stamp { position: absolute; right: 24px; bottom: 22px; padding: 5px 14px; border: 3px solid var(--ok); color: var(--ok); border-radius: 8px; font-weight: 700; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; transform: rotate(-9deg) scale(2.2); opacity: 0; pointer-events: none; background: rgba(255, 253, 247, .85); }
#stage.approved #stamp { opacity: .92; transform: rotate(-9deg) scale(1); transition: transform .32s cubic-bezier(.2, 1.5, .4, 1), opacity .18s; }
#stage.approved #approve { display: none; }
#dupBanner { position: absolute; left: 14px; right: 14px; top: -16px; background: var(--ink); color: var(--paper); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14.5px; opacity: 0; transform: translateY(8px); pointer-events: none; box-shadow: 0 14px 30px rgba(0, 0, 0, .3); border-left: 5px solid var(--accent); z-index: 2; }
.lit { background: rgba(229, 241, 75, .55) !important; box-shadow: 0 0 0 4px rgba(229, 241, 75, .3); }
#stage.done .ln:hover, #stage.done .f:hover .v, #stage.done .sum:hover { background: rgba(229, 241, 75, .16); }
#stage.done [data-f] { cursor: pointer; }

/* ---------- controls ---------- */
#ctl { grid-area: ctl; display: flex; align-items: center; gap: 16px; padding: 6px 0 4px; color: #9fb0a7; }
#play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .3); background: transparent; display: grid; place-items: center; }
#play:hover, #speed:hover, #skip:hover, #restart:hover { border-color: var(--signal); color: var(--deep-ink); }
#play span { width: 11px; height: 13px; border-left: 4px solid #fff; border-right: 4px solid #fff; }
#play.paused span { width: 0; height: 0; border: 0; border-left: 12px solid #fff; border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; margin-left: 3px; }
#bar { flex: 1; padding: 14px 0 0; cursor: pointer; touch-action: none; position: relative; }
#bar .tr { height: 3px; background: rgba(255, 255, 255, .16); border-radius: 2px; position: relative; }
#bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; width: 0; }
#bar .head { position: absolute; top: -5px; left: 0; width: 13px; height: 13px; border-radius: 50%; background: #fff; margin-left: -6px; box-shadow: 0 0 0 5px rgba(239, 90, 60, .3); }
#bar .ch { position: relative; height: 26px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
#bar .ch span { position: absolute; top: 9px; white-space: nowrap; }
#bar .ch span::before { content: ""; position: absolute; left: 0; top: -12px; width: 1px; height: 9px; background: rgba(255, 255, 255, .3); }
#bar .ch span.on { color: var(--deep-ink); }
#speed, #skip, #restart { flex: none; border: 1.5px solid rgba(255, 255, 255, .22); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--deep-muted); }
#speed { min-width: 50px; }

/* ---------- picker ---------- */
#picker { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 26px; pointer-events: none; padding-bottom: 20px; }
#stage.picking #picker, #stage.flying #picker { display: flex; }
#stage.picking .ui, #stage.picking #paperMove { opacity: 0; pointer-events: none; }
#stage.picking #top .note { opacity: .8; }
#headline { text-align: center; }
#headline h2 { margin: 0; font-family: "Source Serif 4", serif; font-size: clamp(27px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; }
#headline p { margin: 10px 0 0; font-size: clamp(15px, 1.4vw, 19px); color: var(--deep-muted); }
#desk { display: flex; justify-content: center; align-items: flex-start; gap: clamp(12px, 4vw, 70px); width: 100%; }
.slot { width: clamp(96px, 19vw, 270px); position: relative; }
.thumb { all: unset; display: block; width: 100%; aspect-ratio: 520 / 680; position: relative; cursor: pointer; pointer-events: auto; transform-origin: 0 0; touch-action: manipulation; z-index: 1; }
.thumb .tilt { position: absolute; inset: 0; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); transform-origin: 50% 50%; }
#stage.picking .thumb:hover .tilt, #stage.picking .thumb:focus-visible .tilt { transform: rotate(0deg) translateY(-10px) scale(1.04) !important; }
#stage.picking .thumb.drag .tilt { transform: rotate(-2deg) scale(1.07) !important; transition-duration: .15s; }
.thumb.back { transition: translate .45s cubic-bezier(.2, .9, .3, 1.15); }
.thumb.drag { z-index: 3; }
.mini { position: absolute; left: 0; top: 0; width: 520px; height: 680px; transform-origin: 0 0; transform: scale(var(--ts, .5)); background: var(--paper); border-radius: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, .36); overflow: hidden; display: block; text-align: left; }
.mini.receipt { background: transparent; box-shadow: none; overflow: visible; }
.mini .paper { transform: none; box-shadow: none; position: static; display: block; }
.mini .paper.receipt { position: relative; }
.lab { margin: 18px 0 0; text-align: center; font-weight: 600; font-size: clamp(13px, 1.25vw, 17px); letter-spacing: .01em; }
.lab i { display: block; font-style: normal; font-weight: 400; font-size: .84em; color: var(--deep-muted); margin-top: 2px; }
.lab em { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--deep-muted); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 2px 9px; margin-top: 8px; }
#tray { display: flex; align-items: center; gap: 10px; border: 1.5px dashed rgba(229, 241, 75, .5); border-radius: 16px; padding: 14px 26px; color: #eef3c4; font-size: 15px; font-weight: 600; transition: transform .2s, background .2s, border-color .2s; }
#tray .p { display: none; }
#tray.hot { background: rgba(229, 241, 75, .18); border-color: var(--signal); transform: scale(1.06); }

/* ---------- question + closing ---------- */
#ask, #closing { position: absolute; z-index: 8; width: 400px; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 22px 22px 20px; box-shadow: 0 40px 90px rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transform-origin: 50% 0; }
#ask .k { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
#ask h3, #closing h3 { margin: 8px 0 6px; font-family: "Source Serif 4", serif; font-size: 23px; line-height: 1.2; font-weight: 600; }
#closing h3 { margin-top: 0; padding-right: 26px; }
#ask p, #closing p { margin: 0 0 15px; color: var(--muted); font-size: 15px; }
.opt { display: flex; gap: 8px; flex-wrap: wrap; }
.opt button { border: 1.5px solid #17221f; background: transparent; color: var(--ink); border-radius: 999px; padding: 9px 15px; font-weight: 600; font-size: 14.5px; transition: transform .12s, background .15s, color .15s; }
.opt button.pri, .opt button:hover, .opt button.picked { background: #17221f; color: var(--paper); }
.opt button:active { transform: scale(.95); }
#stage.asking #ask .opt button.pri { animation: ring2 1.6s ease-out infinite; }
@keyframes ring2 { 0% { box-shadow: 0 0 0 0 rgba(23, 34, 31, .35); } 100% { box-shadow: 0 0 0 12px rgba(23, 34, 31, 0); } }
#closing { visibility: hidden; transition: opacity .3s, transform .4s cubic-bezier(.2, 1.3, .4, 1), visibility 0s .4s; transform: translateY(18px) scale(.95); }
#closing.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
#closing .x { all: unset; cursor: pointer; position: absolute; right: 14px; top: 10px; font-size: 24px; line-height: 1; color: var(--muted); padding: 4px 6px; }
#closing .cta { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; border-radius: 999px; padding: 11px 20px; font-size: 15.5px; }
#closing .cta:hover { background: var(--accent-hover); }
#closing .alt { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; }
#closing .alt button { all: unset; cursor: pointer; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--ink); line-height: 1.3; }

/* ---------- flight layer ---------- */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
#fx svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#fx path { fill: none; stroke: rgba(229, 241, 75, .75); stroke-width: 2; stroke-linecap: round; opacity: 0; }
.chip { position: absolute; left: 0; top: 0; background: var(--signal); color: #17221f; font-weight: 700; font-size: 15px; border-radius: 8px; padding: 4px 10px; white-space: nowrap; box-shadow: 0 12px 28px rgba(0, 0, 0, .35); opacity: 0; will-change: transform; }
.cur { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform; }
.cur svg { display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .4)); position: static; width: 22px; height: 24px; }
.cur span { position: absolute; left: 17px; top: 19px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--accent); color: #fff; }

.after { width: min(760px, calc(100% - 48px)); margin: 26px auto 60px; color: var(--deep-muted); font-size: 15px; text-align: center; }
.after p { margin: 0 0 10px; }

/* ---------- vertical stage (phones, narrow windows) ---------- */
@media (max-width: 1039px) {
  :root { --avail: calc(100svh - 48px); }
  header.site { width: calc(100% - 32px); height: 48px; }
  header.site .brand { font-size: 18px; }
  #stage { display: flex; flex-direction: column; align-items: stretch; width: min(520px, calc(100% - 28px)); row-gap: 10px; padding-top: 0; }
  #dupBanner { top: 8px; left: 10px; right: 10px; }
  #top h1 { font-size: 13px; white-space: nowrap; } #top h1 span { display: none; } #top .note { font-size: 11px; white-space: nowrap; }
  #paperWrap { width: 100%; min-width: 0; aspect-ratio: auto; height: clamp(170px, calc(var(--avail) - 548px - var(--extra, 0px)), 300px); }
  #paperWin { overflow: hidden; border-radius: 12px; box-shadow: 0 20px 44px rgba(0, 0, 0, .4); background: var(--paper); }
  #stage[data-sc="receipt"] #paperWin { background: #1c3a33; }
  .paper.receipt { filter: none; }
  #stage.done #paperCam { transition: transform .5s cubic-bezier(.3, .8, .3, 1); }
  .paper { transform: none; border-radius: 0; box-shadow: none; }
  #railSlot { min-height: 0; height: 86px; }
  #rail .hd { margin: 0; position: absolute; right: 0; top: 2px; width: auto; font-size: 10.5px; z-index: 1; pointer-events: auto; cursor: pointer; }
  #rail .hd .pulse, #rail .hd #railState { display: none; }
  #rail .hd .more { display: inline; border-bottom: 1px solid rgba(255, 255, 255, .4); padding-bottom: 1px; }
  #say { font-size: 16.5px; min-height: 0; height: 43px; margin: 0 0 6px; padding-right: 74px; overflow: hidden; display: flex; align-items: flex-end; }
  .card, .pill { margin: 0; padding: 8px 12px; height: 37px; }
  .card { display: flex; align-items: center; gap: 10px; }
  #cards > :not(.now) { display: none; }
  .card .n { width: auto !important; flex: none; }
  .card .res { flex: 1; min-width: 0; padding: 0; margin: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card .tw, .card .ms { display: none; }
  .pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* "All steps" sheet */
  #rail.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 76svh; overflow: auto; background: #10231f; border-radius: 20px 20px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -30px 80px rgba(0, 0, 0, .6); }
  #rail.sheet .hd { position: static; margin: 0 0 10px; width: 100%; justify-content: flex-end; }
  #rail.sheet #say { display: none; }
  #rail.sheet #cards > * { display: block; height: auto; margin-bottom: 8px; opacity: 1 !important; transform: none !important; }
  #rail.sheet .card .n { width: 100% !important; }
  #rail.sheet .card .ms { display: inline; }
  #rail.sheet #cards > .pending { display: none; }
  #rail.sheet .card .res { display: block; padding-left: 25px; margin-top: 4px; white-space: normal; }
  #rail.sheet .card pre { display: block; }
  #bill { max-width: none; padding: 14px 16px 12px; border-radius: 16px; }
  #bill .bh { margin-bottom: 9px; } #bill .bh b { font-size: 18px; } #bill .bh small { display: none; }
  #status { font-size: 11px; padding: 5px 10px; }
  .fld { gap: 6px 12px; margin-bottom: 8px; grid-template-columns: 1.5fr 1fr 1fr; }
  .f.wide { grid-column: auto; }
  .f i { font-size: 9.5px; margin-bottom: 1px; }
  .v { font-size: 13.5px; min-height: 21px; } .v .sk { top: 5px; width: 70%; }
  .ln { padding: 3px 0; min-height: 41px; }
  .locw { height: 20px; } .loc { height: 19px; font-size: 10.5px; } .loc.set select { height: 19px; } .loc.q { top: 0; }
  #stage.done .ln { padding: 5px 0; min-height: 49px; }
  #stage.done .locw { height: 26px; } #stage.done .loc { height: 22px; font-size: 11.5px; } #stage.done .loc.set select { height: 22px; } .ln .v { font-size: 13.5px; } .ln .amt { font-size: 14.5px; }
  .sum { padding-top: 8px; } .sum b { font-size: 21px; }
  #math { font-size: 12px; margin-top: 3px; }
  .ft { margin-top: 8px; min-height: 38px; } #approve { padding: 9px 18px; font-size: 14.5px; } #clip { font-size: 11.5px; padding: 5px 8px; }
  #stamp { bottom: 14px; right: 16px; font-size: 16px; }
  #ctl { gap: 12px; padding: 0 0 6px; }
  #play { width: 34px; height: 34px; }
  #bar { padding: 0; } #bar .ch { display: none; }
  #speed, #restart { display: none; }
  #skip { padding: 6px 12px; font-size: 12px; }
  #picker { gap: 20px; justify-content: flex-start; padding-top: 54px; }
  #tray { padding: 11px 20px; font-size: 14px; border-style: solid; border-color: rgba(229, 241, 75, .3); }
  #tray .d { display: none; } #tray .p { display: inline; }
  #ask, #closing { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto !important; width: auto; border-radius: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); transform-origin: 50% 100%; z-index: 30; }
  #ask h3, #closing h3 { font-size: 20px; }
  .chip { font-size: 12.5px; padding: 3px 8px; }
  .cur span { font-size: 11px; }
  .after { margin-top: 18px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #fx, #beam { display: none !important; }
  .pulse, #approve, .opt button { animation: none !important; }
  .thumb .tilt, #closing, #stamp { transition: none !important; }
}

.ln .amt, .sum b { display: inline-block; }
