/* Shared structure for every theme. Each theme stylesheet sets the tokens and adds its own decoration. */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--fg); font-family: var(--body, "Karla", system-ui, sans-serif); font-size: 16px; line-height: 1.55;
  background: var(--bg); min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
:is(button, input, a):focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 3px; }
.deco-top { position: relative; z-index: 1; }
.page {
  position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding-block: 18px 80px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 30px;
}
.topline { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--fg-muted); }
.topline a { color: var(--link-bg, var(--fg)); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { flex: none; }
.brand div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand b { font-family: var(--display); font-weight: var(--brand-w, 800); font-variation-settings: var(--dvs, normal); font-style: var(--brand-style, normal); font-size: clamp(38px, 11vw, 54px); line-height: 1; letter-spacing: -.01em; color: var(--brand-fg, var(--fg)); }
.brand b em { font-style: inherit; color: var(--brand-em, inherit); }
.brand a { color: inherit; text-decoration: none; }
.brand small { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-muted); }
h2, h3 { margin: 0; font-family: var(--display); font-weight: var(--h-w, 700); font-variation-settings: var(--dvs, normal); line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(32px, 9vw, 44px); }
h3 { font-size: 24px; }
p { margin: 0; }
.caps { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.small { font-size: 14px; }
.on-bg-muted { color: var(--fg-muted); }
.screen { display: flex; flex-direction: column; gap: 24px; animation: kit-rise .5s ease-out; }
@keyframes kit-rise { from { transform: translateY(8px); } }

.panel { position: relative; background: var(--panel); color: var(--panel-fg); border-radius: var(--radius, 20px); padding: 26px 20px 22px; box-shadow: var(--panel-shadow, 0 18px 36px -24px rgba(0, 0, 0, .45)); }
.panel .muted, .panel.muted, .muted { color: var(--panel-muted); }
.panel .caps { color: var(--panel-muted); }
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.input { border: 2px solid var(--line); background: var(--input-bg, #fff); color: var(--panel-fg); border-radius: var(--radius-sm, 14px); padding: 13px 15px; font-size: 17px; width: 100%; }
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--panel-muted); opacity: .6; }
.btn { align-self: flex-start; cursor: pointer; border: 0; border-radius: var(--btn-radius, 999px); padding: 14px 24px; background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: 16px; box-shadow: var(--btn-shadow, none); transition: transform .12s; }
.btn:hover { transform: translateY(-1px); }
.btn-alt { align-self: center; cursor: pointer; border: 2px solid var(--alt-line, var(--fg)); background: var(--alt-bg, transparent); color: var(--alt-fg, var(--fg)); border-radius: var(--btn-radius, 999px); padding: 10px 20px; font-weight: 700; }
.link { border: 0; background: none; padding: 4px 0; color: var(--link, var(--accent)); cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.link.on-bg { color: var(--link-bg, var(--fg)); }
.error { color: var(--error, #c22a2a); font-weight: 600; }
.hint { font-size: 12px; color: var(--accent); font-weight: 700; }
.slots { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 360px; }
.otp-input { width: 100%; min-width: 0; aspect-ratio: 4 / 5; border: 2px solid var(--line); background: var(--input-bg, #fff); color: var(--panel-fg); border-radius: var(--radius-sm, 14px); text-align: center; font-family: var(--display); font-weight: var(--h-w, 700); font-variation-settings: var(--dvs, normal); font-size: 28px; padding: 0; caret-color: var(--accent); }
.otp-input:focus { outline: none; border-color: var(--accent); }
.code-ok .otp-input { border-color: var(--accent); color: var(--accent); }
.code-actions { display: flex; gap: 20px; flex-wrap: wrap; }

/* Group cards */
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.card { animation: kit-rise .5s ease-out backwards; animation-delay: calc(var(--i) * 100ms); }
.card > a { color: inherit; text-decoration: none; }
.card button, .card > a { width: 100%; text-align: left; cursor: pointer; border: 0; font: inherit; display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; transition: transform .15s; }
.card button:hover, .card > a:hover { transform: translateY(-2px); }
.card-date { width: 62px; height: 62px; border-radius: var(--date-radius, 16px); background: var(--date-bg, var(--accent)); color: var(--date-fg, var(--accent-fg)); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.card-date b { font-family: var(--display); font-weight: 800; font-variation-settings: var(--dvs, normal); font-size: 26px; }
.card-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-name { font-family: var(--display); font-weight: var(--h-w, 700); font-variation-settings: var(--dvs, normal); font-size: 25px; line-height: 1.05; }
.card-desc { color: var(--panel-muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip-bg, rgba(0, 0, 0, .06)); color: var(--panel-muted); }
[data-state="drawn"] .chip-status { background: var(--accent); color: var(--accent-fg); }

/* Group page */
.group-head { display: flex; flex-direction: column; gap: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.facts span { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 2px solid var(--facts-line, var(--fg-muted)); background: var(--facts-bg, transparent); }
.reveal { display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-x: clip; }
.reveal-note { min-height: 1.5em; text-align: center; }
.pending h3 { color: var(--accent); font-size: 30px; }
.progress { display: flex; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.progress span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.progress span.on { background: var(--accent); border-color: var(--accent); }
.section { display: flex; flex-direction: column; gap: 12px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.item { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; }
.item button { align-self: center; }
.item + .item { border-top: 1px solid var(--line); }
.item::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--bullet, var(--accent)); }
.item span { flex: 1; min-width: 0; overflow-wrap: break-word; }
.item a { color: var(--link, var(--accent)); font-weight: 700; overflow-wrap: anywhere; }
.card.no-date > a, .card.no-date button { grid-template-columns: 1fr; }
.item button { border: 0; background: none; color: var(--panel-muted); cursor: pointer; font-size: 13px; font-weight: 700; }
.wish-form { display: flex; gap: 8px; margin-top: 4px; }
.wish-form .input { flex: 1; min-width: 0; font-size: 16px; padding: 11px 14px; }
.wish-form .btn { padding: 11px 18px; }
.guests { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.guest { display: flex; align-items: center; gap: 10px; }
.guest-ini { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--chip-bg, rgba(0, 0, 0, .06)); color: var(--panel-fg); }
.guest div { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.guest strong { font-size: 15px; overflow-wrap: break-word; hyphens: auto; }
.guest small { font-size: 12px; color: var(--panel-muted); }
.guest[data-status="wishes"] .guest-ini { background: var(--accent); color: var(--accent-fg); }
.guest[data-status="wishes"] small { color: var(--accent); font-weight: 700; }
.guest[data-status="invited"] { opacity: .5; }
.footer-actions { display: flex; justify-content: center; }

/* ---------- Reveal stages ---------- */
.stage { position: relative; width: min(100%, 300px); max-width: 100%; }
.prize { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 20px; color: var(--prize-fg, var(--panel-fg)); }
.prize .caps { font-size: 10px; color: var(--prize-muted, var(--panel-muted)); }
.prize-name { font-family: var(--display); font-weight: var(--prize-w, 800); font-variation-settings: var(--dvs, normal); font-style: var(--prize-style, normal); font-size: clamp(34px, 11vw, 46px); line-height: 1; color: var(--prize-name, var(--accent)); overflow-wrap: anywhere; }
.prize-extra { font-size: 13px; color: var(--prize-muted, var(--panel-muted)); }

/* scratch and bite: a canvas cover */
.cover { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; transition: opacity .5s; }
.stage.open .cover { opacity: 0; pointer-events: none; }
.stage-scratch { aspect-ratio: 16 / 10; border-radius: var(--radius, 20px); background: var(--stage-bg, var(--panel)); overflow: hidden; box-shadow: var(--panel-shadow, none); }
.stage-scratch .cover { cursor: grab; }
.stage-bite { width: min(72vw, 270px); aspect-ratio: 1; border-radius: 50%; background: var(--stage-bg, var(--panel)); overflow: hidden; box-shadow: var(--panel-shadow, none); }
.stage-bite .cover { cursor: pointer; }
.stage-bite .prize-name { font-size: clamp(30px, 10vw, 40px); }

/* door */
.stage-door { aspect-ratio: 4 / 5; border-radius: var(--radius-sm, 12px); background: var(--stage-bg, var(--panel)); perspective: 1100px; cursor: pointer; box-shadow: inset 0 0 0 6px rgba(0, 0, 0, .12); }
.door { position: absolute; inset: 0; border-radius: inherit; transform-origin: left center; transition: transform .9s cubic-bezier(.5, 0, .2, 1); display: grid; place-items: center; background: var(--door-bg, var(--accent)); color: var(--door-fg, var(--accent-fg)); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.door-num { font-family: var(--display); font-weight: 900; font-variation-settings: var(--dvs, normal); font-size: 110px; line-height: 1; }
.door-knob { position: absolute; right: 16px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: currentColor; }
.stage-door.open .door { transform: rotateY(-108deg); }
.stage-door.open { cursor: default; }

/* seal */
.stage-seal { aspect-ratio: 4 / 5; background: var(--stage-bg, var(--panel)); border: 1px solid var(--stage-line, var(--line)); box-shadow: var(--panel-shadow, none); border-radius: var(--radius-sm, 6px); }
.stage-seal::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--stage-line, var(--line)); pointer-events: none; border-radius: inherit; }
.seal-prompt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 38px 20px; text-align: center; color: var(--prize-muted, var(--panel-muted)); transition: opacity .4s; }
.stage-seal .prize { opacity: 0; filter: blur(6px); transition: opacity .5s .3s, filter .5s .3s; }
.seal { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; margin: -56px 0 0 -56px; border: 0; padding: 0; background: none; cursor: pointer; z-index: 2; border-radius: 50%; }
.seal-half { position: absolute; inset: 0; transition: transform .7s cubic-bezier(.3, .7, .3, 1), opacity .7s; }
.seal-half.l { clip-path: polygon(0 0, 54% 0, 46% 30%, 56% 52%, 44% 74%, 52% 100%, 0 100%); }
.seal-half.r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 52% 100%, 44% 74%, 56% 52%, 46% 30%); }
.wax { position: absolute; inset: 0; border-radius: 47% 53% 50% 50% / 52% 46% 54% 48%; background: radial-gradient(circle at 34% 30%, var(--wax-hi, #d0505f), var(--wax, #a3283a) 42%, var(--wax-lo, #64142a) 100%); box-shadow: 0 6px 14px rgba(0, 0, 0, .45), inset 0 -4px 8px rgba(0, 0, 0, .3); display: grid; place-items: center; }
.wax::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; border: 2px solid rgba(40, 6, 14, .4); }
.wax span { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 38px; color: rgba(40, 6, 14, .55); text-shadow: 0 1px 0 rgba(255, 255, 255, .15); }
.stage-seal.open .seal { pointer-events: none; }
.stage-seal.open .seal-half.l { transform: translate(-70px, 60px) rotate(-38deg); opacity: 0; }
.stage-seal.open .seal-half.r { transform: translate(70px, 80px) rotate(30deg); opacity: 0; }
.stage-seal.open .seal-prompt { opacity: 0; }
.stage-seal.open .prize { opacity: 1; filter: none; }

/* rise: a tag comes up out of a holder */
.stage-rise { height: 340px; cursor: pointer; }
.rise-hint { position: absolute; left: 0; right: 0; top: 20px; text-align: center; color: var(--fg-muted); transition: opacity .3s; }
.stage-rise .tag { position: absolute; left: 20%; right: 20%; bottom: 40px; height: 160px; z-index: 1; background: var(--tag-bg, #fff); border-radius: 12px; border: 2px solid var(--tag-line, var(--accent)); transition: transform .75s cubic-bezier(.2, .9, .3, 1.15) .15s; }
.stage-rise .tag .prize { padding: 12px; }
.stage-rise .holder { position: absolute; left: 14%; right: 14%; bottom: 0; height: 180px; z-index: 2; }
.stage-rise.open .tag { transform: translateY(-130px); }
.stage-rise.open .rise-hint { opacity: 0; }
.stage-rise.open { cursor: default; }

/* stamp */
.stage-stamp { height: 330px; cursor: pointer; }
.paper { position: absolute; left: 4%; right: 4%; bottom: 0; height: 220px; background: var(--tag-bg, #fff); border-radius: 10px; box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .55); overflow: hidden; }
.paper .prize { opacity: 0; transition: opacity .25s; }
.ink { position: absolute; right: 12px; bottom: 14px; border: 3px solid var(--ink, var(--accent)); color: var(--ink, var(--accent)); padding: 2px 10px; border-radius: 6px; font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-12deg) scale(1.5); opacity: 0; }
.stamp-tool { position: absolute; left: 50%; top: -14px; width: 130px; margin-left: -65px; z-index: 3; pointer-events: none; }
.stamp-tool .handle { display: block; margin: 0 auto; width: 36px; height: 60px; border-radius: 18px 18px 6px 6px; background: var(--stamp-handle, #8a5a34); }
.stamp-tool .block { display: block; height: 44px; border-radius: 8px; background: var(--stamp-block, #2b2b2b); border-bottom: 8px solid var(--ink, var(--accent)); }
.stage-stamp.stamping .stamp-tool { animation: kit-stamp .62s ease-in-out; }
@keyframes kit-stamp { 0% { transform: none; } 42% { transform: translateY(124px); } 56% { transform: translateY(118px); } 100% { transform: none; } }
.stage-stamp.open .paper .prize { opacity: 1; }
.stage-stamp.open .ink { opacity: .85; transform: rotate(-12deg) scale(1); transition: transform .18s, opacity .18s; }
.stage-stamp.open { cursor: default; }

/* ribbon: wrapping paper splits open */
.stage-ribbon { aspect-ratio: 4 / 5; border-radius: var(--radius, 18px); overflow: hidden; background: var(--stage-bg, var(--panel)); box-shadow: var(--panel-shadow, none); }
.stage-ribbon .prize { opacity: 0; transition: opacity .6s .35s; }
.wrap { position: absolute; top: 0; bottom: 0; width: 50%; transition: transform .8s cubic-bezier(.6, 0, .3, 1) .2s; background: linear-gradient(var(--ribbon, #e3b25e), var(--ribbon, #e3b25e)) 0 50% / 100% 18px no-repeat, var(--wrap-bg, #a3202e); }
.wrap.l { left: 0; box-shadow: inset -9px 0 0 var(--ribbon, #e3b25e); }
.wrap.r { right: 0; box-shadow: inset 9px 0 0 var(--ribbon, #e3b25e); }
.bow { position: absolute; left: 50%; top: 50%; width: 120px; height: 80px; margin: -40px 0 0 -60px; border: 0; padding: 0; background: none; cursor: pointer; z-index: 2; transition: transform .35s ease-in, opacity .35s; }
.bow::before, .bow::after { content: ""; position: absolute; top: 16px; width: 44px; height: 32px; border: 8px solid var(--ribbon, #e3b25e); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; box-shadow: 0 4px 8px rgba(0, 0, 0, .3); }
.bow::before { left: 4px; transform: rotate(-16deg); }
.bow::after { right: 4px; transform: rotate(16deg); }
.knot { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 6px; background: var(--ribbon, #e3b25e); filter: brightness(1.1); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.stage-ribbon.open .bow { transform: scale(.2) rotate(40deg); opacity: 0; pointer-events: none; }
.stage-ribbon.open .wrap.l { transform: translateX(-102%); }
.stage-ribbon.open .wrap.r { transform: translateX(102%); }
.stage-ribbon.open .prize { opacity: 1; }

/* flip: flat card turn, never changes size */
.stage-flip { aspect-ratio: 3 / 2; cursor: pointer; }
.flipper { position: absolute; inset: 0; transition: transform .22s ease-out; }
.flipper.turning { transform: scaleX(0); transition-timing-function: ease-in; }
.face { position: absolute; inset: 0; border-radius: var(--radius-sm, 8px); overflow: hidden; box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .6); }
.face.back { background: var(--tag-bg, #fff); }
.stage-flip:not(.open) .back, .stage-flip.open .front { visibility: hidden; }

/* shutters */
.stage-shutters { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius-sm, 8px); background: var(--stage-bg, var(--panel)); cursor: pointer; box-shadow: var(--panel-shadow, none); }
.shutter { position: absolute; top: 0; bottom: 0; width: 50%; transition: transform .9s cubic-bezier(.7, 0, .2, 1); background: var(--shutter-bg, var(--accent)); }
.shutter.l { left: 0; }
.shutter.r { right: 0; }
.stage-shutters.open .shutter.l { transform: translateX(-100%); }
.stage-shutters.open .shutter.r { transform: translateX(100%); }
.stage-shutters.open { cursor: default; }

/* spin: a wreath turns, the centre opens */
.stage-spin { width: min(78vw, 290px); aspect-ratio: 1; cursor: pointer; }
.wreath { position: absolute; inset: 0; border-radius: 50%; transition: transform 1.3s cubic-bezier(.3, .7, .2, 1); }
.spin-center { position: absolute; inset: 21%; border-radius: 50%; background: var(--stage-bg, var(--panel)); overflow: hidden; box-shadow: inset 0 4px 12px rgba(0, 0, 0, .18); }
.spin-center .prize { padding: 8px; opacity: 0; transition: opacity .5s .7s; }
.spin-center .prize-name { font-size: clamp(24px, 8vw, 32px); }
.spin-center .prize .caps { font-size: 9px; letter-spacing: .12em; }
.spin-cover { position: absolute; inset: 0; transition: transform .5s ease-in .2s, opacity .5s .2s; }
.stage-spin.open .wreath { transform: rotate(360deg); }
.stage-spin.open .spin-cover { transform: scale(.4) rotate(120deg); opacity: 0; }
.stage-spin.open .prize { opacity: 1; }
.stage-spin.open { cursor: default; }

/* cracker (papillote): two halves pull apart, a slip pops out */
.stage-cracker { width: 100%; max-width: 400px; height: 230px; overflow: hidden; cursor: pointer; }
.stage-cracker .half { position: absolute; top: 50%; height: 66px; margin-top: -33px; display: flex; filter: drop-shadow(0 8px 10px rgba(42, 28, 19, .25)); transition: transform .65s cubic-bezier(.2, .9, .3, 1.2); }
.stage-cracker .half.l { right: 50%; }
.stage-cracker .half.r { left: 50%; }
.stage-cracker .c-body { width: 86px; height: 66px; background: var(--cracker-body, var(--accent)); position: relative; }
.stage-cracker .c-body::after { content: ""; position: absolute; top: 0; bottom: 0; width: 14px; background: var(--cracker-band, #fff); }
.stage-cracker .half.l .c-body::after { left: 14px; }
.stage-cracker .half.r .c-body::after { right: 14px; }
.stage-cracker .c-end { width: 54px; height: 66px; background: var(--cracker-end, var(--accent)); }
.stage-cracker .half.l .c-end { clip-path: polygon(0 0, 100% 30%, 100% 70%, 0 100%); }
.stage-cracker .half.r .c-end { clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 70%); }
.stage-cracker .slip { position: absolute; left: 50%; top: 50%; width: 230px; height: 140px; margin: -70px 0 0 -115px; z-index: 3; background: var(--tag-bg, #fff); border-radius: 10px; outline: 2px dashed var(--stitch, var(--line)); outline-offset: -7px; box-shadow: 0 14px 28px -12px rgba(42, 28, 19, .5); transform: scale(.1) rotate(-8deg); opacity: 0; transition: transform .55s cubic-bezier(.2, .9, .3, 1.3) .2s, opacity .3s .2s; }
.stage-cracker .slip .prize { padding: 14px; }
.stage-cracker .bang { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%) scale(.3); opacity: 0; font-family: var(--display); font-weight: 900; font-style: italic; font-size: 44px; color: var(--bang, var(--accent)); pointer-events: none; }
.stage-cracker.open .half.l { transform: translateX(-74px) rotate(-12deg); }
.stage-cracker.open .half.r { transform: translateX(74px) rotate(12deg); }
.stage-cracker.open .slip { transform: none; opacity: 1; }
.stage-cracker.open .bang { animation: kit-bang .6s ease-out; }
@keyframes kit-bang { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); } 60% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1.4); } }
.stage-cracker.open { cursor: default; }

/* ---------- App components ---------- */
.topline .tl-right { display: flex; gap: 14px; align-items: center; }
.topline button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--link-bg, var(--fg)); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
textarea.input { resize: vertical; min-height: 92px; line-height: 1.45; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field .opt { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .75; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 460px) { .grid2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
a.btn, a.btn-alt, a.btn-ghost { display: inline-block; text-decoration: none; text-align: center; }
.btn-ghost { cursor: pointer; border: 2px solid var(--line); background: transparent; color: var(--panel-fg); border-radius: var(--btn-radius, 999px); padding: 10px 18px; font-weight: 700; font-size: 15px; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { cursor: pointer; border: 0; background: #b3261e; color: #fff; border-radius: var(--btn-radius, 999px); padding: 11px 18px; font-weight: 700; font-size: 15px; }
.btn[disabled], .btn-ghost[disabled], .btn-danger[disabled], .btn-alt[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.flash { border-radius: var(--radius-sm, 14px); padding: 12px 14px; font-weight: 600; font-size: 15px; background: var(--panel); color: var(--panel-fg); border: 2px solid var(--accent); }
.flash.err { border-color: var(--error, #c22a2a); }
.form-msg { font-size: 14px; font-weight: 600; }
.form-msg:empty { display: none; }
.form-msg.err { color: var(--error, #c22a2a); }
.form-msg.ok { color: var(--accent); }
.confirm { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-sm, 14px); border: 2px dashed var(--error, #c22a2a); }
.confirm p { font-weight: 600; }
.subtle { font-size: 14px; color: var(--panel-muted); }
.empty { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty .btn, .empty .btn-alt { align-self: center; }
.dev-note { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: #fff7d6; color: #5b4500; border: 1px dashed #c9a400; word-break: break-all; }
.dev-note a { color: inherit; }
.loading { text-align: center; color: var(--fg-muted); padding: 40px 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 14px; padding: 11px 12px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini-list .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mini-list .who strong { overflow-wrap: break-word; hyphens: auto; }
.mini-list .who small { color: var(--panel-muted); font-size: 12px; overflow-wrap: anywhere; }
.mini-list button { border: 0; background: none; color: var(--panel-muted); cursor: pointer; font-weight: 700; font-size: 13px; text-decoration: underline; }
.tag-role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip-bg, rgba(0, 0, 0, .06)); color: var(--panel-muted); }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pairs li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--chip-bg, rgba(0, 0, 0, .06)); font-size: 14px; font-weight: 600; }
.pairs button { border: 0; background: none; cursor: pointer; color: var(--panel-muted); padding: 2px 6px; }
.organize-btn { align-self: flex-start; }
.toast { position: fixed; z-index: 70; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -150%); background: #1d1714; color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5); transition: transform .3s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }

/* Theme switcher */
.ss-btn { position: fixed; z-index: 50; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border: 0; border-radius: 999px; cursor: pointer; background: #ffffff; color: #1d1714; font: 700 14px/1 "Karla", system-ui, sans-serif; box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .06); }
.ss-btn:focus-visible, .ss-opt:focus-visible, .ss-close:focus-visible { outline: 3px solid #1d1714; outline-offset: 3px; }
.ss-dot { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
@media (max-width: 600px) { .ss-btn { padding: 6px; } .ss-btn .ss-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .ss-btn .ss-dot { width: 34px; height: 34px; } }
.ss-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 10, 8, .45); opacity: 0; transition: opacity .2s; }
.ss-sheet { position: fixed; z-index: 61; left: 50%; bottom: 0; width: min(100%, 440px); transform: translate(-50%, 100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); background: #fffdf9; color: #1d1714; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); font-family: "Karla", system-ui, sans-serif; box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .5); max-height: 85vh; overflow-y: auto; }
.ss-open .ss-backdrop { opacity: 1; }
.ss-open .ss-sheet { transform: translate(-50%, 0); }
.ss-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 12px; }
.ss-head h2 { margin: 0; font: 800 22px/1.1 "Fraunces", Georgia, serif; font-variation-settings: "SOFT" 100, "WONK" 1; color: #1d1714; }
.ss-close { border: 0; background: #f1ece5; color: #1d1714; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.ss-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ss-opt { width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px; border: 2px solid transparent; border-radius: 14px; background: none; cursor: pointer; text-align: left; color: #1d1714; font: inherit; }
.ss-opt:hover { background: #f6f1ea; }
.ss-opt[aria-current="true"] { border-color: #1d1714; background: #f6f1ea; }
.ss-opt .ss-dot { width: 44px; height: 44px; }
.ss-opt .ss-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ss-opt strong { font-size: 16px; }
.ss-opt small { font-size: 13px; color: #6a615b; }
.ss-check { font-size: 13px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
