/* SIGN-OFF — the release desk (web/js/work/signoff.js). Lives in the desk's 720×396 monitor area. Prefix so-.
   Look: the desk's dark purple glass for the chrome, real-feeling PAPER for the documents (Papers, Please on a
   purple cutting mat). Reading text ≥ 18 px (scaled by --k, the text-size setting), tap targets ≥ 46–48 px.
   Uses the desk tokens (--sd-*) with fallbacks so the lab page works too. No backdrop-filter (CSS3D).
   Transient motion is WAAPI from the JS (never fill-forwards); CSS loops stop under .is-calm (reduce motion). */

.so-root {
  --ink: var(--sd-ink, #f8f5ff);
  --ink2: var(--sd-ink2, #ddd4f7);
  --ink3: var(--sd-ink3, #b1a6d8);
  --line: var(--sd-line, rgba(226, 214, 255, .15));
  --flag: var(--sd-flag, #ff4f74);
  --ok: var(--sd-ok, #3ddc97);
  --warn: var(--sd-warn, #ffc24b);
  --grad: var(--sd-grad, linear-gradient(100deg, #7c5cff 0%, #c04af2 52%, #ff5c9a 100%));
  --font: var(--sd-font, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --mono: var(--sd-mono, ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace);
  --hand: "Bradley Hand", "Noteworthy", "Marker Felt", "Segoe Print", "Comic Sans MS", cursive;
  --kk: var(--k, 1);
  --paper: #f7f1e3;
  --pink: #231a35;          /* paper ink */
  --pink2: #5e5373;         /* paper ink, secondary */
  --string: #c8102e;
  --binder: #b4234f;
  position: absolute; inset: 0; overflow: hidden;
  font: 400 18px/1.25 var(--font); color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.so-root *, .so-root *::before, .so-root *::after { box-sizing: border-box; }
.so-root [hidden] { display: none !important; }
.so-root [role="button"] { cursor: pointer; }

/* the desk mat: purple cutting mat under a warm desk lamp */
.so-mat { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 70% at 55% -8%, rgba(255, 214, 160, .16), transparent 70%),
    radial-gradient(70% 90% at 0% 100%, rgba(124, 92, 255, .22), transparent 62%),
    radial-gradient(50% 60% at 100% 100%, rgba(255, 92, 154, .12), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 24px),
    linear-gradient(160deg, #1d1438 0%, #150e29 60%, #1b1031 100%); }

/* ───────────────────────── the rulebook (pinned left) */
.so-book { position: absolute; left: 6px; top: 6px; bottom: 6px; width: 206px; z-index: 2;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 5px 12px 12px 5px; background: #f1ebff; color: var(--pink);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .7); }
.so-book-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 11px; z-index: 2;
  background: repeating-linear-gradient(180deg, transparent 0 26px, rgba(0, 0, 0, .25) 26px 30px), linear-gradient(90deg, #7d1734, var(--binder) 55%, #7d1734); }
.so-book-h { flex: none; margin-left: 11px; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 8px;
  background: linear-gradient(180deg, #c42a5a, #9e1c45); color: #fff; }
.so-book-ic { font-size: 22px; line-height: 1; }
.so-book-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.so-book-t { font: 900 16px/1 var(--font); letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-book-d { font: 650 14px/1 var(--font); opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-z { flex: none; font-size: 15px; line-height: 1; opacity: .75; }
.so-book-h.is-press { filter: brightness(1.15); }
.so-book-l { flex: 1; min-height: 0; margin-left: 11px; overflow-y: auto; overflow-x: hidden; padding: 6px 6px 14px 6px;
  touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(36, 26, 54, .3) transparent;
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(80, 60, 140, .07) 27px 28px); }
.so-book::after { content: '▾ more rules'; position: absolute; left: 11px; right: 0; bottom: 0; height: 38px; z-index: 3; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; font: 800 13px/1 var(--font); letter-spacing: .04em; color: var(--binder);
  background: linear-gradient(180deg, rgba(241, 235, 255, 0), rgba(241, 235, 255, .96) 62%); opacity: 0; transition: opacity .2s; }
.so-book.has-more::after { opacity: 1; }
.so-rule { position: relative; min-height: 46px; margin: 0 0 5px; padding: 6px 8px 6px 9px; border-radius: 8px;
  font-size: calc(18px * var(--kk)); line-height: 1.2; color: var(--pink);
  background: rgba(255, 255, 255, .72); border: 1px solid rgba(36, 26, 54, .12); }
.so-rule > b { color: var(--binder); font-weight: 900; }
.so-rule.is-press { background: #ffe9ee; }
.so-rule-0 { min-height: 0; background: transparent; border: none; padding: 2px 4px 6px; font-style: italic; color: var(--pink2); }
.so-rule.is-new { background: #fff6c9; border-color: #f0c64a; }
.so-new { position: absolute; top: -5px; right: -3px; padding: 2px 5px; border-radius: 4px; transform: rotate(7deg);
  font: 900 12px/1 var(--font); font-style: normal; letter-spacing: .06em; color: #3b2a00; background: #ffd23f;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25); animation: soNew 1.8s ease-in-out infinite; }
@keyframes soNew { 50% { transform: rotate(-4deg) scale(1.08); } }
.so-rule-by { font-style: normal; margin-left: 3px; }
.so-rule.is-struck { background: transparent; border-style: dashed; color: var(--pink2); }
.so-rule.is-struck s { text-decoration-color: var(--string); text-decoration-thickness: 2px; }
.so-rule-note { display: block; margin-top: 3px; font: 700 calc(17px * var(--kk))/1.1 var(--hand); color: var(--string); font-style: normal; transform: rotate(-1.5deg); }
.so-rule.is-pen { font-family: var(--hand); font-weight: 700; color: #1d3fb3; background: rgba(255, 255, 255, .4); border: 1.5px dashed rgba(29, 63, 179, .5); }
.so-rule.is-model { border-color: rgba(124, 92, 255, .5); background: #efe9ff; }
.so-rule.is-pin { background: #ffe1e6; box-shadow: inset 0 0 0 2.5px var(--string); }
.so-rule.is-linked { background: #ffd6de; border-color: var(--string); }
.so-rule.is-answer { background: #fff1bf; box-shadow: inset 0 0 0 2.5px #e0a800; }
.so-rule.is-pin::after, .so-f.is-pin::after { content: ''; position: absolute; right: -4px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8aa0 0 18%, #e11d48 30%, #8f0f2b 100%); box-shadow: 0 2px 3px rgba(0, 0, 0, .4); animation: soPin 1s ease-in-out infinite; }
@keyframes soPin { 50% { transform: scale(1.25); } }

/* ───────────────────────── the desk: doc tabs + two paper slots */
.so-desk { position: absolute; left: 218px; top: 6px; bottom: 6px; width: 390px; z-index: 1; }
.so-tabs { position: absolute; left: 0; right: 0; top: 0; height: 46px; display: flex; align-items: flex-end; gap: 4px; }
.so-tab { position: relative; flex: 1 1 0; min-width: 0; height: 40px; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 5px; border-radius: 10px 10px 0 0; border: 1px solid var(--line); border-bottom: none;
  background: rgba(255, 255, 255, .08); color: var(--ink2); font: 750 17px/1 var(--font);
  transition: height .15s, background-color .15s; }
.so-tab-i { font-size: 18px; line-height: 1; flex: none; }
.so-tab-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-tab.is-on { height: 46px; background: var(--paper); color: var(--pink); border-color: transparent; box-shadow: 0 -3px 10px rgba(0, 0, 0, .25); }
.so-tab.is-press { filter: brightness(1.2); }
.so-tab.has-link::after, .so-tab.has-pin::after { content: ''; position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--string); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.so-tab.has-pin::after { animation: soPin 1s ease-in-out infinite; }

.so-docs { position: absolute; left: 0; right: 0; top: 46px; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.so-docs.is-zoom { grid-template-columns: 1fr; }
.so-docs.is-zoom .so-slot-b { display: none; }
.so-docs.is-zoom .so-f { font-size: calc(20px * var(--kk)); }
.so-slot { position: relative; min-width: 0; min-height: 0; }
.so-slot-a .so-doc { border-top-left-radius: 0; }

/* paper */
.so-doc { --band: #4338ca; position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 3px 3px 5px 5px; color: var(--pink);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, #faf5e9, var(--paper) 40%, #f1e9d6);
  box-shadow: 0 12px 22px rgba(0, 0, 0, .5), 0 2px 0 rgba(0, 0, 0, .08), inset 0 0 0 1px rgba(80, 60, 30, .08);
  transform: rotate(var(--tilt, 0deg)); }
.so-doc-h { flex: none; height: 34px; display: flex; align-items: center; gap: 5px; padding: 0 7px 0 9px;
  background: var(--band); color: #fff; font: 850 14px/1 var(--font); letter-spacing: .03em; }
.so-doc-h.is-press { filter: brightness(1.2); }
.so-doc-i { font-size: 17px; line-height: 1; flex: none; letter-spacing: 0; }
.so-doc-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-part { position: absolute; right: 8px; bottom: 10px; z-index: 3; padding: 4px 7px; border-radius: 4px; transform: rotate(5deg); pointer-events: none;
  font: 900 13px/1 var(--font); font-style: normal; letter-spacing: .05em; color: #3b2a00; background: #ffd23f; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); }
.so-doc-b { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 4px 10px;
  touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(36, 26, 54, .25) transparent; }
.so-f { position: relative; display: flex; align-items: center; gap: 4px; min-height: 46px; padding: 5px 7px; border-radius: 6px;
  font-size: calc(18px * var(--kk)); line-height: 1.2; overflow-wrap: anywhere;
  border-bottom: 1px dashed rgba(36, 26, 54, .15); transition: background-color .12s; }
.so-f:last-child { border-bottom: none; }
.so-ft { min-width: 0; flex: 1; }
.so-k { color: var(--pink2); font-weight: 600; }
.so-v { color: var(--pink); font-weight: 760; }
.so-f.is-press { background: rgba(36, 26, 54, .08); }
.so-f.is-plain .so-v { font-weight: 650; }
.so-f.is-sig .so-v { font-family: var(--hand); font-weight: 700; font-size: 1.1em; color: #1f3fae; }
.so-f.is-big .so-v { font-weight: 900; }
.so-f.is-mono .so-v { font-family: var(--mono); font-weight: 650; }
.so-f.is-faint .so-v { color: rgba(36, 26, 54, .46); font-style: italic; font-weight: 600; }
.so-f.is-photo { justify-content: center; min-height: 70px; font-size: 44px; }
.so-f.is-photo .so-v { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 6px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 2px rgba(232, 199, 111, .6); color: #ffe9a8; }
.so-ck { flex: none; font-style: normal; font-size: 22px; line-height: 1; color: #12813a; }
.so-f.is-no .so-ck { color: var(--string); }
.so-redact { display: inline-block; padding: 0 3px; border-radius: 2px; background: #121018; color: #121018; letter-spacing: -1px; }
.so-f.is-pin { background: #ffe1e6; box-shadow: inset 0 0 0 2.5px var(--string); }
.so-f.is-linked { background: linear-gradient(180deg, transparent 10%, rgba(255, 70, 105, .26) 10%, rgba(255, 70, 105, .26) 90%, transparent 90%); }
.so-f.is-linked .so-v { text-decoration: underline wavy rgba(200, 16, 46, .7); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.so-f.is-answer { background: #fff1bf; box-shadow: inset 0 0 0 2.5px #e0a800; }

/* paper by type */
.so-t-request  { --band: #4338ca; }
.so-t-legal    { --band: #0f766e; }
.so-t-eval     { --band: #15803d; background: repeating-linear-gradient(0deg, rgba(21, 128, 61, .07) 0 1px, transparent 1px 16px), repeating-linear-gradient(90deg, rgba(21, 128, 61, .07) 0 1px, transparent 1px 16px), linear-gradient(180deg, #f6fbf3, #edf5e8); }
.so-t-card     { --band: #7c3aed; }
.so-t-press    { --band: #16121f; }
.so-t-press .so-v { font-family: Georgia, "Times New Roman", serif; }
.so-t-press .so-f.is-big .so-v { font-size: 1.08em; line-height: 1.12; }
.so-t-note     { --band: transparent; background: linear-gradient(180deg, #fff1a6, #fde68a); }
.so-t-note .so-doc-h { color: #7a5800; }
.so-t-note .so-f { border: none; }
.so-t-note .so-v { font-family: var(--hand); font-weight: 700; font-size: 1.12em; color: #2b2206; }
.so-t-perms    { --band: #b45309; }
.so-t-contract { --band: #1e3a8a; background: linear-gradient(180deg, #fbf8f0, #f2ecdc); }
.so-t-log      { --band: #1c2742; background: #0c1220; color: #9ef0b5; }
.so-t-log .so-v, .so-t-log .so-k { color: #9ef0b5; }
.so-t-log .so-f { border-bottom-color: rgba(158, 240, 181, .14); }
.so-t-log .so-f.is-pin, .so-t-log .so-f.is-answer { background: #2b1620; }
.so-t-invoice  { --band: #be185d; background: linear-gradient(180deg, #fff1f7, #fbe0ec); }
.so-t-receipt  { --band: #57534e; background: #fbfbf7; }
.so-t-receipt .so-v { font-family: var(--mono); font-weight: 700; }
.so-t-receipt .so-doc-b { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 10px), transparent calc(100% - 10px)), conic-gradient(from -45deg at 50% 100%, #000 90deg, transparent 0) 0 100% / 14px 10px repeat-x;
  mask-image: linear-gradient(180deg, #000 calc(100% - 10px), transparent calc(100% - 10px)), conic-gradient(from -45deg at 50% 100%, #000 90deg, transparent 0) 0 100% / 14px 10px repeat-x; }
.so-t-screen   { --band: #2b2540; background: #110d20; border-radius: 16px; box-shadow: 0 12px 22px rgba(0, 0, 0, .5), inset 0 0 0 3px #2f2948; }
.so-t-screen .so-v { color: #f3efff; }
.so-t-screen .so-f { border-bottom-color: rgba(255, 255, 255, .1); }
.so-t-screen .so-f.is-big .so-v { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.so-t-screen .so-f.is-pin, .so-t-screen .so-f.is-answer { background: #2b1630; }
.so-t-sample   { --band: #4f46e5; background: linear-gradient(180deg, #f1f2ff, #e6e8fb); }
.so-t-sample .so-f { margin: 4px 2px; border: none; border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.so-t-post     { --band: #0b7fc0; background: #fff; }
.so-t-post .so-f.is-big .so-v { letter-spacing: .01em; }
.so-t-facts    { --band: #9a3412; }
.so-t-approvals{ --band: #334155; }
.so-t-approvals .so-v { font-family: var(--hand); font-weight: 700; color: #1f3fae; }
.so-t-spec     { --band: #475569; background: repeating-linear-gradient(0deg, rgba(71, 85, 105, .07) 0 1px, transparent 1px 16px), linear-gradient(180deg, #f6f7fa, #e9ecf2); }
.so-t-permit   { --band: #a16207; background: linear-gradient(180deg, #fff9e8, #f7ecd0); }
.so-t-passport { --band: #3a0a12; background: linear-gradient(160deg, #861f2c, #5a1222); color: #ffe9a8; }
.so-t-passport .so-k { color: #e8c76f; }
.so-t-passport .so-v { color: #fff6dc; }
.so-t-passport .so-f { border-bottom-color: rgba(232, 199, 111, .22); }
.so-t-passport .so-f.is-pin, .so-t-passport .so-f.is-answer { background: #4a0f1c; }
.so-t-passport::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .35;
  background: linear-gradient(115deg, transparent 30%, rgba(120, 255, 230, .5) 42%, rgba(255, 120, 230, .45) 50%, rgba(255, 240, 120, .4) 58%, transparent 70%);
  background-size: 260% 100%; animation: soHolo 4.5s ease-in-out infinite; }
@keyframes soHolo { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0% 0; } }
.so-t-resume   { --band: #0e7490; }
.so-t-letter   { --band: #6b21a8; background: linear-gradient(180deg, #fcf8ff, #f1e9fb); }
.so-t-memo     { --band: #374151; }

/* the stamp impression */
.so-ink { position: absolute; left: 50%; top: 44%; z-index: 4; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--r, -6deg));
  padding: 7px 14px 6px; border: 5px double currentColor; border-radius: 9px;
  font: 900 27px/1 var(--font); letter-spacing: .1em; white-space: nowrap; opacity: .92; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(circle at 20% 30%, transparent 0 2px, #000 3px), radial-gradient(circle at 70% 80%, #000 60%, rgba(0, 0, 0, .7) 100%);
  -webkit-mask-size: 9px 9px, 100% 100%; -webkit-mask-composite: source-in;
  mask-image: radial-gradient(circle at 20% 30%, transparent 0 1.5px, #000 2.5px), radial-gradient(circle at 70% 80%, #000 60%, rgba(0, 0, 0, .7) 100%);
  mask-size: 9px 9px, 100% 100%; mask-composite: intersect; }
.so-ink.is-ship { color: #108a3a; }
.so-ink.is-block { color: #d3173c; }

/* empty tray */
.so-empty { position: absolute; left: 0; right: 0; top: 46px; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 18px; text-align: center; border-radius: 14px; border: 2px dashed rgba(255, 255, 255, .14); background: rgba(10, 6, 24, .25); }
.so-empty-ic { font-size: 56px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.so-empty-t { font: 850 24px/1.1 var(--font); color: var(--ink); }
.so-empty-s { font-size: calc(18px * var(--kk)); color: var(--ink2); max-width: 320px; }
.so-empty-new { margin-top: 6px; min-height: 48px; display: grid; place-items: center; padding: 0 16px; border-radius: 12px;
  font: 800 18px/1.1 var(--font); color: #3b2a00; background: #ffd23f; box-shadow: 0 4px 0 #b88f10, 0 8px 16px rgba(0, 0, 0, .3); }

/* ───────────────────────── the side: boss patience · stamps · string */
.so-side { position: absolute; right: 6px; top: 6px; bottom: 6px; width: 100px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.so-boss { position: relative; flex: none; height: 58px; display: flex; align-items: center; gap: 6px; padding: 0 7px;
  border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.so-boss-f { flex: none; font-size: 28px; line-height: 1; }
.so-boss-m { flex: 1; min-width: 0; }
.so-boss-n { display: block; font: 800 15px/1 var(--font); color: var(--ink); white-space: nowrap; }
.so-boss-bar { display: block; height: 8px; margin-top: 7px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .14); }
.so-boss-fill { display: block; height: 100%; background: var(--ok); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.2, .9, .3, 1), background-color .3s; }
.so-boss.is-mid .so-boss-fill { background: var(--warn); }
.so-boss.is-low { border-color: rgba(255, 79, 116, .6); background: rgba(255, 79, 116, .14); }
.so-boss.is-low .so-boss-fill { background: var(--flag); }
.so-boss.is-low .so-boss-f { animation: soShake .5s ease-in-out infinite; }
.so-boss.is-idle .so-boss-bar { opacity: .3; }
@keyframes soShake { 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
.so-boss-tray { position: absolute; top: -7px; right: -5px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
  font: 800 13px/1 var(--font); color: #fff; background: var(--grad); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.so-boss.has-cash::after { content: '💵'; position: absolute; left: -7px; bottom: -8px; font-size: 18px; transform: rotate(-12deg); }
.so-root.is-mgr1 .so-boss { background: rgba(255, 79, 116, .07); }
.so-root.is-mgr1 .so-boss-n { font-family: var(--mono); letter-spacing: .02em; }

.so-stamp { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 7px;
  transition: transform .08s, opacity .2s, filter .2s; }
.so-stamp-knob { display: block; width: 46px; height: 32px; border-radius: 50% 50% 42% 42%;
  background: radial-gradient(circle at 34% 28%, #c4977a 0 12%, #8a5a3c 45%, #4e2f1d 100%); box-shadow: 0 3px 4px rgba(0, 0, 0, .4), inset 0 -3px 0 rgba(0, 0, 0, .25); }
.so-stamp-neck { display: block; width: 20px; height: 14px; background: linear-gradient(90deg, #3a2618, #74503a 45%, #3a2618); }
.so-stamp-base { display: grid; place-items: center; width: 96px; height: 62px; border-radius: 10px; color: #fff;
  background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: 0 6px 0 var(--c3), 0 12px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }
.so-stamp-base b { font: 900 25px/1 var(--font); letter-spacing: .06em; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.so-stamp-ship  { --c1: #36c96a; --c2: #15803d; --c3: #0c5a2a; }
.so-stamp-block { --c1: #f2486a; --c2: #c81e3a; --c3: #851027; }
.so-stamp.is-press { transform: translateY(5px); }
.so-stamp.is-press .so-stamp-base { box-shadow: 0 1px 0 var(--c3), 0 4px 8px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .35); }
.so-stamp.is-off { opacity: .38; filter: saturate(.35); }
.so-stamp.is-lifted { opacity: .18; }
.so-fly { position: absolute; z-index: 22; pointer-events: none; opacity: 1; filter: drop-shadow(0 16px 14px rgba(0, 0, 0, .45)); }

.so-spool { flex: none; height: 48px; display: flex; align-items: center; justify-content: center; gap: 5px; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.so-spool-i { font-size: 20px; line-height: 1; }
.so-spool-p { display: flex; gap: 3px; }
.so-spool-p i { width: 8px; height: 16px; border-radius: 3px; background: rgba(255, 255, 255, .15); }
.so-spool-p i.on { background: linear-gradient(90deg, #8f0f2b, #e11d48, #8f0f2b); box-shadow: 0 0 6px rgba(225, 29, 72, .5); }
.so-spool-n { font: 800 17px/1 var(--font); color: var(--ink2); font-variant-numeric: tabular-nums; }
.so-spool.is-out { border-color: rgba(255, 79, 116, .5); }
.so-spool.is-out .so-spool-n { color: var(--flag); }

/* ───────────────────────── red string (SVG over everything but the overlays) */
.so-strings { position: absolute; left: 0; top: 0; width: 720px; height: 396px; z-index: 12; pointer-events: none; overflow: visible; }
.so-str-sh { fill: none; stroke: rgba(0, 0, 0, .38); stroke-width: 5; stroke-linecap: round; transform: translate(1.5px, 3px); }
.so-str-l  { fill: none; stroke: var(--string); stroke-width: 3.6; stroke-linecap: round; }
.so-str-hi { fill: none; stroke: rgba(255, 160, 175, .8); stroke-width: 1; stroke-linecap: round; transform: translate(-.6px, -.9px); }
.so-pinhead { fill: #e11d48; stroke: #7f1027; stroke-width: 1.6; }
.so-pinshine { fill: rgba(255, 255, 255, .85); }
.so-str.is-nope .so-str-l { stroke: #8f86a6; }
.so-str.is-nope .so-pinhead { fill: #9a92b0; stroke: #4c4560; }
.so-str.is-answer .so-str-l { stroke: #f5b800; stroke-dasharray: 9 6; animation: soAnts .8s linear infinite; }
.so-str.is-answer .so-str-hi { display: none; }
.so-str.is-answer .so-pinhead { fill: #f5b800; stroke: #8a6500; }
@keyframes soAnts { to { stroke-dashoffset: -30; } }
.so-tag { position: absolute; z-index: 26; pointer-events: none; padding: 6px 10px 5px; border: 3px solid currentColor; border-radius: 6px;
  font: 900 18px/1 var(--font); letter-spacing: .09em; white-space: nowrap; background: rgba(255, 252, 245, .95); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
.so-tag.is-ok { color: var(--string); }
.so-tag.is-nope { color: #6b6280; }

/* ───────────────────────── speech: link feedback (bottom of the desk) and the boss */
.so-say { position: absolute; left: 413px; bottom: 12px; z-index: 24; width: 376px; transform: translateX(-50%); pointer-events: none;
  padding: 9px 13px; border-radius: 13px; font: 700 calc(18px * var(--kk))/1.25 var(--font); color: var(--ink);
  background: rgba(19, 13, 36, .95); border: 1.5px solid var(--line); box-shadow: 0 10px 24px rgba(0, 0, 0, .5); }
.so-say.is-good { background: rgba(48, 10, 24, .96); border-color: #ff5c7a; color: #ffe3e9; }
.so-say.is-meh  { color: var(--ink2); }
.so-say.is-bad  { border-color: var(--flag); }
.so-say.is-warn { border-color: var(--warn); color: #fff0cf; }
.so-boss-say { position: absolute; right: 116px; top: 10px; z-index: 25; max-width: 260px; pointer-events: none;
  padding: 9px 13px; border-radius: 14px 14px 4px 14px; font: 750 calc(18px * var(--kk))/1.2 var(--font); color: #241a36; background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45); }
.so-boss-say::after { content: ''; position: absolute; right: -8px; top: 14px; border: 8px solid transparent; border-left-color: #fff; border-right: 0; }
.so-root.is-mgr1 .so-boss-say { font-family: var(--mono); background: #e9fff3; color: #0b2b1a; }
.so-root.is-mgr1 .so-boss-say::after { border-left-color: #e9fff3; }

/* ───────────────────────── Brax's sticky note (stuck on the BLOCK stamp) */
.so-bribe { position: absolute; right: 1px; top: 196px; z-index: 15; width: 140px; padding: 10px 8px 8px;
  transform: rotate(-6deg); color: #3a2d00; font-family: var(--hand);
  background: linear-gradient(180deg, #fff27a, #ffe14a); box-shadow: 0 12px 20px rgba(0, 0, 0, .45), inset 0 -10px 18px rgba(200, 150, 0, .18); }
.so-bribe::before { content: ''; position: absolute; left: 50%; top: -9px; width: 62px; height: 20px; margin-left: -31px; transform: rotate(3deg);
  background: rgba(255, 255, 255, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.so-bribe-t { font-size: 20px; font-weight: 700; line-height: 1.12; }
.so-bribe-by { margin-top: 2px; text-align: right; font-size: 18px; font-weight: 700; }
.so-bribe-row { display: flex; gap: 5px; margin-top: 6px; }
.so-bribe-b { height: 48px; display: grid; place-items: center; border-radius: 9px; font: 850 17px/1 var(--font); }
.so-bribe-take { flex: 1; color: #fff; background: linear-gradient(180deg, #2fb862, #15803d); box-shadow: 0 3px 0 #0c5a2a; }
.so-bribe-tear { flex: none; width: 42px; color: #3a2d00; background: rgba(0, 0, 0, .12); font-size: 20px; }
.so-bribe-b.is-press { transform: translateY(2px); }

/* ───────────────────────── result card (over the desk + stamps; the rulebook stays visible) */
.so-res { position: absolute; left: 218px; top: 6px; right: 6px; bottom: 6px; z-index: 30; display: grid; place-items: center;
  border-radius: 14px; background: rgba(10, 6, 22, .5); }
.so-res-card { width: 100%; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 7px;
  padding: 12px 15px 12px; border-radius: 16px; background: linear-gradient(180deg, #2a1f4d, #1a1233); border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1); touch-action: pan-y; }
.so-res-card.is-good { border-color: rgba(61, 220, 151, .55); }
.so-res-card.is-bad  { border-color: rgba(255, 79, 116, .65); background: linear-gradient(180deg, #3a1530, #1d1028); }
.so-res-card.is-meh  { border-color: rgba(255, 194, 75, .55); }
.so-res-top { display: flex; align-items: center; gap: 10px; }
.so-res-v { flex: 1; min-width: 0; font: 900 28px/1 var(--font); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-good .so-res-v { color: var(--ok); }
.is-bad .so-res-v { color: var(--flag); }
.is-meh .so-res-v { color: var(--warn); }
.so-res-stars { flex: none; font-size: 22px; letter-spacing: 1px; color: #ffd166; }
.so-res-stars i { font-style: normal; color: rgba(255, 255, 255, .18); }
.so-res-sub { font: 800 calc(20px * var(--kk))/1.15 var(--font); color: var(--ink); }
.so-res-why { font-size: calc(18px * var(--kk)); line-height: 1.25; color: var(--ink2); }
.so-res-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.so-chip { height: 30px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 15px; font: 750 16px/1 var(--font);
  color: var(--ink3); background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .2); }
.so-chip.is-on { color: #eafff4; background: rgba(61, 220, 151, .16); border: 1px solid rgba(61, 220, 151, .45); }
.so-chip.is-bad { color: #ffe1e8; background: rgba(255, 79, 116, .18); border: 1px solid rgba(255, 79, 116, .5); }
.so-res-news { padding: 7px 10px; border-radius: 10px; font-size: calc(18px * var(--kk)); line-height: 1.22; color: #ffe1e8;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 4px), rgba(255, 79, 116, .14); border-left: 4px solid var(--flag); }
.so-res-news b { color: #fff; }
.so-res-bribe { font-size: calc(18px * var(--kk)); line-height: 1.22; color: #fff0c2; }
.so-res-quip { font-size: calc(18px * var(--kk)); line-height: 1.22; font-style: italic; color: var(--ink2); }
.so-res-quip b { font-style: normal; color: var(--ink); }
.so-res-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.so-btn { min-height: 50px; min-width: 112px; padding: 0 18px; display: inline-grid; place-items: center; border-radius: 13px;
  font: 850 19px/1 var(--font); color: var(--ink); background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.so-btn.is-press { transform: translateY(2px); filter: brightness(1.15); }
.so-btn-go { color: #fff; background: var(--grad); border: none; box-shadow: 0 6px 16px rgba(192, 74, 242, .35); }
.so-float-next { position: absolute; right: 8px; bottom: 8px; z-index: 31; min-width: 98px; padding: 0 10px; }

/* ───────────────────────── the full rulebook (zoomed) */
.so-bookz { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(8, 5, 18, .6); }
.so-bookz-p { width: 704px; height: 380px; display: flex; flex-direction: column; overflow: hidden; border-radius: 6px 14px 14px 6px;
  color: var(--pink); background: #f1ebff; border-left: 14px solid var(--binder); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.so-bookz-h { flex: none; height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px;
  background: linear-gradient(180deg, #c42a5a, #9e1c45); color: #fff; font: 900 20px/1 var(--font); letter-spacing: .04em; }
.so-bookz-h > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-bookz-x { min-width: 48px; min-height: 46px; padding: 0; color: #fff; background: rgba(0, 0, 0, .2); border-color: rgba(255, 255, 255, .25); }
.so-bookz-n { flex: none; padding: 7px 14px 3px; font: italic 600 17px/1.2 var(--font); color: var(--pink2); }
.so-bookz-l { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 14px 14px; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 7px 12px;
  touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(36, 26, 54, .3) transparent; }
.so-zr { margin: 0; padding: 7px 10px; min-height: 46px; border-radius: 8px; font-size: calc(18px * var(--kk)); line-height: 1.22;
  background: rgba(255, 255, 255, .75); border: 1px solid rgba(36, 26, 54, .12); }
.so-zr > b { color: var(--binder); font-weight: 900; }
.so-zr.is-press { background: #ffe9ee; }
.so-zr-0 { font-style: italic; background: transparent; }
.so-zr.is-new { background: #fff6c9; border-color: #f0c64a; }
.so-zr.is-struck { opacity: .7; background: transparent; border-style: dashed; }
.so-zr.is-struck s { text-decoration-color: var(--string); text-decoration-thickness: 2px; }
.so-zr.is-struck em { font-family: var(--hand); color: var(--string); font-style: normal; }
.so-zr.is-pen { font-family: var(--hand); font-weight: 700; color: #1d3fb3; }

/* ───────────────────────── fx layer, ghosts, the fight */
.so-fx { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.so-ghost { position: absolute; z-index: 1; }
.so-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; }
.so-dot.is-ship { background: #14913f; }
.so-dot.is-block { background: #d3173c; }
.so-fight { position: absolute; left: 10px; top: 10px; right: 10px; bottom: 10px; z-index: 50; overflow: hidden; border-radius: 14px;
  background: radial-gradient(80% 80% at 50% 40%, #3a0d2a, #0c0818); box-shadow: 0 0 0 2px rgba(255, 79, 116, .5), 0 20px 50px rgba(0, 0, 0, .7); }
.so-fight-say { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center;
  font: 900 30px/1.2 var(--font); color: #ffd3dd; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }

/* reduce motion */
.so-root.is-calm .so-new, .so-root.is-calm .so-boss.is-low .so-boss-f, .so-root.is-calm .so-t-passport::after,
.so-root.is-calm .so-str.is-answer .so-str-l, .so-root.is-calm .is-pin::after, .so-root.is-calm .so-tab.has-pin::after { animation: none; }
