:root {
  --sea: #2f9f9a;
  --deep: #123f51;
  --sun: #ffd166;
  --coral: #ef6f6c;
  --leaf: #77b255;
  --sand: #f7dfad;
  --paper: #fffaf0;
  --white: #ffffff;
  --muted: #607982;
  --line: #d5e5e1;
  --shadow: rgba(18, 63, 81, .16);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--deep);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 209, 102, .55) 0 110px, transparent 112px),
    linear-gradient(180deg, #c6f0ec 0%, #fff5d8 86%);
  font-family: "Hiragino Sans GB", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
}

button,
label,
input {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding: 22px;
}

.workbench {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  max-width: 1440px;
  min-height: calc(100vh - 44px);
  margin: 0 auto;
}

.panel,
.preview-panel {
  border: 4px solid var(--white);
  border-radius: 14px;
  background: rgba(255, 250, 240, .9);
  box-shadow: 0 22px 54px var(--shadow);
}

.input-panel {
  padding: 22px;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: var(--coral);
  font-size: 25px;
  font-weight: 900;
  border: 4px solid var(--white);
  box-shadow: 0 6px 0 rgba(239, 111, 108, .2);
}

.brand strong {
  display: block;
  font-size: 21px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-intro {
  display: none;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--deep);
  font-size: 14px;
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  color: var(--deep);
  padding: 0 12px;
  font-size: 16px;
  font-weight: 800;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--sea);
}

.topic-field {
  position: relative;
  z-index: 12;
}

.topic-combobox {
  position: relative;
}

.topic-combobox input {
  padding-right: 52px;
}

.topic-toggle {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(47, 159, 154, .12);
  color: var(--deep);
  cursor: pointer;
}

.topic-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid currentColor;
  transform: translate(-50%, -38%);
}

.topic-combobox.is-open .topic-toggle::before {
  border-top: 0;
  border-bottom: 9px solid currentColor;
  transform: translate(-50%, -58%);
}

.topic-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 6px;
  max-height: 244px;
  overflow: auto;
  padding: 8px;
  border: 2px solid rgba(47, 159, 154, .28);
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 36px rgba(18, 63, 81, .18);
}

.topic-menu[hidden],
.topic-menu button[hidden] {
  display: none;
}

.topic-menu::after {
  content: attr(data-empty);
  display: none;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.topic-menu[data-empty]:not([data-empty=""])::after {
  display: block;
}

.topic-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--deep);
  padding: 0 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.topic-menu button:hover,
.topic-menu button:focus {
  background: rgba(47, 159, 154, .12);
  outline: none;
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.template-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--deep);
  font-size: 14px;
  font-weight: 900;
}

.template-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 136px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 250, 240, .72));
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.template-card:hover {
  transform: translateY(-2px);
}

.template-card.is-selected {
  border-color: var(--deep);
  box-shadow: 0 8px 0 rgba(18, 63, 81, .12), inset 0 0 0 2px rgba(255, 255, 255, .85);
}

.template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.template-thumb {
  position: relative;
  height: 54px;
  overflow: hidden;
  border: 3px solid var(--white);
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(18, 63, 81, .1), inset 0 -10px 0 rgba(255, 255, 255, .42);
}

.template-thumb::before,
.template-thumb::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ocean-thumb {
  background:
    radial-gradient(ellipse at 22% 72%, #2c79b7 0 10px, transparent 11px),
    radial-gradient(ellipse at 42% 16%, #ffffff 0 10px, transparent 11px),
    radial-gradient(ellipse at 58% 18%, #ffffff 0 7px, transparent 8px),
    linear-gradient(160deg, transparent 0 61%, #f2d4b1 62% 100%),
    #b9e5f7;
}

.ocean-thumb::before {
  left: -10px;
  right: -10px;
  bottom: 7px;
  height: 22px;
  background: repeating-radial-gradient(ellipse at 18px 16px, transparent 0 12px, #fff 13px 15px, transparent 16px 25px);
}

.ocean-thumb::after {
  right: 12px;
  bottom: 8px;
  width: 24px;
  height: 16px;
  border-radius: 60% 60% 45% 45%;
  background: #2f70b7;
  box-shadow: -5px -2px 0 #245b85;
}

.rainbow-thumb {
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, .9) 0 11px, transparent 12px),
    linear-gradient(90deg, transparent 0 8px, #ffffff 8px 11px, transparent 11px),
    linear-gradient(90deg, #ff7a7a 0 16%, #ffd166 16% 32%, #76d7a0 32% 48%, #67c6ff 48% 64%, #b990ff 64% 80%, #ff9fc7 80%),
    #fff6f7;
}

.rainbow-thumb::before {
  left: 14px;
  top: 12px;
  width: 54px;
  height: 34px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 48px 5px 0 rgba(255, 255, 255, .72);
  transform: rotate(-2deg);
}

.rainbow-thumb::after {
  left: 23px;
  top: 21px;
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: #ff7a7a;
  box-shadow: 0 9px 0 #67c6ff, 58px 4px 0 #ffd166;
}

.forest-thumb {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .32) 0 2px, transparent 2px 34%, rgba(255, 255, 255, .32) 34% calc(34% + 2px), transparent calc(34% + 2px) 67%, rgba(255, 255, 255, .32) 67% calc(67% + 2px), transparent calc(67% + 2px)),
    radial-gradient(circle at 84% 28%, rgba(255, 255, 255, .86) 0 12px, transparent 13px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .13) 0 2px, transparent 3px 20px),
    #3f8565;
}

.forest-thumb::before {
  left: 9px;
  top: 12px;
  width: 42px;
  height: 28px;
  border-radius: 4px;
  border: 3px solid rgba(255, 255, 255, .95);
  background: rgba(255, 253, 242, .2);
  transform: rotate(-3deg);
  box-shadow: 58px 4px 0 -2px rgba(255, 253, 242, .92);
}

.forest-thumb::after {
  left: 62px;
  top: 13px;
  width: 30px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 9px 0 rgba(255, 255, 255, .5), 0 18px 0 rgba(255, 255, 255, .35);
}

.star-thumb {
  background:
    radial-gradient(circle at 15% 80%, #39c985 0 13px, transparent 14px),
    radial-gradient(circle at 88% 24%, rgba(52, 183, 134, .22) 0 36px, transparent 37px),
    linear-gradient(90deg, transparent 0 72%, #2cb083 72% 100%),
    #fffdf8;
}

.star-thumb::before {
  left: 19px;
  top: 14px;
  width: 52px;
  height: 8px;
  border-radius: 99px;
  background: #2cb083;
  box-shadow: 0 14px 0 #f0d9ae, 78px -5px 0 7px rgba(82, 217, 150, .72);
}

.star-thumb::after {
  left: 88px;
  top: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 46% 46%;
  background: #52d996;
  box-shadow: 0 16px 0 -9px #214537;
}

.ai-thumb {
  background:
    radial-gradient(circle at 22% 30%, #ffffff 0 6px, transparent 7px),
    radial-gradient(circle at 68% 72%, #ffffff 0 5px, transparent 6px),
    linear-gradient(135deg, #2d7bba 0 22%, #8bc96f 22% 45%, #ffd166 45% 68%, #ff7a9d 68%);
}

.ai-thumb::before {
  left: 14px;
  top: 12px;
  width: 46px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 62px 8px 0 -3px rgba(255, 255, 255, .86);
  transform: rotate(-6deg);
}

.ai-thumb::after {
  right: 16px;
  top: 17px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .62);
}

.ai-template-card {
  grid-column: 1 / -1;
  grid-template-columns: 92px 1fr;
  align-items: center;
  min-height: 92px;
}

.ai-template-card .template-thumb {
  height: 64px;
  grid-row: span 2;
}

.template-card strong {
  color: var(--deep);
  font-size: 13px;
  line-height: 1.1;
}

.template-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 180px;
  gap: 8px;
  border: 3px dashed rgba(18, 63, 81, .24);
  border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(47, 159, 154, .06) 25px 26px),
    rgba(255, 255, 255, .66);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.dropzone.is-dragging {
  border-color: var(--sea);
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 209, 102, .38) 0 32px, transparent 33px),
    rgba(255, 255, 255, .9);
  transform: translateY(-1px);
}

.dropzone input {
  display: none;
}

.drop-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sea);
  color: var(--white);
  font-size: 36px;
  font-weight: 900;
}

.dropzone strong {
  font-size: 18px;
}

.dropzone em {
  max-width: 250px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.4;
}

.thumbs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.thumbs::before {
  content: attr(data-count);
  display: none;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.thumbs[data-count]::before {
  display: block;
}

.thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid var(--white);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(18, 63, 81, .12);
}

.primary-btn,
.pay-btn,
.ghost-btn,
.close-btn {
  border: 0;
  cursor: pointer;
}

.primary-btn,
.pay-btn {
  height: 48px;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--deep);
  color: var(--white);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 8px 0 rgba(18, 63, 81, .16);
}

.primary-btn:disabled,
.pay-btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.pay-btn:disabled {
  display: none;
}

.pay-btn {
  background: var(--coral);
}

.ghost-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white);
  color: var(--deep);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(18, 63, 81, .12);
}

.privacy-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .64);
  border: 2px solid var(--line);
}

.privacy-note strong {
  font-size: 14px;
}

.privacy-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 22px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.1;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter {
  min-width: 62px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.stage-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .46);
  border: 2px solid rgba(255, 255, 255, .7);
}

.stage {
  position: relative;
  width: min(100%, 980px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  border: 5px solid var(--white);
  box-shadow: 0 18px 44px rgba(18, 63, 81, .18);
}

.stage[data-template="rainbow"] {
  background: #fff6f7;
}

.stage[data-template="forest"] {
  background: #f3f8e8;
}

.stage[data-template="star"] {
  background: #fffdf8;
}

.stage[data-template="ai"] {
  background: var(--ai-bg, #fffdf8);
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 60px;
  text-align: center;
}

.empty-state span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: var(--coral);
  font-size: 30px;
  font-weight: 900;
  border: 5px solid var(--white);
}

.empty-state h2 {
  max-width: 520px;
  font-size: 30px;
}

.empty-state p {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}

.slide {
  position: absolute;
  inset: 0;
  display: none;
  background:
    linear-gradient(90deg, rgba(47, 159, 154, .08) 0 1px, transparent 1px 88px),
    linear-gradient(180deg, rgba(47, 159, 154, .06) 0 1px, transparent 1px 74px),
    var(--paper);
  padding: 42px 48px;
}

.slide.active {
  display: block;
}

.slide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 26px;
  background:
    repeating-linear-gradient(90deg, #2f9f9a 0 34px, #ffffff 34px 46px, #ffd166 46px 78px, #ffffff 78px 90px);
}

.slide::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: var(--sand);
}

.stage[data-template="ocean"] .slide {
  background:
    radial-gradient(ellipse at 14% 20%, #ffffff 0 16px, transparent 17px),
    radial-gradient(ellipse at 20% 25%, #ffffff 0 11px, transparent 12px),
    radial-gradient(ellipse at 87% 19%, #ffffff 0 13px, transparent 14px),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .05)),
    #a9d9f2;
}

.stage[data-template="ocean"] .slide::before {
  height: 72px;
  background:
    radial-gradient(ellipse at 63% 34%, #2f70b7 0 42px, transparent 43px),
    radial-gradient(ellipse at 21% 56%, #2f70b7 0 28px, transparent 29px),
    repeating-radial-gradient(ellipse at 10% 78%, transparent 0 14px, rgba(255, 255, 255, .95) 15px 18px, transparent 19px 28px),
    #f2dcc4;
}

.stage[data-template="ocean"] .slide::after {
  height: 84px;
  background:
    radial-gradient(ellipse at 18% 65%, #2b74b6 0 28px, transparent 29px),
    repeating-radial-gradient(ellipse at 20% 14%, transparent 0 16px, rgba(255, 255, 255, .92) 17px 20px, transparent 21px 34px),
    linear-gradient(160deg, transparent 0 62%, #f1d7b8 63%),
    #a9d9f2;
}

.stage[data-template="rainbow"] .slide {
  background:
    linear-gradient(90deg, #ff7a7a 0 7px, transparent 7px calc(100% - 7px), #67c6ff calc(100% - 7px)),
    linear-gradient(180deg, #fff8fb, #fff6df);
}

.stage[data-template="rainbow"] .slide::before {
  left: 34px;
  right: 34px;
  top: 22px;
  width: auto;
  height: 18px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #ff7a7a 0 16%, #ffd166 16% 32%, #76d7a0 32% 48%, #67c6ff 48% 64%, #b990ff 64% 80%, #ff9fc7 80%);
}

.stage[data-template="rainbow"] .slide::after {
  height: 42px;
  background:
    repeating-linear-gradient(90deg, rgba(239, 111, 108, .18) 0 18px, transparent 19px 40px),
    #fff0b8;
}

.stage[data-template="forest"] .slide {
  background:
    radial-gradient(ellipse at 12% 9%, rgba(255, 255, 255, .12) 0 58px, transparent 59px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .11) 0 2px, transparent 3px 32px),
    #438765;
}

.stage[data-template="forest"] .slide::before {
  height: 76px;
  background:
    radial-gradient(ellipse at 86% 18%, #d3462f 0 12px, transparent 13px),
    radial-gradient(ellipse at 80% 22%, #f4a641 0 10px, transparent 11px),
    radial-gradient(ellipse at 74% 18%, #75b94b 0 12px, transparent 13px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .16) 0 2px, transparent 3px 34px),
    #3c7f5f;
}

.stage[data-template="forest"] .slide::after {
  height: 56px;
  background:
    linear-gradient(180deg, #ffffff 0 42%, transparent 42%),
    #438765;
}

.stage[data-template="star"] .slide {
  background:
    radial-gradient(circle at 10% 86%, #39c985 0 20px, transparent 21px),
    radial-gradient(circle at 88% 24%, rgba(52, 183, 134, .18) 0 78px, transparent 79px),
    linear-gradient(90deg, transparent 0 calc(100% - 118px), #2cb083 calc(100% - 118px)),
    #fffdf8;
}

.stage[data-template="ai"] .slide {
  background:
    radial-gradient(circle at 12% 86%, color-mix(in srgb, var(--ai-accent-2, #52d996) 84%, transparent) 0 22px, transparent 23px),
    radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--ai-accent, #2cb083) 18%, transparent) 0 86px, transparent 87px),
    linear-gradient(90deg, transparent 0 calc(100% - 118px), color-mix(in srgb, var(--ai-accent, #2cb083) 92%, white) calc(100% - 118px)),
    var(--ai-bg, #fffdf8);
}

.stage[data-template="ai"][data-motif="wave"] .slide {
  background:
    radial-gradient(ellipse at 18% 18%, #ffffff 0 16px, transparent 17px),
    repeating-radial-gradient(ellipse at 22% 84%, transparent 0 16px, rgba(255, 255, 255, .9) 17px 20px, transparent 21px 34px),
    linear-gradient(180deg, var(--ai-bg, #a9d9f2), color-mix(in srgb, var(--ai-bg, #a9d9f2) 72%, white));
}

.stage[data-template="ai"][data-motif="confetti"] .slide {
  background:
    radial-gradient(circle at 18% 22%, var(--ai-accent, #ff7a9d) 0 7px, transparent 8px),
    radial-gradient(circle at 78% 20%, var(--ai-accent-2, #ffd166) 0 8px, transparent 9px),
    radial-gradient(circle at 86% 54%, var(--ai-accent-3, #8fcbff) 0 6px, transparent 7px),
    var(--ai-bg, #fff4f7);
}

.stage[data-template="ai"][data-motif="leaf"] .slide {
  background:
    radial-gradient(ellipse at 10% 86%, var(--ai-accent-2, #8bc96f) 0 24px, transparent 25px),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--ai-accent, #2f8f6a) 10%, transparent) 0 2px, transparent 3px 32px),
    var(--ai-bg, #f4fae8);
}

.stage[data-template="ai"][data-motif="track"] .slide {
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--ai-accent, #1f9bd1) 14%, transparent) 0 4px, transparent 5px 42px),
    radial-gradient(circle at 86% 18%, var(--ai-accent-2, #f6d55c) 0 22px, transparent 23px),
    var(--ai-bg, #f7fbff);
}

.stage[data-template="ai"] .slide::before {
  height: 72px;
  background:
    radial-gradient(circle at 8% 50%, var(--ai-accent-2, #52d996) 0 18px, transparent 19px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--ai-accent, #2cb083) 80%, white) 0 48px, transparent 48px 68px),
    color-mix(in srgb, var(--ai-accent-3, #f0d9ae) 70%, white);
}

.stage[data-template="ai"] .slide::after {
  height: 58px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .54) 0 20px, transparent 21px 42px),
    var(--ai-rail, #e5f5ec);
}

.stage[data-template="star"] .slide::before {
  height: 96px;
  background:
    radial-gradient(circle at 13% 70%, #52d996 0 18px, transparent 19px),
    linear-gradient(135deg, transparent 0 76%, #f0d9ae 77% 100%),
    transparent;
}

.stage[data-template="star"] .slide::after {
  height: 70px;
  background:
    radial-gradient(circle at 7% 54%, #2cb083 0 20px, transparent 21px),
    radial-gradient(circle at 11% 72%, #5edb91 0 12px, transparent 13px),
    transparent;
}

.stage[data-template="star"] .copy h2,
.stage[data-template="star"] .slide-number {
  color: #1f4136;
}

.stage[data-template="ai"] .copy h2,
.stage[data-template="ai"] .slide-number {
  color: var(--ai-fg, #214537);
}

.stage[data-template="star"] .eyebrow {
  color: #1f4136;
  background: rgba(255, 255, 255, .85);
  border-color: rgba(44, 176, 131, .28);
}

.stage[data-template="ai"] .eyebrow {
  color: var(--ai-fg, #214537);
  background: color-mix(in srgb, var(--ai-panel, #ffffff) 86%, transparent);
  border-color: color-mix(in srgb, var(--ai-accent, #2cb083) 28%, transparent);
}

.slide-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  gap: 24px;
}

.slide.cover .slide-inner,
.slide.story-left .slide-inner {
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
}

.slide.story-right .slide-inner {
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
}

.slide.thanks .slide-inner {
  align-content: center;
  justify-items: center;
  text-align: center;
}

.copy {
  display: grid;
  gap: 16px;
  align-content: center;
}

.copy h2 {
  color: var(--deep);
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.08;
}

.copy p {
  padding: 15px 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .84);
  color: var(--deep);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 900;
  line-height: 1.45;
}

.stage[data-template="rainbow"] .copy p {
  border-color: rgba(239, 111, 108, .24);
  background: rgba(255, 255, 255, .9);
  box-shadow: 8px 8px 0 rgba(255, 209, 102, .34);
}

.stage[data-template="forest"] .copy p {
  color: #ffffff;
  border-color: rgba(255, 255, 255, .24);
  background: rgba(58, 118, 88, .74);
  box-shadow: 8px 8px 0 rgba(30, 66, 50, .2);
}

.stage[data-template="star"] .copy p {
  color: #214537;
  background: rgba(255, 255, 255, .88);
  border-color: rgba(44, 176, 131, .22);
  box-shadow: 8px 8px 0 rgba(44, 176, 131, .16);
}

.stage[data-template="ai"] .copy p {
  color: var(--ai-fg, #214537);
  background: color-mix(in srgb, var(--ai-panel, #ffffff) 88%, transparent);
  border-color: color-mix(in srgb, var(--ai-accent, #2cb083) 24%, transparent);
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--ai-accent, #2cb083) 18%, transparent);
}

.stage[data-template="forest"] .copy h2,
.stage[data-template="forest"] .eyebrow,
.stage[data-template="forest"] .slide-number {
  color: #ffffff;
}

.stage[data-template="forest"] .eyebrow {
  background: rgba(45, 94, 70, .82);
  border-color: rgba(255, 255, 255, .28);
}

.name-stamp {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: var(--coral);
  font-size: 34px;
  font-weight: 900;
  border: 6px solid var(--white);
  box-shadow: 0 9px 0 rgba(239, 111, 108, .22);
}

.photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
}

.photos.single {
  grid-template-columns: 1fr;
}

.photos.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-card {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 5px solid var(--white);
  border-radius: 8px;
  background: #dff4ef;
  box-shadow: 0 12px 28px rgba(18, 63, 81, .16);
}

.stage[data-template="rainbow"] .photo-card {
  border-color: #fff;
  box-shadow: 10px 10px 0 rgba(103, 198, 255, .2), -7px -7px 0 rgba(255, 122, 122, .16);
}

.stage[data-template="forest"] .photo-card {
  border-color: #fffdf2;
  box-shadow: 12px 12px 0 rgba(26, 55, 42, .34);
}

.stage[data-template="star"] .photo-card {
  border-color: #fff7d6;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .28), 8px 8px 0 rgba(255, 209, 102, .2);
}

.stage[data-template="ai"] .photo-card {
  border-color: var(--ai-panel, #ffffff);
  box-shadow: 12px 12px 0 color-mix(in srgb, var(--ai-accent, #2cb083) 18%, transparent);
}

.photos.three .photo-card {
  min-height: 230px;
}

.photo-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

.slide-number {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  color: rgba(18, 63, 81, .62);
  font-size: 13px;
  font-weight: 900;
}

.stage[data-template] .empty-state {
  position: relative;
  overflow: hidden;
}

.stage[data-template] .empty-state::before,
.stage[data-template] .empty-state::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.stage[data-template="ocean"] .empty-state {
  background:
    radial-gradient(ellipse at 22% 22%, #ffffff 0 22px, transparent 23px),
    radial-gradient(ellipse at 28% 26%, #ffffff 0 14px, transparent 15px),
    linear-gradient(158deg, transparent 0 62%, #f1d7b8 63%),
    #a9d9f2;
}

.stage[data-template="ocean"] .empty-state::before {
  left: -4%;
  right: -4%;
  bottom: 22px;
  height: 94px;
  background: repeating-radial-gradient(ellipse at 32px 28px, transparent 0 22px, rgba(255, 255, 255, .92) 23px 27px, transparent 28px 48px);
}

.stage[data-template="rainbow"] .empty-state {
  background:
    linear-gradient(90deg, #ff7a7a 0 9px, transparent 9px calc(100% - 9px), #67c6ff calc(100% - 9px)),
    linear-gradient(180deg, #fff8fb, #fff2cd);
}

.stage[data-template="rainbow"] .empty-state::before {
  left: 36px;
  right: 36px;
  top: 26px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7a7a 0 16%, #ffd166 16% 32%, #76d7a0 32% 48%, #67c6ff 48% 64%, #b990ff 64% 80%, #ff9fc7 80%);
}

.stage[data-template="forest"] .empty-state {
  background:
    radial-gradient(ellipse at 82% 18%, rgba(255, 255, 255, .12) 0 76px, transparent 77px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .1) 0 2px, transparent 3px 30px),
    #438765;
}

.stage[data-template="forest"] .empty-state h2,
.stage[data-template="forest"] .empty-state p {
  color: #ffffff;
}

.stage[data-template="forest"] .empty-state p {
  background: rgba(45, 94, 70, .58);
  border-radius: 8px;
  padding: 10px 14px;
}

.stage[data-template="star"] .empty-state {
  background:
    radial-gradient(circle at 10% 86%, #39c985 0 34px, transparent 35px),
    radial-gradient(circle at 88% 24%, rgba(52, 183, 134, .2) 0 94px, transparent 95px),
    linear-gradient(90deg, transparent 0 calc(100% - 118px), #2cb083 calc(100% - 118px)),
    #fffdf8;
}

.stage[data-template="ai"] .empty-state {
  background:
    radial-gradient(circle at 12% 84%, var(--ai-accent-2, #52d996) 0 28px, transparent 29px),
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--ai-accent, #2cb083) 22%, transparent) 0 92px, transparent 93px),
    linear-gradient(90deg, transparent 0 calc(100% - 118px), var(--ai-accent, #2cb083) calc(100% - 118px)),
    var(--ai-bg, #fffdf8);
}

.stage[data-template="ocean"] .slide {
  background:
    radial-gradient(ellipse at 14% 21%, #ffffff 0 18px, transparent 19px),
    radial-gradient(ellipse at 20% 25%, #ffffff 0 12px, transparent 13px),
    radial-gradient(ellipse at 88% 17%, #ffffff 0 14px, transparent 15px),
    linear-gradient(155deg, transparent 0 66%, #f0d7b9 67%),
    #a9d9f2;
}

.stage[data-template="ocean"] .slide::before {
  height: 86px;
  background:
    radial-gradient(ellipse at 64% 32%, #2f70b7 0 44px, transparent 45px),
    radial-gradient(ellipse at 22% 60%, #2f70b7 0 30px, transparent 31px),
    repeating-radial-gradient(ellipse at 11% 80%, transparent 0 17px, rgba(255, 255, 255, .96) 18px 21px, transparent 22px 36px),
    #f2dcc4;
}

.stage[data-template="ocean"] .slide::after {
  height: 92px;
  background:
    radial-gradient(ellipse at 18% 64%, #2b74b6 0 30px, transparent 31px),
    radial-gradient(ellipse at 23% 72%, #245b85 0 18px, transparent 19px),
    repeating-radial-gradient(ellipse at 20% 14%, transparent 0 18px, rgba(255, 255, 255, .95) 19px 22px, transparent 23px 37px),
    linear-gradient(160deg, transparent 0 62%, #f1d7b8 63%),
    #a9d9f2;
}

.stage[data-template="rainbow"] .slide {
  background:
    radial-gradient(circle at 13% 82%, rgba(255, 209, 102, .36) 0 42px, transparent 43px),
    linear-gradient(90deg, #ff7a7a 0 8px, transparent 8px calc(100% - 8px), #67c6ff calc(100% - 8px)),
    linear-gradient(180deg, #fff8fb, #fff3cf);
}

.stage[data-template="rainbow"] .slide::before {
  left: 34px;
  right: 34px;
  top: 24px;
  width: auto;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff7a7a 0 16%, #ffd166 16% 32%, #76d7a0 32% 48%, #67c6ff 48% 64%, #b990ff 64% 80%, #ff9fc7 80%);
  box-shadow: 0 18px 0 rgba(255, 255, 255, .78);
}

.stage[data-template="rainbow"] .slide::after {
  height: 54px;
  background:
    repeating-linear-gradient(90deg, rgba(239, 111, 108, .18) 0 18px, transparent 19px 40px),
    #fff0b8;
}

.stage[data-template="forest"] .slide {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .18) 0 2px, transparent 2px 33.33%, rgba(255, 255, 255, .18) 33.33% calc(33.33% + 2px), transparent calc(33.33% + 2px) 66.66%, rgba(255, 255, 255, .18) 66.66% calc(66.66% + 2px), transparent calc(66.66% + 2px)),
    radial-gradient(ellipse at 12% 9%, rgba(255, 255, 255, .13) 0 58px, transparent 59px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .1) 0 2px, transparent 3px 32px),
    #438765;
}

.stage[data-template="forest"] .slide::before {
  height: 82px;
  background:
    radial-gradient(ellipse at 87% 19%, #d3462f 0 13px, transparent 14px),
    radial-gradient(ellipse at 81% 23%, #f4a641 0 10px, transparent 11px),
    radial-gradient(ellipse at 75% 18%, #75b94b 0 13px, transparent 14px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .16) 0 2px, transparent 3px 34px),
    #3c7f5f;
}

.stage[data-template="forest"] .slide::after {
  height: 62px;
  background:
    linear-gradient(180deg, #ffffff 0 38%, transparent 39%),
    #438765;
}

.stage[data-template="star"] .slide {
  background:
    radial-gradient(circle at 9% 87%, #39c985 0 26px, transparent 27px),
    radial-gradient(circle at 88% 24%, rgba(52, 183, 134, .22) 0 82px, transparent 83px),
    linear-gradient(90deg, transparent 0 calc(100% - 118px), #2cb083 calc(100% - 118px)),
    #fffdf8;
}

.stage[data-template="star"] .slide::before {
  height: 100px;
  background:
    radial-gradient(circle at 13% 70%, #52d996 0 18px, transparent 19px),
    radial-gradient(circle at 82% 40%, rgba(82, 217, 150, .42) 0 48px, transparent 49px),
    linear-gradient(135deg, transparent 0 76%, #f0d9ae 77% 100%),
    transparent;
}

.stage[data-template="star"] .slide::after {
  height: 78px;
  background:
    radial-gradient(circle at 7% 54%, #2cb083 0 22px, transparent 23px),
    radial-gradient(circle at 11% 72%, #5edb91 0 13px, transparent 14px),
    linear-gradient(90deg, transparent 0 72%, rgba(44, 176, 131, .16) 72%),
    transparent;
}

.stage[data-template="ocean"] .copy p,
.stage[data-template="rainbow"] .copy p,
.stage[data-template="forest"] .copy p,
.stage[data-template="star"] .copy p,
.stage[data-template="ai"] .copy p {
  border-radius: 6px;
}

.stage[data-template="ocean"] .copy p {
  border-color: rgba(36, 91, 133, .18);
  box-shadow: 10px 10px 0 rgba(45, 123, 186, .14);
}

.filmstrip {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  overflow-x: auto;
}

.filmstrip button {
  min-width: 86px;
  height: 50px;
  border: 3px solid var(--white);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: var(--deep);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.filmstrip button.active {
  background: var(--sun);
  color: var(--deep);
  border-color: var(--deep);
}

.pay-dialog {
  width: min(460px, calc(100vw - 36px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
}

.pay-dialog::backdrop {
  background: rgba(18, 63, 81, .42);
}

.dialog-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 4px solid var(--white);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(18, 63, 81, .3);
}

.dialog-card h2 {
  font-size: 28px;
}

.dialog-card p {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white);
  color: var(--deep);
  font-size: 22px;
  font-weight: 900;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  border: 2px solid var(--line);
  font-weight: 900;
}

.price-row strong {
  color: var(--coral);
  font-size: 26px;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .app-shell {
    padding: 0;
    width: 100%;
    overflow-x: hidden;
  }

  body {
    background: linear-gradient(180deg, #d9f5f1 0%, #fff8df 100%);
  }

  .workbench {
    display: block;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .panel,
  .preview-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .input-panel {
    padding: 16px 14px 18px;
    background: rgba(255, 250, 240, .96);
    width: 100%;
    max-width: 100vw;
  }

  .brand {
    margin-bottom: 12px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .brand strong {
    font-size: 19px;
  }

  .mobile-intro {
    display: grid;
    gap: 5px;
    margin: 0 0 14px;
    padding: 13px 14px;
    border: 2px solid rgba(18, 63, 81, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
  }

  .mobile-intro strong {
    color: var(--deep);
    font-size: 16px;
    line-height: 1.25;
  }

  .mobile-intro span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
  }

  .form {
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .form > * {
    min-width: 0;
  }

  .field input,
  .field select {
    height: 48px;
    font-size: 16px;
    border-radius: 10px;
  }

  .topic-toggle {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .topic-menu {
    max-height: 232px;
    border-radius: 12px;
  }

  .template-picker {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 148px;
    gap: 10px;
    margin-inline: 0;
    padding: 0 0 4px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .template-picker legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .template-card,
  .ai-template-card {
    min-width: 0;
    width: 148px;
    min-height: 126px;
    grid-template-columns: 1fr;
    scroll-snap-align: start;
  }

  .ai-template-card .template-thumb {
    height: 54px;
    grid-row: auto;
  }

  .dropzone {
    min-height: 156px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px 12px;
    border-radius: 14px;
    background:
      radial-gradient(circle at 20% 18%, rgba(255, 209, 102, .28) 0 28px, transparent 29px),
      repeating-linear-gradient(0deg, transparent 0 24px, rgba(47, 159, 154, .06) 25px 26px),
      rgba(255, 255, 255, .78);
  }

  .drop-icon {
    width: 64px;
    height: 64px;
    font-size: 40px;
  }

  .dropzone strong {
    font-size: 17px;
    max-width: 100%;
    text-align: center;
  }

  .dropzone em {
    max-width: 240px;
    font-size: 12px;
    text-align: center;
  }

  .thumbs {
    display: flex;
    gap: 8px;
    margin-inline: 0;
    padding: 0 0 4px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .thumbs::before {
    flex: 0 0 auto;
    align-self: center;
    min-width: max-content;
  }

  .thumbs img {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
  }

  .primary-btn {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 52px;
    font-size: 16px;
    display: grid;
    place-items: center;
    text-align: center;
  }

  .privacy-note {
    margin-top: 12px;
  }

  .preview-panel {
    min-height: 100vh;
    padding: 14px 12px 88px;
    background: rgba(255, 250, 240, .94);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .slide.cover .slide-inner,
  .slide.story-left .slide-inner,
  .slide.story-right .slide-inner {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 10px;
    margin: -14px -12px 12px;
    padding: 12px;
    background: rgba(255, 250, 240, .96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(18, 63, 81, .08);
  }

  .preview-toolbar h1 {
    max-width: calc(100vw - 24px);
    font-size: 20px;
  }

  .toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
  }

  .counter {
    min-width: 0;
    align-self: center;
  }

  .pay-btn {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    width: auto;
    height: 52px;
    box-shadow: 0 10px 26px rgba(239, 111, 108, .28);
  }

  .pay-btn:disabled {
    display: none;
  }

  .stage {
    width: 100%;
    border-width: 3px;
  }

  .stage-wrap {
    padding: 6px;
    border-radius: 10px;
  }

  .slide {
    padding: 18px 18px 28px;
  }

  .slide::before {
    height: 18px;
  }

  .slide::after {
    height: 26px;
  }

  .slide-inner {
    gap: 10px;
  }

  .slide.cover .slide-inner,
  .slide.story-left .slide-inner,
  .slide.story-right .slide-inner {
    align-content: center;
  }

  .copy {
    gap: 8px;
  }

  .copy h2 {
    font-size: clamp(23px, 7vw, 34px);
    line-height: 1.1;
  }

  .copy p {
    padding: 9px 10px;
    font-size: clamp(14px, 4.1vw, 20px);
    line-height: 1.34;
  }

  .eyebrow {
    height: 22px;
    max-width: 170px;
    font-size: 10px;
  }

  .name-stamp {
    width: 76px;
    height: 76px;
    font-size: 23px;
    border-width: 4px;
  }

  .photos {
    gap: 8px;
  }

  .photo-card {
    min-height: 116px;
    border-width: 3px;
  }

  .photos.three .photo-card {
    min-height: 90px;
  }

  .slide-number {
    right: 10px;
    bottom: 7px;
    font-size: 10px;
  }

  .toolbar-actions {
    flex-wrap: wrap;
  }

  .filmstrip {
    margin-inline: -12px;
    padding: 12px 12px 0;
  }

  .filmstrip button {
    min-width: 76px;
    height: 42px;
    font-size: 11px;
  }

  .empty-state {
    padding: 28px 18px;
  }

  .empty-state span {
    width: 62px;
    height: 62px;
    font-size: 24px;
  }

  .empty-state h2 {
    font-size: 22px;
  }

  .empty-state p {
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  .copy h2 {
    font-size: clamp(21px, 6.4vw, 30px);
  }

  .copy p {
    font-size: 13px;
  }

  .photo-card {
    min-height: 98px;
  }
}
