/* Storycard studio components. Reads only tokens (tokens.css + a theme), so themes swap without touching this file. */

/* ---- base ---------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--c-ink); background-color: var(--c-paper);
  background-image: var(--tex-paper); font: var(--fs-md)/var(--lh-ui) var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--c-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: var(--lh-tight); margin: 0;
  font-variation-settings: "SOFT" 100, "WONK" 0; color: var(--c-primary); text-wrap: balance; }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-lg); }
p { margin: 0; max-width: var(--measure); text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--c-ink-2); }
.small { font-size: var(--fs-sm); }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 40rem) { :root { --gutter: 1.5rem; } }
@media (min-width: 64rem) { :root { --gutter: 2.5rem; } }

/* ---- masthead ------------------------------------------------------------------------------------------------ */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding-block: var(--s-4); }
.wordmark { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 600; font-style: italic; color: var(--c-primary); text-decoration: none;
  font-variation-settings: "SOFT" 100, "WONK" 1; }
.wordmark svg { width: 26px; height: 26px; }
.masthead .who { font-size: var(--fs-sm); color: var(--c-ink-2); text-align: right; }

/* ---- buttons ------------------------------------------------------------------------------------------------- */
.btn {
  --bg: var(--c-primary); --fg: var(--c-on-primary);
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-5); border: 0; border-radius: var(--r-pill); cursor: pointer;
  font: 600 var(--fs-md)/1 var(--font-ui); text-decoration: none; color: var(--fg); background: var(--bg);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), var(--sh-1);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast), background var(--t-fast);
}
.btn:hover { transform: translateY(-1px); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), var(--sh-2); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgb(0 0 0 / .18); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--accent { --bg: var(--c-accent); --fg: var(--c-on-accent); }
.btn--ghost { --bg: transparent; --fg: var(--c-primary); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--ghost:hover { box-shadow: inset 0 0 0 2px currentColor; background: rgb(255 255 255 / .35); }
.btn--quiet { --bg: transparent; --fg: var(--c-primary); box-shadow: none; padding: 0 var(--s-3); text-decoration: underline;
  text-underline-offset: 3px; font-weight: 500; }
.btn--quiet:hover { box-shadow: none; }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.iconbtn { appearance: none; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--c-line); background: var(--c-card); color: var(--c-primary); cursor: pointer; }
.iconbtn:hover { border-color: var(--c-primary); }
.iconbtn[disabled] { opacity: .35; cursor: default; }
.iconbtn svg { width: 20px; height: 20px; }

/* ---- form fields --------------------------------------------------------------------------------------------- */
.field { display: grid; gap: var(--s-1); }
.field + .field, .field + .row2, .row2 + .field { margin-top: var(--s-4); }
.label { font-weight: 600; font-size: var(--fs-md); color: var(--c-ink); }
.label .opt { font-weight: 400; color: var(--c-ink-2); font-size: var(--fs-sm); }
.label .req { color: var(--c-accent); }
.hint { font-size: var(--fs-sm); color: var(--c-ink-2); }
.input, .textarea, .select {
  width: 100%; min-height: 48px; padding: var(--s-3) var(--s-3); font: inherit; font-size: var(--fs-md); color: var(--c-ink);
  background: var(--c-card); border: 1.5px solid var(--c-line); border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 88px; resize: vertical; line-height: var(--lh-ui); }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--c-ink-2) 75%, transparent); }
.input:focus, .textarea:focus { outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-focus) 35%, transparent); }
.field[data-invalid] .input, .field[data-invalid] .textarea { border-color: var(--c-danger); }
.field .err { color: var(--c-danger); font-size: var(--fs-sm); font-weight: 600; }
.field .foot { display: flex; justify-content: space-between; gap: var(--s-3); }
.counter { font-size: var(--fs-xs); color: var(--c-ink-2); font-variant-numeric: tabular-nums; margin-left: auto; }
.counter[data-near] { color: var(--c-accent); font-weight: 600; }
.row2 { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 30rem) { .row2 { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.field > .input + .hint { margin-top: 2px; }
.row2 > .field { margin-top: 0; }
.row2 + .row2 { margin-top: var(--s-4); }

/* segmented control (radio group) */
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); border: 0; padding: 0; margin: 0; }
.seg legend { padding: 0; margin-bottom: var(--s-1); }
.seg label { position: relative; flex: 1 1 auto; min-width: 4.5rem; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label > span { display: grid; place-items: center; min-height: 44px; padding: var(--s-2) var(--s-3); text-align: center;
  border: 1.5px solid var(--c-line); border-radius: var(--r-sm); background: var(--c-card); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.seg label > span small { display: block; font-size: var(--fs-xs); color: var(--c-ink-2); font-weight: 400; }
.seg input:checked + span { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); font-weight: 600; }
.seg input:checked + span small { color: color-mix(in srgb, var(--c-on-primary) 85%, transparent); }
.seg input:focus-visible + span { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* checkbox */
.check { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); align-items: start; cursor: pointer; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--c-primary); cursor: pointer; }

/* ---- cards --------------------------------------------------------------------------------------------------- */
.card { position: relative; background: var(--c-card); border-radius: var(--r-lg); padding: var(--s-5);
  box-shadow: var(--sh-2); border: 1px solid color-mix(in srgb, var(--c-line) 60%, transparent); }
@media (min-width: 40rem) { .card { padding: var(--s-6); } }
.card--flat { box-shadow: none; background: transparent; border: 1.5px dashed var(--c-line); }
.ornament { height: 28px; background: var(--orn-divider) center / contain no-repeat; margin: var(--s-5) auto; max-width: 240px; }

/* ---- garland stepper: a hand-drawn wire with one bulb per step ------------------------------------------------- */
.garland { position: relative; margin: var(--s-2) 0 var(--s-6); }
.garland svg.wire { position: absolute; left: 0; right: 0; top: 2px; width: 100%; height: 26px; overflow: visible; }
.garland svg.wire path { fill: none; stroke: var(--c-primary); stroke-width: 1.5; stroke-linecap: round; opacity: .7; }
.garland ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(var(--n, 4), 1fr); }
.garland li { display: grid; justify-items: center; gap: var(--s-2); text-align: center; }
.garland a, .garland span.lbl { font-size: var(--fs-sm); color: var(--c-ink-2); text-decoration: none; line-height: 1.2; }
@media (max-width: 30rem) { .garland a, .garland span.lbl { font-size: var(--fs-xs); } }
.garland a:hover { color: var(--c-primary); text-decoration: underline; }
.bulb { width: 18px; height: 26px; position: relative; margin-top: 8px; }
.bulb::before { /* cap */ content: ""; position: absolute; left: 5px; top: -4px; width: 8px; height: 6px; border-radius: 2px;
  background: var(--c-primary); }
.bulb::after { content: ""; position: absolute; inset: 2px 0 0; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--c-paper-2); border: 1.5px solid var(--c-primary); }
.garland li[data-state="done"] .bulb::after { background: var(--c-glow); border-color: #a87b16;
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--c-glow) 70%, transparent); }
.garland li[data-state="now"] .bulb::after { background: var(--c-accent); border-color: var(--c-accent);
  box-shadow: 0 0 14px 4px color-mix(in srgb, var(--c-accent) 45%, transparent); animation: twinkle 2.4s ease-in-out infinite; }
.garland li[data-state="now"] .lbl, .garland li[data-state="now"] a { color: var(--c-ink); font-weight: 700; }
@keyframes twinkle { 50% { box-shadow: 0 0 6px 1px color-mix(in srgb, var(--c-accent) 30%, transparent); } }

/* ---- step header --------------------------------------------------------------------------------------------- */
.stephead { display: grid; gap: var(--s-3); margin-bottom: var(--s-5); }
.stephead p { color: var(--c-ink-2); font-size: var(--fs-md); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-6); }
.actions .grow { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: var(--s-6) calc(-1 * var(--gutter)) 0;
  padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--c-paper) 92%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--c-line); display: flex; gap: var(--s-3); align-items: center; }
.sticky-actions .note { flex: 1 1 auto; min-width: 0; font-size: var(--fs-sm); line-height: 1.3; color: var(--c-ink-2); }
.sticky-actions .btn { flex: none; white-space: nowrap; }
@media (max-width: 30rem) { .sticky-actions .note { font-size: var(--fs-xs); } .sticky-actions .btn { padding: 0 var(--s-4); } }

/* ---- landing ------------------------------------------------------------------------------------------------- */
.hero { display: grid; gap: var(--s-6); align-items: start; padding-block: var(--s-3) var(--s-7); }
@media (min-width: 56rem) { .hero { grid-template-columns: 1fr minmax(22rem, 27rem); gap: var(--s-7); padding-top: var(--s-4); } }
.hero h1 { color: var(--c-primary); max-width: 14ch; }
.hero .lede { font-size: var(--fs-lg); line-height: 1.5; color: var(--c-ink-2); margin-top: var(--s-4); max-width: 30rem; }
.hero .price { margin-top: var(--s-4); font-family: var(--font-display); font-size: var(--fs-lg); color: var(--c-accent); }
.hero-art { width: 100%; max-width: 11rem; margin: 0 0 var(--s-3) -0.5rem; }
@media (min-width: 40rem) { .hero-art { max-width: 15rem; margin-bottom: var(--s-4); } }
@media (min-width: 56rem) { .hero-art { max-width: 13rem; } }
.hero-art path, .hero-art circle, .hero-art line, .hero-art polyline { fill: none; stroke: var(--c-primary);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .berry { fill: var(--c-accent); stroke: var(--c-accent); }
.hero-art .gold { stroke: var(--c-glow); stroke-width: 2.6; }
.hero-art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; /* paths carry pathLength="1" */
  animation: ink 2.6s var(--ease-ink) forwards; animation-delay: var(--d, 0s); }
@keyframes ink { to { stroke-dashoffset: 0; } }
.hero-art .berry { opacity: 0; animation: berry .5s var(--ease-out) 2.3s forwards; }
@keyframes berry { from { opacity: 0; transform: scale(.4); transform-box: fill-box; transform-origin: center; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-art .draw, .hero-art .berry { animation: none; stroke-dashoffset: 0; opacity: 1; } }

.dropzone { position: relative; display: grid; place-items: center; gap: var(--s-2); text-align: center; min-height: 190px;
  padding: var(--s-5); border: 2px dashed var(--c-line); border-radius: var(--r-md); background: var(--c-paper);
  cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.dropzone:hover, .dropzone[data-over] { border-color: var(--c-primary); background: color-mix(in srgb, var(--c-glow) 10%, var(--c-paper)); }
.dropzone:focus-within { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .big { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--c-primary); }
.dropzone img.preview { max-height: 180px; border-radius: var(--r-sm); box-shadow: var(--sh-2); transform: rotate(-2deg);
  border: 6px solid #fff; }
.upload-card { display: grid; gap: var(--s-4); }

.how { display: grid; gap: var(--s-5); padding-block: var(--s-6) var(--s-8); counter-reset: how; list-style: none; margin: 0; padding-left: 0; }
@media (min-width: 48rem) { .how { grid-template-columns: repeat(4, 1fr); } }
.how li { counter-increment: how; display: grid; gap: var(--s-2); align-content: start; }
.how li::before { content: counter(how); font-family: var(--font-display); font-size: 2.2rem; line-height: 1; color: var(--c-accent);
  font-variation-settings: "SOFT" 100, "WONK" 1; font-style: italic; }
.how h3 { font-size: var(--fs-lg); }
.how p { color: var(--c-ink-2); font-size: var(--fs-sm); }

/* ---- people step: photo with editable face boxes ---------------------------------------------------------------- */
.people-layout { display: grid; gap: var(--s-5); }
@media (min-width: 60rem) { .people-layout { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.photo-frame { position: relative; background: #fff; padding: 8px 8px 36px; border-radius: 3px; box-shadow: var(--sh-3);
  transform: rotate(-.6deg); max-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.photo-stage { position: relative; line-height: 0; overflow: hidden; /* clips the active-box dimmer to the photo */ }
.photo-stage img { width: 100%; height: auto; max-height: 68vh; object-fit: contain; }
.facebox { position: absolute; border: 2.5px solid var(--c-glow); border-radius: 46% 46% 44% 44%;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .35), inset 0 0 0 1px rgb(0 0 0 / .25); cursor: pointer; touch-action: none; }
.facebox .num { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 14px; display: grid; place-items: center; background: var(--c-accent); color: var(--c-on-accent);
  font: 700 var(--fs-sm)/1 var(--font-ui); box-shadow: 0 1px 3px rgb(0 0 0 / .4); }
.facebox[data-off] { border-color: rgb(255 255 255 / .75); border-style: dashed; }
.facebox[data-off] .num { background: #6c6258; }
.facebox[data-active] { border-color: #fff; border-radius: 6px; cursor: move;
  box-shadow: 0 0 0 9999px rgb(20 12 6 / .45), 0 0 0 2px var(--c-accent); }
.facebox .h { position: absolute; width: 44px; height: 44px; display: none; touch-action: none; }
.facebox .h::after { content: ""; position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--c-accent); box-shadow: 0 1px 3px rgb(0 0 0 / .5); }
.facebox[data-active] .h { display: block; }
.facebox .h.nw { left: -22px; top: -22px; cursor: nwse-resize; } .facebox .h.ne { right: -22px; top: -22px; cursor: nesw-resize; }
.facebox .h.sw { left: -22px; bottom: -22px; cursor: nesw-resize; } .facebox .h.se { right: -22px; bottom: -22px; cursor: nwse-resize; }
.facebox[data-active] .num { display: none; }
.photo-caption { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-family: var(--font-display);
  font-style: italic; color: var(--c-ink-2); font-size: var(--fs-sm); line-height: 1.2; }

.faces { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4) var(--s-3); margin-top: var(--s-5); }
.face { appearance: none; border: 0; background: none; padding: 0; display: grid; justify-items: center; gap: var(--s-1);
  cursor: pointer; color: var(--c-ink); font: inherit; width: 84px; }
.face canvas { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--c-primary); background: var(--c-paper-2);
  transition: filter var(--t-med), opacity var(--t-med), border-color var(--t-med); }
.face .nm { font-size: var(--fs-sm); font-weight: 600; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face .st { font-size: var(--fs-xs); color: var(--c-ink-2); }
.face[aria-pressed="false"] canvas { filter: grayscale(1); opacity: .55; border-color: var(--c-line); border-style: dashed; }
.face[aria-pressed="true"] .st { color: var(--c-ok); font-weight: 600; }
.face[data-active] canvas { box-shadow: 0 0 0 3px var(--c-paper), 0 0 0 6px var(--c-accent); }
.adjust, #adjustOn, #adjustIdle { display: grid; gap: var(--s-3); }
.adjust .tools { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---- story step ---------------------------------------------------------------------------------------------- */
.story-list { display: grid; gap: var(--s-6); }
.person-card { display: grid; gap: var(--s-5); }
@media (min-width: 56rem) { .person-card { grid-template-columns: 1fr 15rem; align-items: start; } }
.person-card header { display: flex; gap: var(--s-3); align-items: center; margin-bottom: var(--s-4); }
.person-card header canvas { width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--c-primary); flex: none; }
.person-card header h3 { font-size: var(--fs-xl); }
.person-card .status { font-size: var(--fs-sm); color: var(--c-ink-2); }
.person-card[data-saved] header h3::after { content: ""; display: inline-block; width: 18px; height: 18px; margin-left: 8px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%231d6a43' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5l4 4 8-9'/%3E%3C/svg%3E") center/contain no-repeat; }
.person-card .side { display: grid; gap: var(--s-2); justify-items: center; }
.person-card .side .tag { width: min(15rem, 70vw); }
.examples { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-1); }
.chip { appearance: none; border: 1px solid var(--c-line); background: transparent; border-radius: var(--r-pill);
  padding: 6px 12px; min-height: 32px; font: inherit; font-size: var(--fs-xs); color: var(--c-ink-2); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ---- gift tag: the avatar card --------------------------------------------------------------------------------- */
.tag { position: relative; padding: calc(var(--s-5) + 6px) var(--s-4) var(--s-4);
  /* tag stock: warm card with a faint fibre texture; the drawing is multiplied onto it so it reads as printed */
  background:
    radial-gradient(120% 80% at 50% 35%, rgb(255 253 246 / .7), transparent 70%),
    repeating-linear-gradient(115deg, rgb(140 110 60 / .025) 0 2px, transparent 2px 5px),
    #f7efdc;
  border-radius: 10px; clip-path: polygon(16% 0, 84% 0, 100% 7%, 100% 100%, 0 100%, 0 7%);
  display: grid; gap: var(--s-2); }
.tag::before { /* punched hole with a reinforcing ring */ content: ""; position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--c-paper); box-shadow: inset 0 1px 2px rgb(0 0 0 / .35), 0 0 0 3px #e9dcbd, 0 0 0 4px rgb(140 110 60 / .25); z-index: 1; }
.tag::after { /* printed rule that follows the whole tag outline, angled shoulders included */ content: "";
  position: absolute; inset: 7px; pointer-events: none; opacity: .55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='16,0.6 84,0.6 99.4,6.6 99.4,99.4 0.6,99.4 0.6,6.6' fill='none' stroke='%239e2a2b' stroke-width='1.5' vector-effect='non-scaling-stroke'/%3E%3Cpolygon points='16.6,2 83.4,2 98,7.6 98,98 2,98 2,7.6' fill='none' stroke='%239e2a2b' stroke-width='.75' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.tag-wrap { position: relative; padding-top: 22px; filter: drop-shadow(0 1px 0 rgb(var(--shadow-rgb) / .14)) drop-shadow(0 10px 14px rgb(var(--shadow-rgb) / .2)); }
.tag-wrap::before { /* twine */ content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 40px; margin-left: -1px;
  background: repeating-linear-gradient(180deg, var(--c-accent) 0 4px, #c9a26b 4px 7px); z-index: 2; transform: rotate(-4deg); transform-origin: top; }
.tag .art { position: relative; aspect-ratio: 832 / 1216; margin: 0 var(--s-1); }
.tag .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0;
  mix-blend-mode: multiply; /* the drawing's paper becomes the tag's paper */
  -webkit-mask-image: radial-gradient(ellipse 72% 80% at 50% 48%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 80% at 50% 48%, #000 70%, transparent 100%);
  transition: opacity var(--t-slow) var(--ease-out); }
.tag .art img[data-on] { opacity: 1; }
.tag .art .sketch { position: absolute; inset: 8% 10%; transition: opacity var(--t-slow); }
.tag .art[data-has] .sketch { opacity: 0; }
.tag .to { font-family: var(--font-display); font-size: var(--fs-lg); text-align: center; color: var(--c-primary);
  display: grid; justify-items: center; gap: 4px; }
.tag .to-name { font-style: italic; padding: 0 var(--s-3) 2px; border-bottom: 1.5px dotted rgb(var(--shadow-rgb) / .35); }
.tag .to-name::before { content: "To: "; font-style: normal; font-family: var(--font-ui); font-size: var(--fs-xs);
  letter-spacing: .12em; text-transform: uppercase; color: var(--c-ink-2); }
.tag .to small { display: block; font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--c-ink-2); font-weight: 400; font-style: normal; }
.tag .to-chosen { font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 700; color: var(--c-ok); }
.tag .to-use { appearance: none; font: 600 var(--fs-xs) var(--font-ui); color: var(--c-primary); background: transparent;
  border: 1.5px solid var(--c-primary); border-radius: var(--r-pill); padding: 6px 12px; min-height: 32px; cursor: pointer; }
.tag .to-use:hover { background: var(--c-primary); color: var(--c-paper); }
.tag .chosen { position: absolute; top: 6px; right: 6px; z-index: 2; background: var(--c-ok); color: #fff; font-size: var(--fs-xs);
  font-weight: 700; border-radius: var(--r-pill); padding: 4px 10px; box-shadow: var(--sh-1); }
/* arrows over the drawing */
.art-nav { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.art-nav[hidden] { display: none; }
.art-arrow { pointer-events: auto; position: absolute; top: 50%; translate: 0 -50%; appearance: none; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid rgb(var(--shadow-rgb) / .2); cursor: pointer;
  background: rgb(255 252 244 / .92); color: var(--c-primary); box-shadow: var(--sh-1);
  transition: opacity var(--t-fast), transform var(--t-fast); }
.art-arrow svg { width: 18px; height: 18px; }
.art-arrow.prev { left: -6px; } .art-arrow.next { right: -6px; }
.art-arrow:hover:not(:disabled) { transform: scale(1.06); }
.art-arrow:disabled { opacity: 0; pointer-events: none; }
.art-count { position: absolute; bottom: 4px; left: 50%; translate: -50% 0; font: 600 var(--fs-xs) var(--font-ui); color: var(--c-ink-2);
  background: rgb(255 252 244 / .85); border-radius: var(--r-pill); padding: 2px 9px; }
@media (hover: hover) and (pointer: fine) { /* desktop: arrows appear on hover/focus; touch keeps them visible */
  .tag .art-arrow:not(:disabled) { opacity: 0; }
  .tag:hover .art-arrow:not(:disabled), .tag:focus-within .art-arrow:not(:disabled) { opacity: 1; }
}
.carousel { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 1.5px solid var(--c-primary); background: transparent; cursor: pointer; position: relative; }
.dots button::after { content: ""; position: absolute; inset: -10px; } /* 32px touch target */
.dots button[aria-current="true"] { background: var(--c-primary); }
.dots .pending { border-style: dashed; opacity: .6; cursor: default; }

/* drawing placeholder: geometry and timing live in sketchLoop() (app.js); CSS only sets the look */
.sketch { overflow: visible; }
.sketch .sk-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sketch .sk-guide { stroke: var(--c-ink-2); stroke-width: .7; stroke-dasharray: 2 3; opacity: .45; }
.sketch .sk-ink { stroke: var(--c-primary); stroke-width: 1.9; }
.sketch .sk-ink.thin { stroke-width: 1.4; }
.sketch .sk-hatch { stroke: var(--c-primary); stroke-width: .9; opacity: .55; }
.sketch .sk-pencil { filter: drop-shadow(1.5px 2px 1.5px rgba(40, 30, 10, .25)); }
.sketch[data-idle] .sk-art { opacity: .35; }
.sketch[data-idle] .sk-pencil { display: none; }
@media (prefers-reduced-motion: reduce) {
  .sketch .sk-pencil { display: none; }
  .garland li[data-state="now"] .bulb::after { animation: none; }
}

.chars { display: grid; gap: var(--s-6) var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 36rem) { .chars { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .chars { grid-template-columns: repeat(3, 1fr); } }
.chars .tag-wrap { max-width: 22rem; width: 100%; margin-inline: auto; }
.chars .art-nav, .chars .tag .chosen { display: none; } /* the carousel row below the drawing has the arrows and dots */
.btn.choose[data-chosen] { opacity: 1; --bg: transparent; --fg: var(--c-ok); box-shadow: none; cursor: default; }
.more { display: grid; gap: var(--s-2); }
.tag .more { justify-items: center; text-align: center; padding: 0 var(--s-2); }
.tag .more summary { justify-content: center; }
/* "add another photo" nudge for a person the artist finds tricky: a quiet line and a small button, no box */
.nudge { display: grid; justify-items: center; gap: var(--s-2); text-align: center; padding: var(--s-3) var(--s-2) 0;
  border-top: 1px solid color-mix(in srgb, var(--c-ink) 10%, transparent); }
.nudge p { margin: 0; font-size: var(--fs-sm); color: var(--c-ink-2); text-wrap: pretty; max-width: 19rem; }
.nudge-go { gap: var(--s-2); cursor: pointer; }
.nudge-go:focus-within { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.nudge-go[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.more summary { cursor: pointer; color: var(--c-primary); font-weight: 600; font-size: var(--fs-sm); min-height: 32px; display: flex; align-items: center; }

/* ---- calm error panel ---------------------------------------------------------------------------------------- */
.notice { display: grid; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--c-accent) 8%, var(--c-card)); border: 1.5px solid color-mix(in srgb, var(--c-accent) 35%, transparent); }
.notice p { color: var(--c-ink); }
.problems { margin: 0; padding-left: 1.2em; color: var(--c-ink-2); font-size: var(--fs-sm); }

/* ---- toasts -------------------------------------------------------------------------------------------------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: var(--s-2); width: min(26rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); background: var(--c-primary); color: var(--c-on-primary); box-shadow: var(--sh-3);
  font-size: var(--fs-sm); animation: toast-in var(--t-med) var(--ease-out); }
.toast[data-kind="error"] { background: var(--c-accent); color: var(--c-on-accent); }
.toast[data-out] { opacity: 0; transform: translateY(8px); transition: all var(--t-med); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- debug drawer -------------------------------------------------------------------------------------------- */
.debug { position: fixed; z-index: 80; right: 0; bottom: 0; width: min(30rem, 100vw); max-height: 70vh; overflow: auto;
  background: #16130f; color: #e8e0d0; font: 12px/1.45 ui-monospace, Menlo, monospace; padding: 12px 14px; border-top-left-radius: 10px;
  box-shadow: 0 -10px 40px rgb(0 0 0 / .4); }
.debug a { color: #9fd3b4; }
.debug h4 { margin: 8px 0 4px; font-size: 12px; color: #e9b949; }
.debug .ev { border-top: 1px solid #2c2620; padding: 3px 0; white-space: pre-wrap; word-break: break-word; }
.debug .ev.err { color: #ff9c8f; }
.debug .x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: #e8e0d0; font-size: 18px; cursor: pointer; }
.debug pre { white-space: pre-wrap; margin: 2px 0 0; color: #ffb4a8; }

.footer { padding-block: var(--s-7) var(--s-6); color: var(--c-ink-2); font-size: var(--fs-xs); }

/* ---- making: status line, progress and links under the workshop scene ------------------------------------- */
.mk-status { margin: 0; min-height: 2.5em; font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.95rem); line-height: 1.25; color: var(--c-primary); text-wrap: balance;
  font-variation-settings: "SOFT" 100, "WONK" 1; }
.mk-progress { display: grid; gap: var(--s-2); }
.mk-meta { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-sm);
  color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.mk-bar { position: relative; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--c-line) 55%, transparent); }
.mk-bar > i { position: relative; display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c-primary);
  transition: width 1.2s var(--ease-out); }
.mk-bar > i::after { /* a small lit bulb at the leading edge */ content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px;
  margin-top: -5px; border-radius: 50%; background: var(--c-glow); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--c-glow) 70%, transparent); }
.mk-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.mk-leave { margin: 0; font-size: var(--fs-xs); color: var(--c-ink-2); }
.linkbtn { appearance: none; border: 0; background: none; padding: 0; margin-left: 2px; font: inherit; font-weight: 600; color: var(--c-primary);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { text-decoration-thickness: 2px; }
@media (max-width: 59.99rem) { .mk-status { min-height: 0; } }

/* ---- full-screen page viewer -------------------------------------------------------------------------------- */
.pv { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 64px 64px 56px;
  background: rgb(26 20 13 / .94); }
.pv[data-open] { display: grid; }
/* the page: picture above, the page's whole text below. The text takes the height it needs; the picture shrinks to
   fit what's left (never below ~30% of the page). Only on tiny screens does the text scroll, as a last resort. */
.pv-page { margin: 0; width: min(100%, 860px); height: calc(100dvh - 120px); max-height: 1100px; display: flex; flex-direction: column;
  background: #fbf6ea; border-radius: 4px; overflow: hidden; box-shadow: 0 30px 80px rgb(0 0 0 / .55); }
.pv-art { position: relative; flex: 1 1 0; min-height: 30%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(closest-side, #f1e6cc, #fbf6ea); padding: var(--s-3) var(--s-3) 0; }
.pv-art img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; aspect-ratio: 1; object-fit: contain;
  min-height: 0; }
.pv-art img.proof { filter: grayscale(.7) sepia(.4); }
.pv-badge { position: absolute; left: 12px; bottom: 12px; background: rgb(255 252 244 / .94); border-radius: var(--r-pill);
  padding: 5px 12px; font-size: var(--fs-sm); color: var(--c-ink); }
.pv-text { flex: 0 1 auto; min-height: 0; overflow: auto; padding: var(--s-4) var(--s-5); font-family: var(--font-display);
  font-size: var(--fs-md); line-height: var(--lh-story); color: var(--c-ink); }
.pv-text > * { max-width: 46rem; }
.pv-label { display: block; font: 600 var(--fs-xs) var(--font-ui); color: var(--c-accent); margin-bottom: 2px; }
.pv-title { display: block; font-size: var(--fs-lg); color: var(--c-primary); line-height: 1.2; }
.pv-x, .pv-nav { appearance: none; position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border-radius: 50%; border: 1px solid rgb(255 252 244 / .3); background: rgb(255 252 244 / .08); color: #fbf6ea; cursor: pointer; }
.pv-x:hover, .pv-nav:hover { background: rgb(255 252 244 / .18); }
.pv-x svg, .pv-nav svg { width: 20px; height: 20px; }
.pv-x { top: 12px; right: 12px; }
.pv-nav { top: 50%; translate: 0 -50%; }
.pv-nav.prev { left: 10px; } .pv-nav.next { right: 10px; }
.pv :focus-visible { outline-color: var(--c-glow); }
.pv-count { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0 auto; text-align: center; color: rgb(255 252 244 / .8);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .pv { padding: 64px 12px 80px; }
  .pv-nav { top: auto; bottom: 10px; translate: none; }
  .pv-nav.prev { left: 12px; } .pv-nav.next { right: 12px; }
  .pv-count { bottom: 24px; }
  .pv-page { height: calc(100dvh - 144px); }
  .pv-text { padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); }
}

/* ---- masthead link (pages without a run) --------------------------------------------------------------------- */
.mast-link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-primary); text-decoration: none; }
.mast-link:hover { text-decoration: underline; }

/* ---- the bookshelf: every finished book, as books ------------------------------------------------------------- */
.shelf-page { padding-block: var(--s-4) var(--s-6); }
.shelf-h { font-size: var(--fs-2xl); }
.shelf { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-7) var(--s-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.shelf-book { position: relative; display: grid; gap: var(--s-4); align-content: start; }
.shelf-cover { position: relative; aspect-ratio: 1; border-radius: 2px 5px 5px 2px; background: var(--c-paper-2);
  /* the page block peeking out behind the cover, then the shadow on the table */
  box-shadow: 3px 3px 0 -1px #fbf4e3, 3px 3px 0 0 var(--c-line), 6px 6px 0 -1px #fbf4e3, 6px 6px 0 0 var(--c-line), var(--sh-2);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out); }
.shelf-cover img, .shelf-blank { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.shelf-blank { background: var(--orn-divider) center / 50% no-repeat, var(--c-paper-2); }
.shelf-cover::after { /* spine: a hinge crease and a little shine along the left edge */ content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / .28), rgb(0 0 0 / .05) 3%, rgb(255 255 255 / .22) 4.5%, transparent 7%, transparent 94%, rgb(0 0 0 / .08)); }
.shelf-book:hover .shelf-cover { transform: translateY(-4px) rotate(-.8deg);
  box-shadow: 3px 3px 0 -1px #fbf4e3, 3px 3px 0 0 var(--c-line), 6px 6px 0 -1px #fbf4e3, 6px 6px 0 0 var(--c-line), var(--sh-3); }
.shelf-book:has(.shelf-title a:focus-visible) .shelf-cover { outline: 3px solid var(--c-focus); outline-offset: 6px; }
.shelf-info { display: grid; gap: var(--s-2); }
.shelf-title { font-size: var(--fs-lg); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-title a { color: inherit; text-decoration: none; }
.shelf-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* the whole book opens it */
.shelf-title a:focus-visible { outline: none; }
.shelf-book:hover .shelf-title a { text-decoration: underline; text-decoration-thickness: 1px; }
.shelf-meta { display: grid; font-size: var(--fs-sm); color: var(--c-ink-2); }
.shelf-family { color: var(--c-ink); font-weight: 600; }
.shelf-note { font-size: var(--fs-sm); font-style: italic; color: var(--c-ink-2); }
.shelf-links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-sm); }
.shelf-links a { color: var(--c-ink-2); display: inline-flex; min-height: 32px; align-items: center; }
.shelf-links a:hover { color: var(--c-primary); }
.shelf-empty { display: grid; justify-items: start; gap: var(--s-4); padding: var(--s-6) 0; }
.shelf-empty .ornament { margin: 0; width: 160px; }
.shelf-empty h2 { font-size: var(--fs-xl); }
@media (max-width: 35.99rem) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-4); }
  .shelf-title { font-size: var(--fs-md); }
  .shelf-meta, .shelf-note, .shelf-links { font-size: var(--fs-xs); }
}
#making > .notice { max-width: 40rem; }

/* ---- style step: one row per style, the same three people in each ------------------------------------------------- */
.styles { display: grid; gap: var(--s-4); margin-bottom: var(--s-6); }
@media (min-width: 52rem) { .styles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.style-row { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; display: grid; gap: var(--s-3);
  align-content: start; padding: var(--s-4); background: var(--c-card);
  border: 1.5px solid color-mix(in srgb, var(--c-line) 70%, transparent); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: border-color var(--t-med), box-shadow var(--t-med), transform var(--t-med) var(--ease-out); }
.style-row:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.style-row[aria-checked="true"] { border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-glow) 55%, transparent), var(--sh-2); }
.style-row[data-locked] { opacity: .45; cursor: not-allowed; transform: none; }
.style-text { display: grid; gap: 2px; }
.style-name { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-size: var(--fs-lg);
  font-weight: 600; color: var(--c-primary); }
.style-tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--c-on-primary);
  background: var(--c-primary); transform: scale(0); transition: transform var(--t-med) var(--ease-out); }
.style-tick svg { width: 14px; height: 14px; }
.style-row[aria-checked="true"] .style-tick { transform: scale(1); }
.style-tag { color: var(--c-ink-2); font-size: var(--fs-sm); }
.style-note { font-size: var(--fs-xs); color: var(--c-accent); margin-top: 2px; }
.style-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.style-pic { aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--c-paper-2); }
.style-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; display: block;
  transform: scale(1.7); transform-origin: 50% 6%; } /* heads and shoulders: the faces are what to compare */
@media (max-width: 39.99rem) { .style-row { padding: var(--s-3); } .style-people { gap: 6px; } }

/* ---- combobox: free-text field with design-system suggestions (replaces the native datalist) --------------------- */
.combo { position: relative; }
.combo .input { padding-right: 2.75rem; }
.combo-toggle { position: absolute; top: 0; right: 0; width: 2.75rem; height: 100%; min-height: 48px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--c-ink-2); cursor: pointer; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.combo-toggle svg { width: 18px; height: 18px; transition: transform var(--t-med) var(--ease-out); }
.combo[data-open] .combo-toggle svg { transform: rotate(180deg); }
.combo-toggle:hover { color: var(--c-primary); }
.combo-list { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: var(--s-1);
  list-style: none; max-height: 16rem; overflow-y: auto; overscroll-behavior: contain; background: var(--c-card);
  border: 1.5px solid var(--c-line); border-radius: var(--r-sm); box-shadow: var(--sh-2); }
.combo-list [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-3); border-radius: 4px; cursor: pointer; color: var(--c-ink); font-size: var(--fs-md); }
.combo-list [role="option"] svg { width: 16px; height: 16px; color: var(--c-primary); visibility: hidden; flex: none; }
.combo-list [role="option"][data-current] { font-weight: 600; color: var(--c-primary); }
.combo-list [role="option"][data-current] svg { visibility: visible; }
.combo-list [role="option"][aria-selected="true"] { background: color-mix(in srgb, var(--c-primary) 9%, transparent);
  box-shadow: inset 2px 0 0 var(--c-primary); }
.combo[data-open] .input { border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-focus) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { .combo-toggle svg { transition: none; } }



/* ---- Santa's workshop scene (workshop.js) ------------------------------------------------------------------------- */
.starring { margin: 0 0 var(--s-5); }
.starring-h { margin: 0 0 var(--s-3); font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .28em;
  text-transform: uppercase; color: var(--c-accent); }
.stars { display: flex; gap: var(--s-4); overflow-x: auto; padding: 4px 4px var(--s-2); scrollbar-width: none; }
.stars::-webkit-scrollbar { display: none; }
.star { margin: 0; flex: 0 0 auto; display: grid; justify-items: center; gap: var(--s-2); }
.star-frame { display: block; height: clamp(140px, 11vw, 180px); aspect-ratio: 832 / 1216; padding: 6px;
  background: #fbf7ee; border-radius: 6px; box-shadow: 0 0 0 1px rgb(var(--shadow-rgb) / .12), 0 1px 0 rgb(var(--shadow-rgb) / .1),
  0 14px 26px -12px rgb(var(--shadow-rgb) / .45); transform: rotate(var(--tilt, -1.2deg)); }
.star:nth-child(2n) .star-frame { --tilt: 1.4deg; }
.star:nth-child(3n) .star-frame { --tilt: -.4deg; }
.star-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; border-radius: 3px; }
.star figcaption { display: grid; text-align: center; line-height: 1.2; }
.star figcaption b { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--c-primary); }
.star figcaption span { font-size: var(--fs-xs); color: var(--c-ink-2); }
@media (max-width: 47.99rem) { .star-frame { height: 132px; } .stars { gap: var(--s-3); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); } }

.wk { position: relative; margin: 0 0 var(--s-5); }
.wk-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wk-scroll { overflow-x: auto; overflow-y: hidden; border-radius: var(--r-md); box-shadow: var(--sh-2);
  scrollbar-width: thin; overscroll-behavior-x: contain; }
.wk-scene { position: relative; width: 100%; min-width: 0; overflow: hidden; background: #f3ead8; contain: layout paint; }
@media (max-width: 47.99rem) { .wk-scroll { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; } .wk-scene { width: 1060px; } }
/* Pip's easel: the starring cast pinned to the canvas */
.wk-easel { position: absolute; left: 5.2%; top: 40.5%; width: 8.6%; height: 19%; z-index: 1; display: flex; flex-wrap: wrap;
  align-content: center; justify-content: center; gap: 3%; transform: skewY(-3deg) rotate(-2deg); }
.wk-easel img { width: 30%; aspect-ratio: 832 / 1216; object-fit: cover; object-position: 50% 0; border-radius: 1px;
  box-shadow: 0 1px 2px rgb(60 40 25 / .35); }
.wk-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; pointer-events: none; }

/* elves: each a puppet SVG whose feet sit at the wrapper's origin; the script sets translate + depth scale per frame */
.wk-elves { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wk-elf { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.wk-pup { position: absolute; overflow: visible; transform-origin: 50% 96%; max-width: none; max-height: none; }
.wk-pup .shadow { fill: rgb(60 40 25 / .22); }
.wk-tag { position: absolute; left: 0; top: 4px; transform: translateX(-50%); font-family: var(--font-display); font-weight: 600;
  font-size: clamp(9px, .85vw, 13px); color: #3a2a22; white-space: nowrap; background: rgb(251 247 238 / .88); padding: 0 .45em;
  border-radius: 999px; box-shadow: 0 1px 2px rgb(60 40 25 / .2); }
.wk-elf[data-k="santa"] .wk-tag { background: #b8302c; color: #fbf6ea; }
.wk-bubbles { position: absolute; inset: 0; z-index: 2000; pointer-events: none; }
.wk-bubbles .wk-say { position: absolute; left: 0; top: 0; bottom: auto; transform: none; margin-top: -10px; }

/* speech bubbles: ink outline on cream, tail pointing down at the speaker */
.wk-say { width: max-content; max-width: clamp(150px, 19vw, 270px); padding: .5em .8em; background: #fffdf7; color: #2b1d16;
  font-family: var(--font-display); font-style: italic; font-size: clamp(12px, 1.1vw, 16px); line-height: 1.28;
  border: 1.6px solid #3a2a22; border-radius: 14px 16px 15px 13px / 13px 15px 16px 14px; box-shadow: 2px 3px 0 rgb(60 40 25 / .18);
  text-wrap: balance; pointer-events: none; }
.wk-say::after { content: ""; position: absolute; left: calc(50% - var(--shift, 0px)); top: 100%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  background: #fffdf7; border: solid #3a2a22; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.wk-say.pop { animation: wk-pop .32s var(--ease-out); }
@keyframes wk-pop { from { opacity: 0; scale: .9; } }

/* the rolling ladder and the gift cart */
.wk-ladder { position: absolute; left: 0; z-index: 810; will-change: transform; pointer-events: none; }
.wk-ladder svg { width: 100%; height: 100%; display: block; filter: drop-shadow(2px 3px 0 rgb(60 40 25 / .2)); }
.wk-cart { position: absolute; left: 0; top: 0; width: 9%; display: none; z-index: 924; will-change: transform; pointer-events: none; }
.wk-cart svg { width: 100%; display: block; }

/* snow in the windows; a cat and a reindeer peek in now and then */
.wk-win { position: absolute; overflow: hidden; pointer-events: none; z-index: 1; border-radius: 40% 40% 0 0 / 22% 22% 0 0; }
.wk-flake { position: absolute; top: -6%; width: calc(5px * var(--s)); height: calc(5px * var(--s)); border-radius: 50%;
  background: #fff; opacity: .9; animation: wk-snow 8s linear infinite; }
@keyframes wk-snow { to { transform: translate(14px, 1300%); } }
.wk-deer { position: absolute; bottom: -40%; left: 30%; width: 34%; aspect-ratio: 1; animation: wk-deer 47s ease-in-out infinite;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cg stroke='%233a2a22' stroke-width='2' stroke-linecap='round' fill='none'%3E%3Cpath d='M22 22 L14 6 M18 14 L10 12 M38 22 L46 6 M42 14 L50 12'/%3E%3C/g%3E%3Cellipse cx='30' cy='34' rx='12' ry='14' fill='%23a8743f' stroke='%233a2a22' stroke-width='2'/%3E%3Ccircle cx='25' cy='31' r='2' fill='%233a2a22'/%3E%3Ccircle cx='35' cy='31' r='2' fill='%233a2a22'/%3E%3Ccircle cx='30' cy='44' r='4' fill='%23c0392f' stroke='%233a2a22' stroke-width='1.5'/%3E%3C/svg%3E"); }
@keyframes wk-deer { 0%, 88%, 100% { transform: translateY(0); } 91%, 96% { transform: translateY(-62%); } }
.wk-cat { position: absolute; left: 1.2%; top: 66%; width: 3.2%; aspect-ratio: 1; z-index: 2; animation: wk-cat 31s ease-in-out infinite; pointer-events: none;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M8 30 L8 12 L14 18 Q20 15 26 18 L32 12 L32 30 Z' fill='%23e08a46' stroke='%233a2a22' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='15' cy='24' r='1.8' fill='%233a2a22'/%3E%3Ccircle cx='25' cy='24' r='1.8' fill='%233a2a22'/%3E%3Cpath d='M18 28 q2 2 4 0' stroke='%233a2a22' stroke-width='1.4' fill='none'/%3E%3C/svg%3E");
  clip-path: inset(0 0 0 0); transform: translateY(70%); opacity: 0; }
@keyframes wk-cat { 0%, 80%, 100% { transform: translateY(70%); opacity: 0; } 83%, 92% { transform: translateY(0); opacity: 1; } }

/* cork board cards */
.wk-card { position: absolute; width: 2.4%; aspect-ratio: 4 / 5; margin-left: -1.2%; background: #fdf8ec; z-index: 1;
  box-shadow: 0 1px 0 rgb(60 40 25 / .25), 0 3px 6px -2px rgb(60 40 25 / .35); transform: rotate(var(--r)); display: grid; place-items: center;
  background-image: repeating-linear-gradient(transparent 0 22%, rgb(60 40 25 / .18) 22% 25%); }
.wk-card::before { content: ""; position: absolute; top: -8%; left: 50%; width: 22%; aspect-ratio: 1; margin-left: -11%; border-radius: 50%;
  background: #b2423f; box-shadow: 0 1px 1px rgb(0 0 0 / .3); }
.wk-card b { font-family: var(--font-display); font-size: clamp(7px, .9vw, 12px); color: #3c6488; }
.wk-card.pop { animation: wk-pin .45s var(--ease-out); }
.wk-card.taken { opacity: .35; filter: grayscale(.6); transition: opacity .6s; }
@keyframes wk-pin { from { transform: translateY(-14px) rotate(-10deg) scale(1.3); opacity: 0; } }

/* the clothesline */
.wk-page { position: absolute; z-index: 2; padding: 0; border: 0; background: none; cursor: zoom-in; margin-left: -1.7%;
  transform-origin: 50% 0; animation: wk-sway var(--sw, 3.6s) ease-in-out infinite alternate; }
.wk-page img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #fdf8ec; border: 2px solid #fdf8ec;
  box-shadow: 0 1px 0 rgb(60 40 25 / .2), 0 6px 10px -4px rgb(60 40 25 / .45); }
.wk-peg { position: absolute; top: -5px; left: 50%; width: 5px; height: 12px; margin-left: -2.5px; background: #b98c5a;
  border: 1px solid #3a2a22; border-radius: 1px; }
.wk-page:hover img, .wk-page:focus-visible img { outline: 3px solid var(--c-glow); outline-offset: 1px; }
.wk-page.arrive { animation: wk-arrive .7s var(--ease-out), wk-sway var(--sw, 3.6s) ease-in-out .7s infinite alternate; }
.wk-page.sparkle { animation: wk-arrive .7s var(--ease-out), wk-sway var(--sw, 3.6s) ease-in-out .7s infinite alternate; }
.wk-page.sparkle::after { content: "✦ ✧ ✦"; position: absolute; left: 50%; top: 40%; transform: translateX(-50%); white-space: nowrap;
  color: #e2b75a; font-size: clamp(10px, 1.4vw, 20px); text-shadow: 0 0 6px #fff3c4; animation: wk-spark 1.8s ease-out forwards; pointer-events: none; }
@keyframes wk-spark { from { opacity: 1; transform: translate(-50%, 0) scale(.6); } to { opacity: 0; transform: translate(-50%, -140%) scale(1.4); } }
@keyframes wk-sway { from { transform: rotate(-2.6deg); } to { transform: rotate(2.6deg); } }
@keyframes wk-arrive { 0% { transform: translateY(30px) scale(.6) rotate(-14deg); opacity: .4; } 70% { transform: rotate(6deg); } }
.wk-fly { position: absolute; z-index: 5; pointer-events: none; transition: transform .9s var(--ease-page), opacity .9s ease-in; }
.wk-fly img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 2px solid #fdf8ec; }

/* the press: a lever pull and a sheet sliding out of the tray */
.wk-lever { position: absolute; left: 63.4%; top: 44%; width: .55%; height: 10%; background: #6e4a2a; border: 1px solid #3a2a22;
  border-radius: 3px; transform-origin: 50% 100%; transform: rotate(-18deg); z-index: 2; }
.wk-lever::before { content: ""; position: absolute; top: -18%; left: 50%; width: 220%; aspect-ratio: 1; margin-left: -110%;
  border-radius: 50%; background: #b2423f; border: 1px solid #3a2a22; }
.wk-lever.pull { animation: wk-lever .9s var(--ease-out); }
@keyframes wk-lever { 40% { transform: rotate(32deg); } }
.wk-sheet { position: absolute; left: 70.2%; top: 70.5%; width: 4.2%; z-index: 2; opacity: 0; pointer-events: none;
  transform: translateY(-60%) scaleY(.2); transform-origin: 50% 0; }
.wk-sheet img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 2px solid #fdf8ec; box-shadow: 0 2px 6px rgb(60 40 25 / .35); }
.wk-sheet.out { animation: wk-print .9s var(--ease-out) forwards; }
@keyframes wk-print { 0% { opacity: 1; transform: translateY(-60%) scaleY(.2); } 100% { opacity: 1; transform: none; } }

/* the bound book on the bindery table */
.wk-book { position: absolute; left: 90.5%; top: 58.5%; width: 7%; aspect-ratio: 1; margin-left: -3.5%; margin-top: -7%; z-index: 2;
  background: linear-gradient(90deg, #1e3a2c 0 9%, #2f5a43 9% 100%); border: 1.6px solid #3a2a22; border-radius: 3px 6px 6px 3px;
  box-shadow: 4px 5px 0 -1px #f4ead2, 4px 5px 0 0 #3a2a22, 0 10px 18px -6px rgb(60 40 25 / .5); display: grid; place-items: center;
  transform: rotate(-4deg); }
.wk-book::after { content: ""; position: absolute; inset: 44% 0 auto; height: 12%; background: #b2423f; }
.wk-book-title { position: relative; z-index: 1; padding: 0 12%; text-align: center; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(6px, .7vw, 11px); line-height: 1.1; color: #f1d58f; }
.wk-book.pop { animation: wk-book 1s var(--ease-out); }
@keyframes wk-book { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 70% { transform: scale(1.12) rotate(2deg); } }

.wk-foot { display: grid; gap: var(--s-4); }
.wk-log { font-size: var(--fs-sm); color: var(--c-ink-2); }
.wk-log summary { cursor: pointer; width: max-content; font-weight: 600; color: var(--c-primary); }
.wk-log ol { margin: var(--s-2) 0 0; padding-left: 1.4em; max-height: 14rem; overflow: auto; display: grid; gap: 2px; }
.pv-art img { transition: transform .12s ease-out; transform-origin: 50% 50%; }

@media (prefers-reduced-motion: reduce) {
  .wk-elf *, .wk-page, .wk-page.arrive, .wk-page.sparkle, .wk-page.sparkle::after, .wk-card.pop, .wk-book.pop, .wk-say.pop, .wk-lever.pull,
  .wk-flake, .wk-deer, .wk-cat { animation: none !important; }
  .wk-sheet.out { animation: none; opacity: 1; transform: none; }
}

/* making: status + cast in one row above the workshop, so the shop floor is in view on a laptop */
.wrap[data-step="making"] .stephead { margin-bottom: var(--s-3); }
.wrap[data-step="making"] .stephead h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); }
.mk-top { display: grid; gap: var(--s-4); margin-bottom: var(--s-4); align-items: end; }
@media (min-width: 60rem) { .mk-top { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6); } }
.mk-now { display: grid; gap: var(--s-3); align-content: end; }
.mk-now .mk-status { min-height: 0; font-size: clamp(1.2rem, 1rem + .9vw, 1.6rem); }
.mk-top .starring { margin: 0; }
.mk-top .star-frame { height: clamp(118px, 9.2vw, 150px); }
.mk-top .star figcaption b { font-size: var(--fs-md); }
@media (min-width: 60rem) { .wrap[data-step="making"] .garland { margin-bottom: var(--s-4); } }


/* ---- workshop v3: painted sprites, one card with the candy-cane meter and the status line under the scene ------ */
.wk-spr { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.wk-spr img { position: absolute; left: 0; top: 0; max-width: none; height: auto; display: none; pointer-events: none;
  width: auto; transform-origin: 0 0;
  transform: translate(calc(var(--ax) * var(--k) * -1), calc(var(--ay) * var(--k) * -1)) scale(var(--k));
  filter: drop-shadow(0 3px 0 rgb(60 40 25 / .14)); }
.wk-spr img.on { display: block; }
.wk-spr::before { /* contact shadow on the floor */ content: ""; position: absolute; left: calc(-75px * var(--k)); top: calc(-12px * var(--k));
  width: calc(150px * var(--k)); height: calc(24px * var(--k)); border-radius: 50%; background: rgb(60 40 25 / .22); filter: blur(2px); }
.wk-carry, .wk-hold { position: absolute; pointer-events: none; }
.wk-carry { left: calc(10px * var(--k)); top: calc(-250px * var(--k)); width: calc(150px * var(--k)); }
.wk-hold { left: calc(60px * var(--k)); top: calc(-260px * var(--k)); width: calc(60px * var(--k)); }
.wk-carry svg, .wk-hold svg { display: block; width: 100%; height: auto; overflow: visible; }
.wk-elf .wk-tag { top: 8px; font-size: clamp(.62rem, .5rem + .35vw, .82rem); }

.wk-frame { position: relative; margin: 0 0 var(--s-5); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-2);
  background: linear-gradient(#efe3c7, #f6eedc); }
.wk-frame .wk { margin: 0; }
.wk-frame .wk-scroll { border-radius: 0; box-shadow: none; }
.wk-frame .mk-now { display: grid; gap: var(--s-3); padding: var(--s-4) clamp(16px, 3vw, 36px) var(--s-5);
  border-top: 3px solid #7a4f2a; background:
    repeating-linear-gradient(90deg, rgb(122 79 42 / .06) 0 2px, transparent 2px 90px), linear-gradient(#f6eedc, #f1e6cd); }
.wk-frame .mk-status { text-align: center; min-height: 1.3em; color: #2f5a43; transition: opacity .35s; max-width: none;
  width: 100%; justify-self: stretch; text-wrap: pretty; font-size: clamp(1.15rem, .95rem + .8vw, 1.55rem); }
.wk-frame .mk-sub { margin: -4px 0 0; text-align: center; justify-self: stretch; max-width: none; width: 100%; font-size: var(--fs-sm); color: #6b5440; min-height: 1.2em; }
.wk-frame .mk-meta { justify-content: space-between; color: #6b5440; }

/* the candy-cane thermometer: a glass tube that fills with a striped, gently flowing candy cane; hook at the end */
.wk-frame .mk-bar { height: 26px; margin-right: 34px; border-radius: 13px; background: rgb(255 255 255 / .55);
  box-shadow: inset 0 2px 5px rgb(60 40 25 / .25), inset 0 -2px 0 rgb(255 255 255 / .8), 0 0 0 2px #e6d6b6; overflow: visible; }
.wk-frame .mk-bar > i { border-radius: 13px; min-width: 26px; position: relative;
  background: repeating-linear-gradient(-45deg, #c0392f 0 11px, #fdf8ee 11px 22px);
  background-size: 31.1px 31.1px; animation: mk-candy 1.6s linear infinite;
  box-shadow: inset 0 3px 3px rgb(255 255 255 / .55), inset 0 -4px 5px rgb(90 20 15 / .25); }
.wk-frame .mk-bar > i::after { right: -12px; width: 24px; height: 24px; margin-top: -12px; border-radius: 0; background: none; box-shadow: none;
  content: "★"; color: #e8b33a; font-size: 26px; line-height: 24px; text-align: center; text-shadow: 0 0 10px rgb(255 214 120 / .9), 0 1px 0 #8a5a12;
  animation: mk-twinkle 1.8s ease-in-out infinite; }
.wk-frame .mk-bar { margin-right: 18px; }
.wk-frame .mk-hook { position: absolute; right: -26px; top: -9px; width: 48px; height: 40px; pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 2px rgb(60 40 25 / .22)); }
.wk-frame .mk-hook svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes mk-candy { to { background-position: 31.1px 0; } }
@keyframes mk-twinkle { 50% { transform: scale(1.18) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .wk-frame .mk-bar > i, .wk-frame .mk-bar > i::after { animation: none; } }

/* ==== onboarding v2 (13 Oct): photos -> who's who -> look -> their year -> characters -> checkout ================== */
/* landing: several photos */
.up-lede { margin: calc(-1 * var(--s-2)) 0 0; font-size: var(--fs-sm); color: var(--c-ink-2); line-height: var(--lh-ui); }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.thumbs li { position: relative; }
.thumbs .th { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--c-paper-2, #ece6da); box-shadow: var(--sh-1); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th i { font: 600 var(--fs-xs) var(--font-ui); font-style: normal; color: var(--c-ink-2); }
.thumbs li:first-child .th { outline: 2.5px solid var(--c-glow); outline-offset: 2px; }
.thumbs button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c-ink); color: #fff; font: 700 15px/24px var(--font-ui); box-shadow: var(--sh-1); }

/* people step: photo + tips, then one card per person */
.people-top { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 60rem) { .people-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.people-top .photo-stage img { max-height: 52vh; }
.tips { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-2); font-size: var(--fs-sm); color: var(--c-ink-2); line-height: var(--lh-ui); }
.tips b { color: var(--c-ink); }
.tips li::marker { color: var(--c-accent); font-weight: 700; }
.who-list { display: grid; gap: var(--s-4); margin-top: var(--s-6); }
@media (min-width: 52rem) { .who-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; } }
.who-card { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4) var(--s-5) var(--s-5);
  animation: who-in var(--t-med) var(--ease-out) both; }
@keyframes who-in { from { opacity: 0; transform: translateY(6px); } }
.wc-head { display: flex; align-items: center; gap: var(--s-3); }
.wc-face { position: relative; flex: none; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.wc-face canvas { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--c-primary); background: var(--c-paper-2, #ece6da); display: block; }
.wc-face:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.who-n { position: absolute; left: -4px; top: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c-accent); color: var(--c-on-accent); font: 700 var(--fs-xs)/1 var(--font-ui); box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.wc-title { flex: 1; min-width: 0; font-size: var(--fs-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-remove { flex: none; margin-left: var(--s-4); appearance: none; border: 0; background: none; font: 600 var(--fs-sm) var(--font-ui);
  color: var(--c-ink-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-pill); cursor: pointer; min-height: 40px; }
.wc-remove:hover { color: var(--c-danger); background: color-mix(in srgb, var(--c-danger) 9%, transparent); }
.wc-remove:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.wc-form { display: grid; gap: var(--s-4); }
.wc-row { display: grid; gap: var(--s-3); }
@media (min-width: 30rem) { .wc-row { grid-template-columns: 1fr 1fr; } }
.wc-form .field { display: grid; gap: var(--s-1); margin: 0; }
.wc-form .label { margin: 0; }
.wc-form .err:empty { display: none; }
.wc-form .err { font-size: var(--fs-xs); color: var(--c-danger); font-weight: 600; }
.who-card .who-photos { margin-top: auto; }
.who-photos { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3);
  padding-top: var(--s-3); border-top: 1px dashed var(--c-line); }
.who-extras { display: flex; gap: var(--s-2); }
.who-extras:empty { display: none; }
.who-extras img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c-ok); }
.addphoto { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-pill);
  border: 1.5px dashed var(--c-primary); color: var(--c-primary); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; background: transparent;
  transition: background var(--t-fast); }
.addphoto:hover { background: color-mix(in srgb, var(--c-primary) 7%, transparent); }
.addphoto:focus-within { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.addphoto svg { width: 20px; height: 20px; flex: none; }
.addphoto small { font-weight: 400; color: var(--c-ink-2); }
.addphoto[data-rec] { border-style: solid; background: color-mix(in srgb, var(--c-glow) 18%, transparent); }
.addphoto[data-busy] { opacity: .7; pointer-events: none; }
.rec { font-size: var(--fs-xs); font-weight: 700; color: #7a4f12; background: color-mix(in srgb, var(--c-glow) 35%, transparent);
  padding: 3px 10px; border-radius: var(--r-pill); }
.rec::before { content: "★ "; }

/* chips: pronoun and age band */
.chips { border: 0; padding: 0; margin: 0; min-width: 0; }
.chips legend { padding: 0; margin-bottom: var(--s-2); }
.chipset { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pill { position: relative; }
.pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-grid; place-items: center; min-height: 40px; min-width: 3.4rem; padding: 0 var(--s-4); border-radius: var(--r-pill);
  border: 1.5px solid var(--c-line); background: var(--c-card); font-size: var(--fs-sm); transition: background var(--t-fast), border-color var(--t-fast); }
.pill:hover span { border-color: var(--c-primary); }
.pill input:checked + span { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); font-weight: 600; }
.pill input:focus-visible + span { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.chips[data-invalid] .pill span { border-color: var(--c-danger); }

/* trays: people left out, other photos */
.tray { margin-top: var(--s-6); display: grid; gap: var(--s-3); }
.tray h3 { font-size: var(--fs-lg); }
.tray-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.out-chip { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px var(--s-4) 4px 4px; border-radius: var(--r-pill);
  border: 1.5px dashed var(--c-line); background: var(--c-card); cursor: pointer; font: inherit; color: var(--c-ink); min-height: 52px; }
.out-chip canvas { width: 44px; height: 44px; border-radius: 50%; filter: grayscale(.7); opacity: .8; }
.out-chip b { color: var(--c-primary); font-size: var(--fs-sm); }
.out-chip:hover { border-color: var(--c-primary); }
.up-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.up { margin: 0; background: var(--c-card); border-radius: var(--r-md); box-shadow: var(--sh-1); overflow: hidden; }
.up img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.up figcaption { padding: var(--s-3); display: grid; gap: var(--s-2); }
.up-q { font-weight: 700; font-size: var(--fs-sm); }
.up-done { color: var(--c-ok); font-weight: 700; }
.pill-btn { min-height: 38px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1.5px solid var(--c-line); background: var(--c-card);
  font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.pill-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* story step: the tip and the idea chips */
.tipcard { margin: 0 0 var(--s-6); padding: var(--s-5); border-radius: var(--r-lg); background: color-mix(in srgb, var(--c-glow) 12%, var(--c-card));
  border: 1px solid color-mix(in srgb, var(--c-glow) 45%, transparent); display: grid; gap: var(--s-2); }
.tipcard h3 { font-size: var(--fs-lg); }
.tipcard > p { margin: 0; color: var(--c-ink-2); }
.tip-compare { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
@media (min-width: 48rem) { .tip-compare { grid-template-columns: 1fr 2fr; } }
.tip-compare p { margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--c-card); font-family: var(--font-display); font-style: italic; }
.tip-compare span { display: block; font: 700 var(--fs-xs)/1.6 var(--font-ui); font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.tip-compare .vague span { color: var(--c-ink-2); } .tip-compare .vague { color: var(--c-ink-2); text-decoration: line-through; text-decoration-color: rgb(0 0 0 / .25); }
.tip-compare .great span { color: var(--c-ok); }
.person-card h3 .role { font: 400 var(--fs-sm) var(--font-ui); color: var(--c-ink-2); margin-left: 6px; }
.ideas { display: grid; gap: var(--s-2); margin: var(--s-2) 0 var(--s-4); }
.ideas-h { font-size: var(--fs-sm); color: var(--c-ink-2); }
.idea-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.idea { text-align: left; display: grid; gap: 1px; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); border: 1.5px solid var(--c-line);
  background: var(--c-card); font: inherit; font-size: var(--fs-sm); color: var(--c-ink); cursor: pointer; max-width: 100%;
  transition: border-color var(--t-fast), transform var(--t-fast); }
.idea small { font: 700 10.5px/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent); }
.idea:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.idea:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* checkout */
.checkout { max-width: 46rem; }
.co-card { display: grid; gap: var(--s-5); padding: var(--s-6); }
.co-cast { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; padding-bottom: var(--s-4); border-bottom: 1px dashed var(--c-line); }
.co-star { margin: 0; display: grid; justify-items: center; gap: var(--s-1); width: 92px; }
.co-star img, .co-blank { width: 92px; height: 132px; object-fit: cover; object-position: 50% 6%; border-radius: var(--r-sm); background: #fff;
  box-shadow: var(--sh-1); padding: 4px; display: block; }
.co-star:nth-child(odd) img { transform: rotate(-1.5deg); } .co-star:nth-child(even) img { transform: rotate(1.2deg); }
.co-star figcaption { font-family: var(--font-display); font-weight: 600; color: var(--c-primary); text-align: center; line-height: 1.2; }
.co-sum { margin: 0; display: grid; gap: var(--s-3); }
.co-sum div { display: grid; grid-template-columns: 7rem 1fr; gap: var(--s-3); }
.co-sum dt { font-weight: 700; color: var(--c-ink-2); font-size: var(--fs-sm); }
.co-sum dd { margin: 0; }
@media (max-width: 30rem) { .co-sum div { grid-template-columns: 1fr; gap: 0; } }
.co-pay { display: grid; gap: var(--s-3); padding-top: var(--s-4); border-top: 1px dashed var(--c-line); }
.co-total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-display); }
.co-total span { font-size: var(--fs-lg); } .co-total b { font-size: 2rem; color: var(--c-accent); }
#pay { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); }
#pay svg { width: 20px; height: 20px; }
.co-fine { margin: 0; font-size: var(--fs-xs); color: var(--c-ink-2); text-align: center; }

/* ---- close-ups on a card, and the face picker ---- */
.who-extras { flex-wrap: wrap; align-items: center; }
.who-extras .cu { position: relative; display: inline-flex; }
.who-extras .cu-warn img { border-color: var(--c-accent); }
.cu-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0;
  background: var(--c-card); color: var(--c-ink); font-size: 16px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgb(var(--shadow-rgb) / .25), inset 0 0 0 1px var(--c-line); }
.cu-x:hover { color: var(--c-danger); }
.cu-x::after { content: ""; position: absolute; inset: -10px; } /* 44px tap target */
.cu-ask { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-2);
  padding: var(--s-3); border-radius: var(--r-md); background: var(--c-paper-2); border-left: 3px solid var(--c-accent); }
.cu-ask p { margin: 0; flex: 1 1 220px; font-size: var(--fs-sm); color: var(--c-ink); }

.fp { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--s-4);
  background: rgb(var(--shadow-rgb) / .55); }
.fp-card { width: min(720px, 100%); max-height: calc(100dvh - 2 * var(--s-4)); display: flex; flex-direction: column;
  background: var(--c-card); border-radius: var(--r-lg); box-shadow: 0 20px 60px rgb(var(--shadow-rgb) / .35); overflow: hidden; }
.fp-head { padding: var(--s-5) var(--s-5) var(--s-3); }
.fp-head h3 { margin: 0; font-size: 1.5rem; }
.fp-sub { margin: var(--s-1) 0 0; color: var(--c-ink-2); font-size: var(--fs-sm); }
.fp-stage { position: relative; margin: 0 var(--s-5); align-self: center; min-height: 0; line-height: 0;
  border-radius: var(--r-md); overflow: hidden; touch-action: none; user-select: none; }
.fp-stage img { display: block; max-width: 100%; max-height: min(60dvh, 560px); width: auto; height: auto; }
.fp-rings, .fp-rings[hidden] { position: absolute; inset: 0; }
.fp-rings[hidden] { display: none; }
.fp-ring { position: absolute; border: 3px solid rgb(255 255 255 / .9); border-radius: 50%; background: transparent; padding: 0;
  cursor: pointer; box-shadow: 0 0 0 2px rgb(0 0 0 / .35); transform: scale(1.12); transition: border-color .15s, box-shadow .15s; }
.fp-ring span { position: absolute; top: -12px; left: 50%; translate: -50% 0; min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--c-card); color: var(--c-ink); font-size: 14px; font-weight: 700; line-height: 26px;
  box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
.fp-ring:hover { border-color: #fff; box-shadow: 0 0 0 4px rgb(0 0 0 / .3); }
.fp-ring[data-on] { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-card), 0 0 0 9999px rgb(0 0 0 / .35); }
.fp-ring[data-on] span { background: var(--c-accent); color: var(--c-on-accent); }
.fp-crop { position: absolute; border: 3px solid #fff; border-radius: 4px; cursor: move; touch-action: none;
  box-shadow: 0 0 0 9999px rgb(0 0 0 / .45), inset 0 0 0 1px rgb(0 0 0 / .3); }
.fp-crop[hidden] { display: none; }
.fp-h { position: absolute; right: -12px; bottom: -12px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .4); cursor: nwse-resize; }
.fp-foot { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-5); flex-wrap: wrap; }
.fp-foot .linkbtn { min-height: 44px; }
.fp-spacer { flex: 1; }
@media (max-width: 560px) {
  .fp { padding: 0; place-items: end stretch; }
  .fp-card { width: 100%; max-height: 100dvh; border-radius: 20px 20px 0 0; }
  .fp-head, .fp-foot { padding-inline: var(--s-4); }
  .fp-stage { margin-inline: var(--s-4); }
  .fp-foot .btn { flex: 1 1 0; }
  .fp-foot .linkbtn { flex-basis: 100%; text-align: left; }
  .fp-spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fp-ring { transition: none; } }

/* ---- names on the group photo, and the ring <-> card link ---- */
.facebox .num { transform: none; left: 0; top: 0; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; line-height: 28px; text-align: center; cursor: pointer; transition: background-color .15s; }
.facebox .num[data-name] { padding: 0 10px; }
.facebox[data-off] { opacity: .6; }
.facebox[data-hl]:not([data-active]) { border-color: #fff; border-width: 3.5px; box-shadow: 0 0 0 3px var(--c-accent), 0 0 0 1px rgb(0 0 0 / .35); }
.facebox[data-hl] .num { box-shadow: 0 0 0 2px #fff, 0 1px 3px rgb(0 0 0 / .4); }
.who-card[data-flash], .out-chip[data-flash] { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 55% { box-shadow: 0 0 0 4px var(--c-accent), 0 8px 30px rgb(var(--shadow-rgb) / .25); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .who-card[data-flash], .out-chip[data-flash] { animation: none; outline: 3px solid var(--c-accent); } }

/* ---- who's in this book: family, friends or coworkers ---- */
.groupbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-5); align-items: start;
  margin-bottom: var(--s-5); padding: var(--s-5); }
.groupbar .seg label { flex: 1 1 0; }
.groupbar .field { margin: 0; }
@media (max-width: 720px) { .groupbar { grid-template-columns: 1fr; gap: var(--s-4); padding: var(--s-4); } }
@media (max-width: 560px) {
  .facebox .num { height: 22px; line-height: 22px; min-width: 22px; font-size: 12px; border-radius: 11px; max-width: 110px; }
  .facebox .num[data-name] { padding: 0 7px; }
}


/* ---- gift-tag placeholder: Pip painting at a little easel (replaces the pencil) ---------------------------- */
.pipeasel { position: absolute; inset: 6% 6% 4%; display: flex; align-items: center; justify-content: center; gap: 2%; }
.pe-easel { position: relative; width: 52%; aspect-ratio: 3 / 4.3; margin-bottom: 4%; }
.pe-easel::before, .pe-easel::after { content: ""; position: absolute; bottom: -10%; width: 4%; height: 40%; background: #a8743f;
  border-radius: 2px; box-shadow: 0 0 0 1px #6b4a2a; }
.pe-easel::before { left: 14%; transform: rotate(9deg); } .pe-easel::after { right: 14%; transform: rotate(-9deg); }
.pe-canvas { position: absolute; inset: 0 0 12% 0; background: #fffdf7; border: 2px solid #6b4a2a; border-radius: 3px; overflow: hidden;
  box-shadow: 0 3px 8px rgb(60 40 25 / .18); z-index: 1; }
.pe-w { position: absolute; border-radius: 50%; filter: blur(6px); opacity: 0; mix-blend-mode: multiply;
  animation: pe-bloom 9s ease-in-out infinite; }
.pe-w1 { left: 18%; top: 14%; width: 64%; height: 46%; background: #e9b48a; }
.pe-w2 { left: 6%; top: 52%; width: 88%; height: 52%; background: #2f6b4a; animation-delay: .9s; }
.pe-w3 { left: 30%; top: 2%; width: 44%; height: 28%; background: #b2423f; animation-delay: 1.8s; }
.pe-bust { position: absolute; inset: 8% 6% 0; width: 88%; height: 92%; fill: none; stroke: #2f5a43; stroke-width: 1.6;
  stroke-linecap: round; stroke-dasharray: 210; stroke-dashoffset: 210; animation: pe-ink 9s ease-in-out infinite; }
.pe-pip { position: relative; width: 40%; aspect-ratio: 3 / 4.6; }
.pe-pip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 3px 0 rgb(60 40 25 / .14)); }
.pe-pip .pe-a { animation: pe-swap-a 9s steps(1) infinite, pe-sway 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.pe-pip .pe-b { animation: pe-swap-b 9s steps(1) infinite; }
@keyframes pe-bloom { 0%, 8% { opacity: 0; transform: scale(.6); } 45%, 80% { opacity: .55; transform: scale(1); } 96%, 100% { opacity: 0; transform: scale(1.05); } }
@keyframes pe-ink { 0%, 10% { stroke-dashoffset: 210; opacity: 1; } 55%, 82% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes pe-swap-a { 0%, 62% { opacity: 1; } 63%, 85% { opacity: 0; } 86%, 100% { opacity: 1; } }
@keyframes pe-swap-b { 0%, 62% { opacity: 0; } 63%, 85% { opacity: 1; } 86%, 100% { opacity: 0; } }
@keyframes pe-sway { 50% { transform: rotate(2.5deg); } }
.pipeasel[data-idle] *, .pipeasel[data-idle] *::before { animation-play-state: paused !important; }
.pipeasel[data-idle] .pe-w { opacity: .35; } .pipeasel[data-idle] .pe-bust { stroke-dashoffset: 0; opacity: .6; }
@media (prefers-reduced-motion: reduce) { .pipeasel * { animation: none !important; } .pipeasel .pe-w { opacity: .4; }
  .pipeasel .pe-bust { stroke-dashoffset: 0; } .pipeasel .pe-b { opacity: 0; } }
/* the tag hides its own <img>s until a drawing is on; Pip's sprites are not those drawings */
.tag .art .pipeasel img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1; object-fit: contain; object-position: bottom; }
.tag .art .pipeasel .pe-b { opacity: 0; }

/* ---- harness books: the cast's printed character cards on the wall, their figures on the shop floor, wet proofs --- */
.wk-pcards { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.wk-pcard { position: absolute; margin: 0; padding: .18vw .18vw 0; box-sizing: border-box; min-width: 0; background: #fdf8ec; transform: translateX(-50%) rotate(var(--r));
  box-shadow: 0 1px 0 rgb(60 40 25 / .25), 0 3px 6px -2px rgb(60 40 25 / .35); border: 1px solid rgb(58 42 34 / .35); }
.wk-pcard::before { content: ""; position: absolute; top: -5%; left: 50%; width: 18%; aspect-ratio: 1; margin-left: -9%; border-radius: 50%;
  background: #3f7a52; box-shadow: 0 1px 1px rgb(0 0 0 / .3); }
.wk-pcard img { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 4%; background: #e2ddd6; }
.wk-pcard figcaption { width: 100%; min-width: 0; font-family: var(--font-display); font-weight: 600; text-align: center; color: #b2423f; white-space: nowrap;
  overflow: hidden; text-overflow: clip; font-size: clamp(5px, .55vw, 9px); letter-spacing: -.02em; line-height: 1.6; }
.wk-pcard.pop { animation: wk-pcard .55s var(--ease-out); }
@keyframes wk-pcard { from { transform: translateX(-50%) translateY(-18px) rotate(-12deg) scale(1.4); opacity: 0; } }
.wk-guest { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.wk-gfig { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; }
.wk-gfig img { display: none; height: 100%; width: auto; max-width: none; filter: drop-shadow(0 3px 0 rgb(60 40 25 / .14)); }
.wk-gfig img.on { display: block; }
.wk-guest::before { content: ""; position: absolute; left: -2.2vw; top: -.35vw; width: 4.4vw; height: .7vw; border-radius: 50%;
  background: rgb(60 40 25 / .2); filter: blur(2px); }
.wk-guest .wk-tag { top: 6px; background: #fdf8ec; color: #b2423f; }
.wk-scene[data-wide] .wk-page img, .wk-scene[data-wide] .wk-sheet img { aspect-ratio: 3 / 2; }
.wk-page.wet img { opacity: .78; filter: saturate(.7) blur(.3px); }
.wk-page.wet::after { content: "wet!"; position: absolute; right: -10%; bottom: -12%; font: italic 600 clamp(7px, .7vw, 11px) var(--font-display);
  color: #3c6488; background: #fdf8ec; border: 1px solid #3a2a22; border-radius: 999px; padding: 0 .4em; transform: rotate(-8deg); }
@media (prefers-reduced-motion: reduce) { .wk-pcard.pop { animation: none; } }
.draftmark { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 2px 8px; border-radius: 999px; font-size: var(--fs-xs, .72rem);
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: #fdf3d8; color: #8a5a10; border: 1px solid #d8b35a; }
.wk-page.flagged::before { content: "draft"; position: absolute; left: -8%; top: 8%; z-index: 1; font: 600 clamp(6px, .6vw, 10px) system-ui, sans-serif;
  text-transform: uppercase; color: #7a4a0a; background: #fdf3d8; border: 1px solid #d8b35a; border-radius: 999px; padding: 0 .4em; }
