/* Release AS — Surprise studio (all 11 occasion makers, templates/surprise_creator.html).
   Four steps beside a live card: Occasion & theme → Personalize → Design & effects → Create & share.
   Player, preview overlay and recipient page styles stay in pages/surprise.css. */
/* the compact workspace hero (same as app-workspace.css, which this page does not load: one render-blocking file less) */
.tool-page-hero--app { padding-bottom: .4rem; }
.tool-page-hero--app .tool-h1 { font-size: clamp(1.55rem, 3vw, 2.35rem); margin-bottom: .35rem; }
.tool-page-hero--app .lead { font-size: .98rem; max-width: 62ch; }
.tool-page-hero--app .proc-badge { margin-top: .55rem; }
@media (max-width: 639px) {
  .tool-page-hero--app .lead { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tool-page-hero--app .pill-hub, .tool-page-hero--app .proc-badge-text > span { display: none; }
}
@media (max-width: 768px), (min-width: 1520px) { .chat-chip-open { display: none; } }
.spx { margin-bottom: 2rem; --spx-r: 22px; }
.spx [hidden] { display: none !important; }
.spx-studio { border: 1px solid var(--border); border-radius: var(--spx-r); background: var(--surface-solid, var(--surface));
  box-shadow: var(--ae-hi, none), 0 1px 2px #00000033, 0 18px 44px #0000004d; }
html[data-theme="light"] .spx-studio { box-shadow: var(--ae-hi, none), 0 1px 2px #1018280f, 0 18px 44px #10182814; }

/* header + steps */
.spx-top { display: flex; align-items: center; gap: .75rem; padding: .8rem clamp(.85rem, 2vw, 1.25rem); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.spx-back { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); }
.spx-back svg { width: 20px; height: 20px; }
.spx-back:focus-visible, .spx-step:focus-visible, .spx-occ:focus-visible, .spx-mode:focus-visible, .spx-edit:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.spx-top-text { flex: 1 1 12rem; min-width: 0; }
.spx-kicker { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link, var(--brand)); }
.spx-top .spc-appbar-title { margin: .1rem 0 0; font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.spx-fm { flex: 0 1 auto; min-width: 0; min-height: 36px; display: flex; align-items: center; }
/* the draft status changes as you type: it may shorten, never reflow the header (a moving header moves every button) */
.spx-fm .fm-bar { margin: 0; flex-wrap: nowrap; min-width: 0; }
.spx-fm .fm-btn, .spx-fm .fm-drafts { min-height: 44px; } /* touch targets, like every studio control */
.spx-fm .fm-status { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24ch; }
@media (min-width: 769px) { .spx-top { flex-wrap: nowrap; } }
@media (max-width: 768px) { .spx-fm .fm-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
.spx-steps { list-style: none; margin: 0; padding: .6rem clamp(.6rem, 2vw, 1.1rem); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem;
  border-bottom: 1px solid var(--border); counter-reset: none; }
.spx-step { width: 100%; min-height: 46px; display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; border-radius: 14px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; text-align: start; cursor: pointer;
  transition: background-color var(--ae-med, .2s), color var(--ae-med, .2s), border-color var(--ae-med, .2s); }
.spx-step:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.spx-step-n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 700;
  background: color-mix(in srgb, var(--text) 9%, transparent); }
.spx-step-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-step[aria-current="step"] { color: var(--text); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.spx-step[aria-current="step"] .spx-step-n { background: var(--brand); color: var(--on-brand); }
.spx-steps li[data-done="1"] .spx-step-n { background: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--text); }

/* body: work area + live card */
.spx-body { display: grid; }
.spx-work { min-width: 0; padding: clamp(1rem, 2.4vw, 1.6rem); display: grid; gap: 1rem; align-content: start; }
.spx-stage { min-width: 0; padding: clamp(1rem, 2.4vw, 1.5rem); display: grid; gap: .8rem; align-content: start; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid, var(--surface)) 72%, var(--bg)); border-radius: 0 0 var(--spx-r) var(--spx-r); }
@media (min-width: 1024px) {
  .spx-body { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  /* the card comes first in the page (on phones it streams in above the steps without moving them); here it is the right column */
  .spx-work { grid-column: 1; grid-row: 1; }
  .spx-stage { grid-column: 2; grid-row: 1; }
  .spx-stage { border-top: 0; border-left: 1px solid var(--border); border-radius: 0 0 var(--spx-r) 0; }
  .spx-stage { display: block; }
  .spx-stage-inner { position: sticky; top: 84px; }
}
.spx-panel { display: grid; gap: 1.05rem; min-width: 0; animation: spxIn .28s var(--ae-ease, ease) both; }
@keyframes spxIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.spx-h { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.2; outline: none; }
.spx-lead { margin: -.4rem 0 0; color: var(--muted); max-width: 62ch; }
.spx-group { display: grid; gap: .8rem; padding: clamp(.85rem, 2vw, 1.1rem); border-radius: 18px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.spx-group h3 { margin: 0; font-size: 1rem; }
.spx-group-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.spx-count { font-size: .82rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* fields */
.spx .spc-f { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; min-width: 0; }
.spx .spc-f input, .spx .spc-f select, .spx .spc-f textarea { width: 100%; box-sizing: border-box; min-height: 46px; padding: .6rem .8rem; border-radius: 12px;
  border: 1px solid var(--ae-field-border, var(--border)); background: var(--surface-solid, var(--surface)); color: var(--text); font: inherit; font-size: 16px; font-weight: 400;
  box-shadow: var(--ae-field-inset, none); }
.spx .spc-f input:focus-visible, .spx .spc-f select:focus-visible, .spx .spc-f textarea:focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--ae-ring, 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent)); }
.spx .spc-f input[type="color"] { padding: .2rem; height: 46px; }
.spx .spc-f textarea { resize: vertical; line-height: 1.5; }
.spx .spc-req { color: #e11d48; }
.spx .spc-row2 { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.spx-short { max-width: 340px; }
.spx-letter textarea { min-height: 150px; font-size: 17px; }
.spx-chars { justify-self: end; font-size: .78rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.spx .spc-check1, .spx-toggle { display: flex; align-items: center; gap: .6rem; min-height: 44px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.spx .spc-check1 input, .spx-toggle input { width: 20px; height: 20px; accent-color: var(--brand); flex: 0 0 auto; }
.spx .spc-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .2rem .8rem; }
.spx-colors { max-width: 420px; }

/* step 1: occasions, themes, language */
.spx-occs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.spx-occ { position: relative; display: grid; justify-items: center; gap: .45rem; padding: .9rem .5rem .75rem; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 4%, var(--surface)), var(--surface)); color: var(--text); text-decoration: none; text-align: center;
  font-weight: 600; font-size: .88rem; line-height: 1.2; box-shadow: var(--ae-hi, none);
  transition: border-color var(--ae-med, .2s); }
.spx-occ:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
/* drawn icons on a lit tile: the depth comes from the gradient and one inset highlight (filters, shadows and 3D transforms
   on eleven tiles cost a low-end phone ~0.5 s of layout and paint; measured) */
.spx-occ-ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: var(--link, var(--brand));
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 26%, transparent), color-mix(in srgb, var(--brand) 6%, transparent));
  box-shadow: inset 0 1px 0 #ffffff26; }
.spx-occ.is-on { border-color: var(--brand); background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.spx-occ.is-on::after { content: "✓"; position: absolute; top: 7px; right: 8px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font-size: .7rem; font-weight: 700; }
.spx fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.spx legend { font-weight: 700; font-size: .95rem; margin-bottom: .5rem; padding: 0; }
.spx-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.spx-themes legend { grid-column: 1 / -1; }
.spx .spc-theme { position: relative; display: grid; gap: .45rem; padding: .45rem .45rem .6rem; border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: .88rem; font-weight: 600; text-align: center; transition: border-color var(--ae-med, .2s), box-shadow var(--ae-med, .2s), transform var(--ae-fast, .15s); }
.spx .spc-theme:hover { transform: translateY(-2px); }
.spx .spc-theme input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; }
.spx .spc-swatch { display: block; height: 76px; border-radius: 13px; box-shadow: inset 0 1px 0 #ffffff40, inset 0 -18px 30px #00000026; position: relative; overflow: hidden; }
.spx .spc-swatch { background-blend-mode: normal; }
.spx .spc-theme:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent), 0 10px 22px #00000026; }
.spx .spc-theme:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.spx-seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.spx-seg legend { width: 100%; }
.spx-seg label, .spx-chips .spc-chip-r { position: relative; display: inline-flex; }
.spx-seg input, .spx-chips input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; }
.spx-seg span, .spx-chips .spc-chip-r span { display: inline-flex; align-items: center; min-height: 44px; padding: .3rem 1.1rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; font-size: .9rem; cursor: pointer; }
.spx-seg input:checked + span, .spx-chips input:checked + span { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.spx-seg input:focus-visible + span, .spx-chips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.spx-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* step 2: photos */
.spx-drop { display: grid; justify-items: center; gap: .45rem; padding: 1.1rem .9rem; border-radius: 16px; text-align: center;
  border: 1.5px dashed color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--brand) 5%, transparent); transition: background-color var(--ae-med, .2s), border-color var(--ae-med, .2s); }
.spx-drop.is-over { background: color-mix(in srgb, var(--brand) 14%, transparent); border-color: var(--brand); }
.spx-drop p { margin: 0; max-width: 52ch; }
.spx-drop-btn { display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: .5rem 1.2rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 700; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent); }
.spx-drop-btn svg { width: 22px; height: 22px; }
.spx-drop-btn:disabled { opacity: .5; cursor: not-allowed; }
.spx .spc-photos { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.spx .spc-photo { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .5rem; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface-solid, var(--surface)); }
.spx-thumb { position: relative; width: 72px; height: 72px; }
.spx-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; display: block; }
.spx-cover { position: absolute; left: 4px; bottom: 4px; padding: .05rem .4rem; border-radius: 999px; font-size: .66rem; font-weight: 700; background: var(--brand); color: var(--on-brand); }
.spx .spc-photo input { min-height: 44px; padding: .45rem .7rem; border-radius: 10px; border: 1px solid var(--ae-field-border, var(--border)); background: var(--surface); color: var(--text);
  font: inherit; font-size: 16px; min-width: 0; width: 100%; box-sizing: border-box; }
.spx .spc-photo-tools { display: flex; gap: .25rem; }
.spx .spc-ic { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: inherit; font-size: 1.05rem; cursor: pointer; }
.spx .spc-ic:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.spx .spc-ic:disabled { opacity: .35; }
@media (max-width: 560px) {
  .spx .spc-photo { grid-template-columns: 72px minmax(0, 1fr); }
  .spx .spc-photo-tools { grid-column: 1 / -1; justify-content: space-between; }
  .spx .spc-photo-tools .spc-ic { flex: 1 1 0; }
}
.spx .spc-consent { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border-radius: 14px; font-size: .9rem;
  background: color-mix(in srgb, var(--brand) 10%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); }
.spx .spc-consent input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: .1rem; accent-color: var(--brand); }

/* step 3: music + effects */
.spx-music { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .55rem; }
.spx-music legend { grid-column: 1 / -1; }
.spx-opt { position: relative; display: block; }
.spx-opt input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; }
.spx-opt > span { display: flex; align-items: center; gap: .55rem; min-height: 56px; padding: .5rem .8rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: .9rem; cursor: pointer; transition: border-color var(--ae-med, .2s), background-color var(--ae-med, .2s); }
.spx-opt-ico { display: inline-grid; color: var(--link, var(--brand)); }
.spx-opt input:checked + span { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.spx-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.spx-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .55rem; }
.spx-mode { display: grid; gap: .2rem; padding: .8rem .9rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid, var(--surface)); color: var(--text);
  font: inherit; text-align: start; cursor: pointer; min-height: 44px; }
.spx-mode strong { font-size: .98rem; }
.spx-mode span { font-size: .84rem; color: var(--muted); line-height: 1.35; }
.spx-mode[aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.spx-pro { display: grid; gap: 1rem; }

/* step 4: summary, create, result */
.spx-final { display: grid; gap: 1rem; }
.spx-sum { margin: 0; display: grid; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface); }
.spx-sum > div { display: grid; grid-template-columns: minmax(6.5rem, 26%) minmax(0, 1fr); gap: .75rem; align-items: center; padding: .3rem .4rem .3rem .9rem; min-height: 44px; }
.spx-sum > div + div { border-top: 1px solid var(--border); }
.spx-sum dt { color: var(--muted); font-size: .86rem; font-weight: 600; }
.spx-sum dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 0; font-weight: 600; }
.spx-sum dd span { min-width: 0; overflow-wrap: anywhere; }
.spx-edit { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: .2rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--link, var(--brand));
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.spx-priv { margin: 0; padding: .8rem .9rem .8rem 2.1rem; border-radius: 16px; background: color-mix(in srgb, var(--brand) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--border)); font-size: .88rem; display: grid; gap: .35rem; }
.spx-create-row, .spx-share-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.spx-big { min-height: 52px; flex: 1 1 180px; font-size: 1rem; font-weight: 700; border-radius: 14px; justify-content: center; }
.spx-result { display: grid; gap: .8rem; padding: clamp(.9rem, 2vw, 1.3rem); border-radius: 20px; outline: none;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 9%, var(--surface-solid, var(--surface))), var(--surface-solid, var(--surface)));
  box-shadow: var(--ae-hi, none), 0 12px 30px #00000033; animation: spxIn .35s var(--ae-ease, ease) both; }
.spx-result-title { margin: 0; font-size: 1.35rem; }
.spx-result-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.spx-result-main { display: grid; gap: .7rem; min-width: 0; }
.spx-result-main p { margin: 0; }
.spx .spc-countdown { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.spx .spc-qr { margin: 0; display: grid; gap: .45rem; justify-items: center; }
.spx .spc-qr canvas { width: 200px; height: 200px; border-radius: 14px; background: #fff; image-rendering: pixelated; box-shadow: 0 8px 22px #00000033; }
.spx-share-more { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .3rem; border-top: 1px solid var(--border); }
@media (max-width: 680px) { .spx-result-grid { grid-template-columns: 1fr; } .spx .spc-qr { justify-self: center; } }

/* step navigation: always reachable; on phones it rides above the tab bar */
.spx-nav { display: grid; gap: .5rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.spx-nav .spc-status { margin: 0; min-height: 1.2em; font-weight: 600; font-size: .92rem; }
.spx-nav .spc-status:empty { display: none; }
.spx .spc-status[data-kind="err"] { color: #dc2626; }
.spx .spc-status[data-kind="ok"] { color: var(--link, #16a34a); }
html[data-theme="dark"] .spx .spc-status[data-kind="err"] { color: #f87171; }
.spx-nav-btns { display: flex; gap: .6rem; justify-content: flex-end; }
.spx-nav-btns .btn-primary, .spx-nav-btns .btn-ghost { min-height: 48px; min-width: 132px; justify-content: center; font-weight: 700; border-radius: 14px; }
.spx[data-step="4"] .spx-nav-btns { justify-content: flex-start; }
/* the sticky bar's Create is for phones; wider screens use the one under the summary */
@media (min-width: 769px) { .spx-create2 { display: none !important; } }

/* the live card */
.spx-stage-h { margin: 0 0 .7rem; font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.spx-live { perspective: 900px; padding: .4rem; }
.spx-card { --rx: 0deg; --ry: 0deg; position: relative; overflow: hidden; display: grid; justify-items: center; align-content: center; gap: .35rem; min-height: 360px;
  padding: 1.6rem 1.2rem 1.3rem; border-radius: 24px; text-align: center; color: #fff; background: linear-gradient(135deg, #0b2a17, #1d4d2b 55%, #3d7a3a);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .25s var(--ae-ease, ease), background .4s;
  box-shadow: inset 0 1px 0 #ffffff33, 0 2px 4px #00000033, 0 24px 50px #00000059; }
.spx-card[data-light="1"] { color: #1d1530; }
.spx-card::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(2px 2px at 18% 22%, #fff9 50%, transparent 51%), radial-gradient(1.5px 1.5px at 72% 14%, #fff8 50%, transparent 51%),
  radial-gradient(2px 2px at 86% 58%, #fff7 50%, transparent 51%), radial-gradient(1.5px 1.5px at 12% 74%, #fff7 50%, transparent 51%),
  radial-gradient(2.5px 2.5px at 58% 86%, #fff6 50%, transparent 51%), radial-gradient(70% 45% at 50% 0%, #ffffff2e, transparent 70%); }
.spx-card-ico { position: relative; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; transform: translateZ(40px);
  background: radial-gradient(closest-side, #ffffff47, #ffffff14); box-shadow: inset 0 1px 0 #ffffff59; }
.spx-card-occ { position: relative; margin: .3rem 0 0; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.spx-card-name { position: relative; margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; transform: translateZ(30px);
  text-shadow: 0 2px 14px #00000040; }
.spx-card[data-light="1"] .spx-card-name { text-shadow: 0 1px 0 #ffffff80; }
.spx-card-name[data-empty="1"] { opacity: .55; }
.spx-card-wish { position: relative; margin: .2rem 0 0; max-width: 30ch; font-size: .95rem; line-height: 1.45; opacity: .92; overflow-wrap: anywhere; }
.spx-card-photos { position: relative; display: flex; justify-content: center; margin-top: .6rem; min-height: 0; }
.spx-card-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 8px 18px #00000059; margin-inline: -8px; }
.spx-card-photos img:nth-child(1) { transform: rotate(-8deg); }
.spx-card-photos img:nth-child(3) { transform: rotate(7deg); }
.spx-card-from { position: relative; margin: .3rem 0 0; font-size: .9rem; font-style: italic; opacity: .85; }
.spx-stage-note { margin: .8rem 0 .6rem; }
.spx-stage-play { width: 100%; min-height: 48px; justify-content: center; font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .spx-card-ico { animation: spxFloat 5s ease-in-out infinite; }
  @keyframes spxFloat { 0%, 100% { transform: translateZ(40px) translateY(0); } 50% { transform: translateZ(40px) translateY(-6px); } }
}
@media (prefers-reduced-motion: reduce) { .spx-panel, .spx-result { animation: none; } .spx-card { transition: none; } }

/* phones: one focused screen per step; the card shrinks to a strip above the steps' content */
@media (max-width: 1023px) {
  .spx-body { display: flex; flex-direction: column; }
  .spx-stage { border-top: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: .8rem; }
  .spx-stage-h, .spx-stage-note { display: none; }
  .spx-live { padding: 0; }
  .spx-card { min-height: 0; grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: start; column-gap: .9rem; row-gap: .1rem; padding: .85rem 1rem; border-radius: 18px; }
  .spx-card-ico { grid-row: 1 / span 3; width: 54px; height: 54px; border-radius: 17px; animation: none !important; transform: none; }
  .spx-card-ico svg { width: 34px; height: 34px; }
  .spx-card-occ { margin: 0; font-size: .66rem; }
  .spx-card-name { font-size: 1.2rem; transform: none; }
  .spx-card-wish { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: .84rem; margin: 0; max-width: none; }
  .spx-card-photos, .spx-card-from { display: none; }
  .spx-stage-play { min-height: 40px; margin-top: .6rem; font-size: .88rem; }
  .spx[data-step="1"] .spx-stage-play, .spx[data-step="4"] .spx-stage { display: none; }
}
@media (max-width: 768px) {
  .spx { margin-inline: -4px; }
  .spx-steps { grid-template-columns: repeat(4, auto); justify-content: space-between; padding: .5rem .6rem; }
  .spx-step { padding: .3rem; gap: .4rem; min-height: 44px; }
  .spx-step:not([aria-current="step"]) .spx-step-l { display: none; }
  .spx-step[aria-current="step"] { padding-inline: .4rem .8rem; }
  .spx-top { padding: .6rem .75rem; gap: .55rem; }
  .spx-top .spc-appbar-title { font-size: .95rem; }
  .spx-fm { flex-basis: 100%; min-height: 46px; }
  .spx-fm .fm-bar { padding-block: 0; } /* the draft bar's row is reserved: it arrives after load without moving the studio */
  .spx-occs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
  .spx-occ { padding: .65rem .3rem .55rem; font-size: .8rem; border-radius: 16px; }
  .spx-occ-ico { width: 42px; height: 42px; border-radius: 13px; }
  .spx-occ-ico svg { width: 24px; height: 24px; }
  .spx-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spx .spc-swatch { height: 60px; }
  .spx-music { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spx-nav { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 5; margin: 0 calc(-1 * clamp(1rem, 2.4vw, 1.6rem)) calc(-1 * clamp(1rem, 2.4vw, 1.6rem));
    padding: .65rem clamp(1rem, 2.4vw, 1.6rem) .75rem; border-radius: 0 0 var(--spx-r) var(--spx-r);
    background: var(--surface-solid, var(--surface)); box-shadow: 0 -8px 18px #0000001f; }
  .spx-nav-btns .btn-primary, .spx-nav-btns .btn-ghost { flex: 1 1 0; min-width: 0; }
  .spx-sum > div { grid-template-columns: 5.6rem minmax(0, 1fr); gap: .5rem; padding-left: .7rem; font-size: .9rem; }
  .spx-sum dt { font-size: .8rem; }
  .spx[data-step="4"] [data-spc-create] { display: none; }
  .spx-create-row .spx-big { min-height: 46px; }
}
@media (max-width: 380px) { .spx-occs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the on-screen keyboard hides the tab bar (shell.js sets kbd-open): the bar then sits at the bottom edge */
@media (max-width: 768px) { body.kbd-open .spx-nav { bottom: 0; } }

/* mid-size desktops: the floating chat button would sit on the live card — the "Ask AI" chip in the header takes over */
@media (min-width: 769px) and (max-width: 1519px) { body:has(.spx) .chat-fab:not(.is-open) { display: none; } }
