:root {
  color-scheme: light;
  --cream: #fffdf5;
  --ink: #42364d;
  --muted: #81778a;
  --coral: #ff5e7e;
  --orange: #ff9d42;
  --blue: #69c9e8;
  --line: #f1e8da;
  --shadow: 0 10px 28px rgba(100, 73, 52, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-bottom: 34px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Fredoka', sans-serif;
}

button, input { font: inherit; }
button { touch-action: manipulation; }

.navbar {
  min-height: 76px;
  padding: 14px max(6vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid #f7eee2;
}

.logo { color: var(--ink); font-size: 1.4rem; font-weight: 700; text-decoration: none; }
.logo span { margin-right: 5px; }
.header-note { color: var(--muted); font-family: 'Patrick Hand', cursive; font-size: 1.25rem; }
.navbar-tools { display: flex; align-items: center; gap: 18px; }
.language-picker select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font: inherit; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.hero {
  position: relative;
  overflow: hidden;
  padding: 52px 20px 38px;
  text-align: center;
}

.eyebrow, .offer-label {
  color: var(--coral);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero h1 { margin: 12px 0 10px; font-size: clamp(2.5rem, 7vw, 4.6rem); line-height: 0.99; }
.hero h1 span { color: var(--coral); }
.hero h1 .hero-title-main { color: inherit; }
.hero p { margin: 16px 0 0; color: var(--muted); font-family: 'Patrick Hand', cursive; font-size: 1.35rem; line-height: 1.35; }
.hero-doodles { position: absolute; inset: 22px 0 auto; max-width: 660px; margin: auto; pointer-events: none; }
.hero-doodles span { position: absolute; font-size: 1.7rem; }
.hero-doodles span:first-child { left: 5%; top: 48px; }
.hero-doodles span:nth-child(2) { right: 9%; top: 7px; }
.hero-doodles span:last-child { right: 1%; top: 93px; }

.editor-container { width: min(760px, 100% - 36px); margin: 0 auto; display: grid; gap: 20px; }
.card, .dev-card { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.step-card { padding: 26px; }
.step-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 18px; }
.step-heading h2, .offer-copy h2, .dev-card h2 { margin: 0; font-size: 1.3rem; }
.step-heading p, .dev-card p { margin: 3px 0 0; color: var(--muted); font-family: 'Patrick Hand', cursive; font-size: 1.1rem; }
.step-number { flex: 0 0 38px; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #fff; background: var(--coral); font-weight: 700; box-shadow: 0 4px 0 #e34a68; }
.step-number.orange { background: var(--orange); box-shadow: 0 4px 0 #e6822d; }

.photo-tips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.photo-tips span { padding: 7px 11px; border-radius: 99px; background: #fff7e8; color: #725c48; font-size: 0.82rem; }
.photo-tips span:nth-child(2) { background: #e9f8fc; }
.photo-tips span:nth-child(3) { background: #fff0f3; }
.upload-guide { display: flex; gap: 12px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid #f6dd8f; border-left: 5px solid #f5b82e; border-radius: 16px; background: #fff8dc; }
.guide-icon { flex: none; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #ffeaa0; font-size: 1rem; }
.guide-body { min-width: 0; }
.guide-title { margin: 0 0 4px; font-weight: 700; font-size: 1rem; }
.guide-text { margin: 0; font-size: 0.9rem; line-height: 1.45; color: #5d4a38; }

.upload-zone {
  position: relative;
  display: grid;
  min-height: 195px;
  place-items: center;
  padding: 24px;
  border: 2px dashed #f4a1b2;
  border-radius: 20px;
  background: #fff9f7;
  text-align: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.upload-zone:hover, .upload-zone:focus-visible, .upload-zone.drag-over { border-color: var(--coral); background: #fff1f4; outline: none; }
.upload-zone:active { transform: scale(0.99); }
.upload-icon { display: block; margin-bottom: 7px; font-size: 2.5rem; }
.upload-content p { margin: 4px; font-size: 1.08rem; }
.upload-content > span:not(.upload-icon) { color: var(--muted); font-family: 'Patrick Hand', cursive; font-size: 1.12rem; }
.upload-content u { color: var(--coral); }
.upload-content small { display: block; margin-top: 10px; color: #a29aa6; }
.preview-img { max-width: 100%; max-height: 280px; border-radius: 14px; object-fit: contain; }
.preview-actions { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.preview-action { padding: 8px 12px; border: 0; border-radius: 99px; background: #fff; color: var(--ink); box-shadow: 0 2px 10px #42364d25; cursor: pointer; }

.form-group { margin-top: 21px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-group label span { color: var(--muted); font-family: 'Patrick Hand', cursive; font-weight: 400; }
.form-group input, .form-group select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: #fffdfa; }
.form-group input:focus, .form-group select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #69c9e81c; }
.form-group input::placeholder { color: #b4abb6; }
.aspect-group { border: 0; padding: 0; margin-inline: 0; min-width: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.aspect-group legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.form-group .aspect-option { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fffdfa; cursor: pointer; font-weight: 500; }
.form-group .aspect-option input { width: auto; padding: 0; position: absolute; opacity: 0; pointer-events: none; }
.music-group { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.music-group legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.music-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.music-card { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 12px 40px 12px 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--tint, #fffdfa); cursor: pointer; font-weight: 600; transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease; }
.music-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(255, 102, 133, 0.12); }
.form-group .music-card input { width: auto; padding: 0; position: absolute; opacity: 0; pointer-events: none; }
.music-pink { --tint: #fff1f4; }
.music-teal { --tint: #e8f8fc; }
.music-yellow { --tint: #fff8e1; }
.music-lilac { --tint: #f3eefc; }
.music-mint { --tint: #eaf8ef; }
.music-orange { --tint: #fff0e3; }
.music-icon { flex: 0 0 40px; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: #fff; font-size: 1.4rem; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06); }
.music-name { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.music-check { position: absolute; top: 50%; right: 10px; width: 24px; height: 24px; margin-top: -12px; opacity: 0; transform: scale(0.6); transition: opacity 150ms ease, transform 150ms ease; }
.music-check circle { fill: #ff6685; }
.music-check path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.music-card:has(input:checked) { border-color: #ff6685; box-shadow: 0 0 0 3px rgba(255, 102, 133, 0.16); }
.music-card:has(input:checked) .music-check { opacity: 1; transform: scale(1); }
.music-card:has(input:focus-visible) { outline: 2px solid #ff6685; outline-offset: 2px; }
@media (max-width: 380px) { .music-grid { gap: 8px; } .music-card { padding: 10px 34px 10px 10px; font-size: 0.92rem; } .music-icon { flex-basis: 34px; width: 34px; height: 34px; } }
.style-card { position: relative; flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 8px 8px 12px; border: 2px solid var(--line); border-radius: 18px; background: #fffdfa; cursor: pointer; text-align: center; transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease; }
.style-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255, 102, 133, 0.14); }
.form-group .style-card input { width: auto; padding: 0; position: absolute; opacity: 0; pointer-events: none; }
.style-card-img { display: block; width: 100%; height: auto; border-radius: 12px; }
.style-card-title { margin-top: 6px; font-weight: 700; }
.style-card-sub { padding: 0 4px; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.style-card-check { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; opacity: 0; transform: scale(0.6); transition: opacity 150ms ease, transform 150ms ease; }
.style-card-check circle { fill: #ff6685; }
.style-card-check path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.style-card:has(input:checked) { border-color: #ff6685; border-width: 3px; padding: 7px 7px 11px; background: #fff7f9; box-shadow: 0 0 0 3px rgba(255, 102, 133, 0.16); }
.style-card:has(input:checked) .style-card-check { opacity: 1; transform: scale(1); }
.style-card:has(input:focus-visible) { outline: 2px solid #ff6685; outline-offset: 2px; }
@media (max-width: 560px) {
  .style-group:not(.bg-group) { flex-wrap: nowrap; justify-content: center; gap: 8px; }
  .style-group:not(.bg-group) .style-card { display: flex; flex-direction: column; margin: 0; cursor: pointer; container-type: size; flex: 0 1 168px; aspect-ratio: 1 / 1; gap: 2px; padding: 6px 6px 8px; border-radius: 18px; overflow: hidden; }
  .style-group:not(.bg-group) .style-card:has(input:checked) { padding: 5px 5px 7px; }
  .style-group:not(.bg-group) .style-card-img { flex: 0 0 auto; width: 100%; height: 46cqh; object-fit: contain; }
  .style-group:not(.bg-group) .style-card-title { margin-top: 2px; font-size: 1rem; font-weight: 700; line-height: 1.1; }
  .style-group:not(.bg-group) .style-card-sub { padding: 0 2px; font-size: 0.8125rem; line-height: 1.15; }
  .style-group:not(.bg-group) .style-card-check { top: 9px; right: 9px; width: 22px; height: 22px; }
}
@media (min-width: 561px) {
  .style-group:not(.bg-group) { flex-wrap: nowrap; justify-content: center; gap: 16px; }
  .style-group:not(.bg-group) .style-card { display: flex; flex-direction: column; margin: 0; cursor: pointer; container-type: size; flex: 0 0 232px; width: 232px; aspect-ratio: 1 / 1; gap: 3px; padding: 8px 8px 10px; overflow: hidden; }
  .style-group:not(.bg-group) .style-card:has(input:checked) { padding: 7px 7px 9px; }
  .style-group:not(.bg-group) .style-card-img { flex: 0 0 auto; width: 100%; height: 58cqh; object-fit: contain; }
  .style-group:not(.bg-group) .style-card-title { margin-top: 4px; font-size: 1.1875rem; font-weight: 700; line-height: 1.15; }
  .style-group:not(.bg-group) .style-card-sub { padding: 0 4px; font-size: 0.84375rem; line-height: 1.2; }
  .style-group:not(.bg-group) .style-card:hover:not(:has(input:checked)) { transform: translateY(-3px); border-color: #d9b992; box-shadow: 0 8px 18px rgba(255, 102, 133, 0.16); }
}
.aspect-option:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px #69c9e81c; }
.aspect-option:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.bg-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.bg-group legend, .bg-group .field-hint { grid-column: 1 / -1; }
.form-group .bg-option { flex: none; flex-direction: column; justify-content: flex-start; text-align: center; font-size: 0.88rem; padding: 8px; gap: 6px; }
.bg-thumb { width: 100%; max-width: 96px; aspect-ratio: 1; height: auto; object-fit: cover; border: 3px solid var(--line); border-radius: 12px; background: #fff; }
.bg-thumb-original { display: grid; place-items: center; font-size: 2rem; background: repeating-linear-gradient(45deg, #fff, #fff 6px, #f4efe6 6px, #f4efe6 12px); }
@media (max-width: 480px) { .bg-group { grid-template-columns: repeat(2, 1fr); } }
.aspect-box { flex: none; border: 2px solid var(--ink); border-radius: 4px; background: #fff; }
.aspect-vertical { width: 18px; height: 32px; }
.aspect-square { width: 26px; height: 26px; }

.offer-card { position: relative; overflow: hidden; padding: 27px; border: 2px solid #ffcf77; background: linear-gradient(135deg, #fff9e9, #fff3f5); }
.offer-sparkle { position: absolute; top: 19px; right: 24px; font-size: 2rem; }
.offer-label { color: #d98228; }
.offer-copy h2 { margin-top: 6px; font-size: 1.55rem; }
.offer-copy h2 span { color: var(--coral); }
.offer-copy p { max-width: 530px; margin: 7px 0 18px; color: var(--muted); line-height: 1.45; }
.btn-primary, .btn-secondary {
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  border: 0;
  border-radius: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.btn-primary { color: #fff; background: var(--coral); box-shadow: 0 5px 0 #dd4565, 0 9px 16px #ff5e7e30; font-size: 1.05rem; }
.btn-primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 7px 0 #dd4565, 0 12px 20px #ff5e7e35; }
.btn-primary:not(:disabled):active, .btn-secondary:not(:disabled):active { transform: translateY(3px); box-shadow: none; }
.btn-primary:disabled, .btn-secondary:disabled { cursor: not-allowed; opacity: 0.55; }
.status { min-height: 1.25em; margin: 10px 0 0; color: #7a6277; text-align: center; font-family: 'Patrick Hand', cursive; font-size: 1.1rem; }
.status-error { color: #c62828; }

.dev-card { padding: 22px 26px; border-style: dashed; background: #fff; }
.dev-card h2 { font-size: 1.1rem; }
.dev-card > div:first-child { margin-bottom: 14px; }
.dev-card p { font-size: 1rem; }
.btn-secondary { color: #397c92; background: #e8f8fc; box-shadow: 0 4px 0 #b6e6f2; }
.btn-secondary:not(:disabled):hover { transform: translateY(-2px); background: #d8f3fa; }
/* Main CTA: the "✨" star icon comes from the translated label (createPreview). */
#btnTest { min-height: 62px; padding: 16px 24px; border-radius: 22px; color: #fff; background: #ff6685; box-shadow: 0 6px 0 #e04a69, 0 12px 24px rgba(255, 102, 133, 0.38); font-size: 1.2rem; font-weight: 800; letter-spacing: 0.01em; }
#btnTest:not(:disabled):hover { background: #ff7893; filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 8px 0 #e04a69, 0 16px 28px rgba(255, 102, 133, 0.42); }
#btnTest:not(:disabled):active { transform: translateY(3px); box-shadow: 0 2px 0 #e04a69; }
.generation-progress { margin: 18px 0 8px; padding: 16px; border: 1px solid #d8f1f7; border-radius: 18px; background: linear-gradient(135deg, #f2fcff, #fff8f2); }
.progress-message { margin: 0 0 11px !important; color: #547888 !important; text-align: center; font-family: 'Patrick Hand', cursive !important; font-size: 1.15rem !important; }
.progress-row { display: flex; gap: 12px; align-items: center; }
.progress-track { flex: 1; height: 16px; overflow: hidden; border: 2px solid #d5eef5; border-radius: 99px; background: #fff; }
.progress-fill { position: relative; width: 0; height: 100%; overflow: hidden; border-radius: inherit; background: linear-gradient(90deg, #68cbe8, #ff9d80, #ff7895); transition: width 450ms ease; }
.progress-fill::after { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, #ffffff85 48%, transparent 76%); content: ''; animation: progress-shimmer 1.5s linear infinite; }
.progress-value { min-width: 42px; color: #527b89; font-size: 0.9rem; font-weight: 700; text-align: right; }
@keyframes progress-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.result-box { margin-top: 14px; }
.video-preview { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.result-box video { display: block; width: min(100%, 320px); max-height: 560px; border-radius: 16px; background: #231c2b; }
.result-box .offer-card { margin-top: 20px; }
.offer-card .btn-secondary { margin-top: 9px; }

.credits-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px; }
.credit-pill { padding: 8px 14px; border: 2px solid var(--line); border-radius: 99px; background: #fffdfa; font-weight: 600; }
.credit-pill strong { color: var(--coral); font-size: 1.15rem; }
.btn-secondary.credits-buy { width: auto; min-height: 40px; margin-left: auto; padding: 8px 16px; }
.auth-box { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.auth-box.auth-highlight { animation: authPulse 1.2s ease-out 2; border-radius: 12px; }
@keyframes authPulse { 0% { box-shadow: 0 0 0 0 rgba(57, 124, 146, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(57, 124, 146, 0); } }
.auth-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.auth-user { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-secondary.auth-logout { width: auto; min-height: 36px; padding: 6px 14px; }
@media (max-width: 560px) { .auth-user { display: none; } .auth-box { gap: 6px; } }

.packages-modal { width: min(980px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 28px 24px 22px; border: 0; border-radius: 26px; background: var(--cream); color: var(--ink); box-shadow: 0 24px 70px #42364d55; }
.packages-modal::backdrop { background: #2a203199; backdrop-filter: blur(3px); }
.packages-modal h2 { margin: 0; text-align: center; font-size: 1.6rem; }
.packages-intro { max-width: 620px; margin: 8px auto 22px; color: var(--muted); text-align: center; line-height: 1.45; }
.packages-note { margin: 14px 0 0; color: var(--muted); text-align: center; font-size: 0.9rem; }
.packages-close { position: absolute; top: 12px; right: 14px; margin: 0; }
.modal-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 2px 8px #42364d25; cursor: pointer; font-size: 1rem; }
.packages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: stretch; }
.package-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px 16px 18px; border: 2px solid var(--line); border-radius: 22px; background: #fff; text-align: center; }
.package-card h3 { margin: 0; font-size: 1.25rem; }
.package-card .btn-primary, .package-card .btn-secondary { margin-top: auto; }
.package-card .btn-primary + .btn-secondary { margin-top: 8px; }
.package-card ul { display: grid; gap: 8px; margin: 10px 0 16px; padding: 0; list-style: none; }
.package-price { margin: 4px 0 0; color: var(--coral); font-size: 2rem; font-weight: 700; line-height: 1; }
.package-per-video { margin: 0; color: var(--muted); font-size: 0.9rem; }
.package-equivalence { margin: 0; font-weight: 700; font-size: 0.95rem; }
.credit-rule { margin: 0.4rem 0 0; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.promo-form { margin: 0.8rem 0 0; }
.promo-label { display: block; margin: 0 0 4px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.promo-row { display: flex; gap: 8px; align-items: stretch; }
.promo-input { flex: 1; min-width: 0; padding: 8px 12px; font: inherit; text-transform: uppercase; border: 2px solid currentColor; border-radius: 12px; }
.btn-secondary.promo-button { width: auto; min-height: 40px; padding: 8px 16px; }
.package-videos { font-weight: 600; }
.package-gift { padding: 6px 8px; border-radius: 12px; background: #fff3d6; color: #a55f0f; font-size: 0.92rem; font-weight: 600; }
.package-popular { border-color: var(--coral); background: linear-gradient(180deg, #fff6f8, #fff); box-shadow: 0 12px 30px #ff5e7e33; transform: translateY(-6px); }
.package-badge { position: absolute; top: -13px; left: 50%; padding: 5px 12px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 0.78rem; font-weight: 700; white-space: nowrap; transform: translateX(-50%); }
@media (max-width: 560px) { .package-popular { transform: none; margin-top: 8px; } .btn-secondary.credits-buy { width: 100%; margin-left: 0; } }
.download-video { display: block; margin-top: 9px; color: #fff; text-decoration: none; text-align: center; }
.btn-download { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin: 14px 0 4px; padding: 14px 20px; border: 0; border-radius: 16px; background: linear-gradient(135deg, #ff5e7e, #ff9a3c); color: #fff; font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px #ff5e7e55; touch-action: manipulation; }
.btn-download:hover { filter: brightness(1.05); }
.btn-download:active { transform: translateY(1px); }
.btn-download:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn-download:disabled { opacity: 0.7; cursor: progress; }
.btn-download.hidden { display: none; }
@media (min-width: 600px) { .btn-download { max-width: 420px; margin-inline: auto; } }
.footer-links { display: flex; justify-content: center; gap: 18px; margin-top: 10px; }
.footer-link { border: 0; background: none; padding: 4px 2px; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.footer-link:hover, .footer-link:focus-visible { color: var(--ink); }
.legal-modal { max-height: 85vh; overflow-y: auto; text-align: left; }
.legal-modal h3 { margin: 14px 0 4px; font-size: 1.05rem; }
.legal-modal p { margin: 0; line-height: 1.5; }
footer { padding: 26px 12px 0; color: var(--muted); text-align: center; font-family: 'Patrick Hand', cursive; font-size: 1.1rem; }
.hidden { display: none !important; }

button:focus-visible, a:focus-visible { outline: 3px solid #69c9e880; outline-offset: 3px; }

@media (max-width: 560px) {
  .navbar { min-height: 64px; padding: 12px 18px; }
  .logo { font-size: 1.2rem; }
  .navbar-tools { gap: 8px; }
  .header-note { font-size: 1rem; }
  .hero { padding: 40px 18px 28px; }
  .hero p br { display: none; }
  .editor-container { width: calc(100% - 24px); gap: 14px; }
  .step-card, .offer-card { padding: 20px 17px; }
  .step-heading h2 { font-size: 1.12rem; }
  .photo-tips { gap: 6px; }
  .photo-tips span { padding: 6px 8px; font-size: 0.76rem; }
  .upload-zone { min-height: 180px; padding: 20px 12px; }
  .offer-copy h2 { font-size: 1.32rem; }
  .dev-card { padding: 19px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .progress-fill::after { animation: none; }
}

.demo-figure { width: min(340px, 82vw); margin: 22px auto 0; }
.demo-video { display: block; width: 100%; max-height: 62vh; border: 4px solid #fff; border-radius: 22px; background: #fff; box-shadow: var(--shadow); object-fit: contain; }
.demo-figure figcaption { margin-top: 12px; color: var(--muted); font-family: 'Patrick Hand', cursive; font-size: 1.3rem; }

.card-group { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.card-group legend { padding: 0; margin-bottom: 10px; font-weight: 600; }
.card-message-row { margin-bottom: 12px; }
.card-message-row label { display: block; margin-bottom: 6px; font-weight: 600; }
.card-message-row input { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; outline: none; color: var(--ink); background: #fffdfa; }
.card-message-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #69c9e81c; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
.chip-group legend { width: 100%; padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }
.chip { position: relative; margin: 0; padding: 8px 14px; border: 2px solid var(--line); border-radius: 99px; background: #fffdfa; cursor: pointer; font-weight: 500; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--coral); background: #fff1f4; box-shadow: 0 0 0 3px #ff5e7e1c; }
.chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip-font-playful { font-family: 'Fredoka', sans-serif; }
.chip-font-handwritten { font-family: 'Caveat', cursive; font-size: 1.25rem; }
.chip-font-party { font-family: 'Baloo 2', sans-serif; }
.chip-font-cute { font-family: 'Patrick Hand', cursive; font-size: 1.1rem; }
.card-preview-label { margin: 6px 0 8px; color: var(--muted); font-size: 0.9rem; }

.card-preview { --card-text: #c8326c; --paper: #fffdfa; --frame: #f4e0dd; position: relative; display: flex; flex-direction: column; width: min(100%, 300px); margin: 0 auto; overflow: hidden; container-type: inline-size; background: var(--paper); aspect-ratio: 9 / 16; }
.card-preview[data-ratio="1:1"] { aspect-ratio: 1 / 1; }
.card-preview-art { display: grid; box-sizing: border-box; flex: 1 1 0; min-height: 0; padding: 1.11cqw 0; place-items: center; color: #b4abb6; font-size: 4cqw; text-align: center; }
.card-preview-window { position: relative; display: grid; box-sizing: border-box; height: min(100%, 174.49cqw); aspect-ratio: 9 / 16; place-items: center; background: var(--paper); }
.card-preview[data-ratio="1:1"] .card-preview-window { height: min(100%, 98.15cqw); aspect-ratio: 1 / 1; }
.card-preview-window::after { position: absolute; inset: -0.65cqw; border: 0.18cqw solid var(--frame); border-radius: 1.1cqw; content: ""; pointer-events: none; }
.card-preview-window img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-preview-banner { position: relative; min-width: 0; box-sizing: border-box; flex: none; margin: 0; padding: 1.11cqw 0 2.96cqw; background: #fff8f8; color: var(--card-text); text-align: center; }
.card-preview-banner span { width: 79.63%; margin: 0 auto; }
.card-preview-banner span { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; -webkit-text-stroke: 0.15cqw var(--card-text); }
.card-preview[data-font="playful"] .card-preview-banner { font-family: 'Fredoka', sans-serif; }
.card-preview[data-font="handwritten"] .card-preview-banner { font-family: 'Caveat', cursive; }
.card-preview[data-font="party"] .card-preview-banner { font-family: 'Baloo 2', sans-serif; }
.card-preview[data-font="cute"] .card-preview-banner { font-family: 'Patrick Hand', cursive; }
.cropper-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(40, 30, 50, 0.7); }
.cropper-box { display: flex; flex-direction: column; gap: 10px; width: min(100%, 460px); max-height: 100%; overflow: auto; padding: 16px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); }
.cropper-box h3 { margin: 0; }
.cropper-hint { margin: 0; color: var(--muted); font-size: 0.95rem; }
.cropper-canvas { align-self: center; max-width: 100%; max-height: 52vh; border: 2px dashed var(--coral); border-radius: 8px; background: #fff; cursor: grab; touch-action: none; }
.cropper-canvas:active { cursor: grabbing; }
.cropper-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cropper-controls input[type="range"] { flex: 1 1 120px; min-width: 100px; }
.cropper-controls .btn-secondary, .cropper-actions .btn-primary, .cropper-actions .btn-secondary { width: auto; min-height: 40px; padding: 8px 14px; }
.cropper-actions { display: flex; justify-content: flex-end; gap: 10px; }
body.cropper-open { overflow: hidden; }

.background-group { display: flex; flex-wrap: wrap; gap: 10px; }
.bg-option { cursor: pointer; }
.bg-option input { position: absolute; opacity: 0; pointer-events: none; }
.bg-option:has(input:checked) .bg-thumb { border-color: var(--coral); box-shadow: 0 0 0 2px #ff5e7e40; }
.bg-option:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 760px; margin: 22px auto 0; }
.demo-grid .demo-figure { width: 100%; margin: 0; }
.demo-grid .demo-video { max-height: 56vh; }
.demo-figure { position: relative; }
.demo-sound { position: absolute; top: 10px; right: 10px; padding: 6px 12px; font: inherit; font-size: 0.85rem; color: #fff; background: rgba(66, 54, 77, 0.72); border: 0; border-radius: 999px; cursor: pointer; backdrop-filter: blur(4px); }
.demo-sound:hover, .demo-sound:focus-visible { background: rgba(66, 54, 77, 0.92); }
.demo-sound[aria-pressed="true"] { background: var(--coral); }
.demo-grid .demo-figure figcaption { font-size: 1.15rem; }
@media (max-width: 640px) { .demo-grid { grid-template-columns: 1fr; gap: 24px; } .demo-grid .demo-figure { width: min(340px, 82vw); margin-inline: auto; } }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 16px 0 0; }
.retry-modal { max-width: 440px; text-align: center; }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }
.packages-notice { margin: 14px 0 0; padding: 10px 14px; border: 1px solid #f6dd8f; border-radius: 12px; background: #fff8dc; color: #5d4a38; font-size: 0.88rem; line-height: 1.4; text-align: center; }
