:root {
  --bg: #FBF2F1; --stage: #F8ECEA; --text: #4A3236; --muted: #7A5A5E; --accent: #E7B8BB; --accent-ink: #4A3236;
  --seal: #A9666D; --seal-ring: #DDA9AD; --seal-ink: #FFFBFA; --paper: #FFFBFA; --paper-ink: #4A3236; --line: #EBD3D3; --error: #A3283C;
  --font-display: Gloock, Georgia, serif; --font-text: Literata, Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
html { background: var(--bg); transition: background-color .4s ease; }
body { background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--font-text); -webkit-font-smoothing: antialiased; transition: background-color .4s ease, color .4s ease; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
h1, h2, p { margin: 0; }

.app { min-height: 100dvh; display: grid; justify-items: center; align-content: start; padding: clamp(24px, 7vh, 72px) 20px 48px; }
.app.open-fill { padding: 0; display: block; justify-items: stretch; }
.step, .preview, .share, .notice { width: min(100%, 460px); }
.progress { color: var(--muted); font-size: .9375rem; margin-bottom: 12px; }
.question { font: 400 clamp(1.75rem, 7vw, 2.25rem)/1.18 var(--font-display); margin-bottom: 12px; }
.help { color: var(--muted); margin-bottom: 8px; }
.step .options, .step > .input, .step .row, .step .textarea, .step .theme-grid { margin-top: 24px; }

.input { width: 100%; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font: inherit; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus-visible { outline: 2px solid var(--seal); outline-offset: 1px; }
.textarea { display: block; line-height: 1.75; resize: vertical; }
.row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.options { display: grid; gap: 10px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.option > span { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: 12px; transition: background-color .2s, border-color .2s; }
.option input:checked + span { background: var(--accent); border-color: var(--seal); color: var(--accent-ink); }
.option input:focus-visible + span { outline: 2px solid var(--seal); outline-offset: 3px; }
.option-text { display: grid; }
.option-text small { font-size: .875rem; opacity: .85; }
.theme-grid .options { grid-template-columns: 1fr 1fr; }
.option-theme > span { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
.swatch { display: flex; align-items: center; gap: 6px; width: 100%; height: 54px; padding: 0 12px; border: 1px solid; border-radius: 9px; }
.swatch span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid transparent; }
.swatch span:first-child { width: 34px; height: 26px; border-radius: 4px; }
.count { color: var(--muted); font-size: .9375rem; text-align: right; margin-top: 6px; }
.error { color: var(--error); min-height: 1.6em; margin-top: 12px; }

.actions { display: flex; gap: 12px; margin-top: 12px; }
.actions .btn { flex: 1; }
.btn { display: inline-block; text-align: center; text-decoration: none; cursor: pointer; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 999px; padding: 13px 26px; font: 500 1rem/1.3 var(--font-text); transition: filter .2s; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.link { color: var(--text); text-underline-offset: 3px; }

.preview { display: grid; justify-items: center; text-align: center; }
.preview .actions { width: 100%; margin-top: 20px; }
.phone { height: max(440px, calc(100dvh - 250px)); aspect-ratio: 390 / 740; max-width: 100%; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; margin-top: 16px; position: relative; box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--seal) 45%, transparent); }
.share .input { margin-top: 20px; }
.qr { width: 190px; margin: 20px 0; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 8px; }

.notice { text-align: center; padding-top: 12vh; }
.small-seal, .home-seal { width: 92px; height: 92px; margin: 0 auto 28px; border-radius: 47% 53% 50% 50%; background: var(--seal); box-shadow: inset 0 0 0 7px var(--seal-ring), inset 0 0 0 9px var(--seal); }
.clock { display: flex; justify-content: center; gap: 28px; margin-top: 24px; }
.time strong { display: block; font: 400 2.5rem/1 var(--font-display); color: var(--seal); }
.time span { font-size: .9375rem; color: var(--muted); }

.home { min-height: 100dvh; width: min(100%, 560px); margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; }
.wordmark { font: 400 1.375rem/1 var(--font-display); color: var(--seal); position: absolute; top: 28px; }
.home h1 { font: 400 clamp(2.5rem, 10vw, 3.75rem)/1.1 var(--font-display); margin-bottom: 18px; }
.home-lead { color: var(--muted); max-width: 36ch; margin-bottom: 30px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.field-label { display: block; color: var(--muted); font-size: .9375rem; margin: 16px 0 6px; }
.secret-fields { margin-top: 12px; }
.list-fields { display: grid; gap: 10px; margin-top: 24px; }
.list-row { display: flex; gap: 8px; align-items: center; }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 1.25rem; cursor: pointer; }
.btn-small { justify-self: start; padding: 9px 18px; font-size: .9375rem; }
.gate .input { margin-top: 20px; text-align: center; }
.gate .btn { min-width: 200px; }
.gate-hint { font: 400 1.4rem/1.3 var(--font-display); color: var(--seal); margin-top: 18px; }
.link-button { background: none; border: 0; padding: 4px; font: inherit; cursor: pointer; text-decoration: underline; }

@media (min-width: 900px) {
  .preview { width: min(100%, 960px); grid-template-columns: auto minmax(0, 1fr); column-gap: 56px; align-content: center; justify-items: start; text-align: left; }
  .preview > * { grid-column: 2; }
  .preview > .phone { grid-column: 1; grid-row: 1 / span 5; height: min(820px, calc(100dvh - 96px)); margin-top: 0; }
  .preview .actions { margin-top: 12px; }
  .app:has(.preview) { align-content: center; padding-top: 32px; padding-bottom: 32px; }
}
@media (max-width: 480px) {
  .app:has(.preview) { padding: 16px 12px 24px; }
  .preview .question { font-size: 1.5rem; margin-bottom: 4px; }
  .preview > .help { display: none; }
  .phone { width: 100%; height: auto; min-height: 0; border-radius: 22px; margin-top: 8px; }
  .app:has(.preview) { padding-bottom: 0; }
  .preview .actions { position: sticky; bottom: 0; z-index: 10; width: calc(100% + 24px); margin: 12px -12px 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
  .preview .error:empty { display: none; }
}
.test-banner { position: fixed; left: 10px; bottom: 10px; z-index: 50; margin: 0; padding: 4px 10px; border-radius: 999px; background: #3a3446; color: #fff; font: 500 .75rem/1.4 system-ui, sans-serif; pointer-events: none; opacity: .85; }
.word-grid .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.word-grid .option > span { padding: 12px 14px; overflow-wrap: anywhere; }
.step .word-grid .options { margin-top: 12px; }
.own-word { margin-top: 20px; display: grid; gap: 8px; }
.own-word .row { display: flex; gap: 10px; margin-top: 0; }
.own-word .row .input { flex: 1 1 auto; min-width: 0; }
.own-word .row .btn { flex: 0 0 auto; }
.toggle-list { display: grid; gap: 16px; margin-top: 24px; }
.option-toggle > span { font-weight: 500; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; }
.plan-price { font: 400 1.25rem/1 var(--font-display); white-space: nowrap; }
.option-plan > span, .option-plan .option-text { width: 100%; }
.option-plan small { display: block; margin-top: 6px; line-height: 1.45; }

/* Gifts */
.home-gift { margin-top: 18px; }
.gifts { width: min(100%, 760px); }
.gift-none { display: flex; gap: 12px; align-items: center; margin-top: 24px; padding: 16px 18px; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.gift-none input { accent-color: var(--seal); width: 18px; height: 18px; flex: none; }
.gift-none span { display: grid; gap: 2px; }
.gift-none small { color: var(--muted); font-size: .875rem; }
.gift-none.is-on { border-color: var(--seal); box-shadow: 0 0 0 1px var(--seal); }
.gift-group { margin-top: 28px; }
.gift-group h2 { font: 400 1.25rem/1.3 var(--font-display); margin-bottom: 12px; }
.gift-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gift-card { position: relative; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 4px; text-align: left; padding: 12px 12px 14px; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: 16px; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.gift-card:hover { border-color: color-mix(in srgb, var(--seal) 55%, var(--line)); }
.gift-card:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.gift-card.is-on { border-color: var(--seal); box-shadow: 0 0 0 1px var(--seal); }
.gift-card-art { display: grid; place-items: center; aspect-ratio: 6 / 5; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--paper)); margin-bottom: 6px; overflow: hidden; }
.gift-art { width: 78%; height: auto; }
.gift-photo { width: 100%; height: 100%; object-fit: cover; }
.gift-card-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.gift-card-blurb { color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.gift-card-price { font: 400 1.125rem/1.2 var(--font-display); margin-top: 6px; }
.gift-card-cta { font-size: .8125rem; color: var(--seal); font-weight: 600; }
.gift-badge { position: absolute; top: 18px; left: 18px; z-index: 1; padding: 2px 8px; border-radius: 999px; background: var(--seal); color: var(--seal-ink); font-size: .6875rem; font-weight: 600; letter-spacing: .02em; }
.gift-chosen { display: grid; gap: 4px; margin-top: 24px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--bg)); font-size: .9375rem; }
.gift-chosen .link { justify-self: start; margin-top: 4px; background: none; border: 0; padding: 0; font: inherit; color: var(--seal); text-decoration: underline; cursor: pointer; }
.gifts .actions { margin-top: 24px; }
.gifts .error:empty { display: none; }

/* Customise sheet */
body.has-sheet { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--text) 38%, transparent); animation: fade .18s ease-out; }
.sheet { width: min(100%, 520px); max-height: min(88dvh, 760px); display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); color: var(--text); border-radius: 20px; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .45); overflow: hidden; animation: rise .22s ease-out; }
.sheet-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font: 400 1.375rem/1.2 var(--font-display); }
.sheet-head .help { margin: 2px 0 0; font-size: .875rem; }
.sheet-art { display: grid; place-items: center; width: 72px; aspect-ratio: 1; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--paper)); overflow: hidden; }
.sheet-close { align-self: start; }
.sheet-body { overflow-y: auto; padding: 4px 18px 18px; overscroll-behavior: contain; }
.includes { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; padding: 0; }
.includes li { padding: 4px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.part { padding-top: 16px; }
.part + .part { border-top: 1px solid var(--line); margin-top: 16px; }
.part h3 { font: 600 1rem/1.3 inherit; margin-bottom: 4px; }
.choice { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.choice legend { font-size: .875rem; color: var(--muted); margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--paper-ink); font-size: .9375rem; line-height: 1.3; }
.chip small { color: var(--muted); font-size: .75rem; }
.chip input:checked + span { border-color: var(--seal); background: color-mix(in srgb, var(--seal) 14%, var(--paper)); box-shadow: 0 0 0 1px var(--seal); }
.chip input:focus-visible + span { outline: 2px solid var(--seal); outline-offset: 2px; }
.chip-detail { margin: 6px 0 0; font-size: .8125rem; }
.part-text { display: grid; gap: 6px; margin-top: 14px; }
.part-text .error { margin: 0; font-size: .875rem; }
.sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.sheet-foot .btn { width: 100%; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

/* Delivery and review */
.delivery .fields { display: grid; gap: 14px; margin-top: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field .error { margin: 0; font-size: .875rem; }
.field-label { font-size: .9375rem; font-weight: 500; }
.field-divider { height: 1px; background: var(--line); margin: 6px 0; }
.field-note { margin-top: -6px; font-size: .875rem; }
select.input { appearance: auto; }
.receipt { margin-top: 20px; padding: 16px 18px; border-radius: 16px; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); display: grid; gap: 10px; }
.receipt-row { display: flex; justify-content: space-between; gap: 16px; }
.receipt-row span:last-child { white-space: nowrap; }
.receipt-lines { margin: -4px 0 0; padding-left: 18px; color: var(--muted); font-size: .875rem; display: grid; gap: 2px; }
.receipt-total { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 600; font-size: 1.0625rem; }
.receipt-address { display: grid; gap: 2px; margin: 16px 0 12px; font-size: .9375rem; overflow-wrap: anywhere; }
.order-done { padding: 18px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 14%, var(--bg)); margin-bottom: 28px; display: grid; gap: 8px; justify-items: start; }
.order-id { font-size: .875rem; color: var(--muted); letter-spacing: .04em; }
.order-done .question { margin-bottom: 0; }

@media (max-width: 640px) {
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .sheet-backdrop { padding: 0; place-items: end stretch; }
  .sheet { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .sheet-head { grid-template-columns: 56px 1fr auto; padding: 14px 14px 12px; }
  .sheet-art { width: 56px; }
  .sheet-body { padding: 0 14px 16px; }
  .sheet-foot { padding-left: 14px; padding-right: 14px; }
  .gift-card { padding: 10px 10px 12px; }
  .gift-badge { top: 14px; left: 14px; }
}
@media (max-width: 480px) {
  .app:has(.gifts) { padding-bottom: 0; }
  .gifts .actions { position: sticky; bottom: 0; z-index: 10; width: calc(100% + 40px); margin: 24px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
}
.home-xmas { margin-top: 48px; width: min(100%, 460px); padding: 26px 22px 24px; border-radius: 22px; text-align: center; color: #FFF6EE; background: radial-gradient(circle at 80% 0%, rgb(242 193 78 / .35), transparent 45%), linear-gradient(160deg, #0F1B33, #2C4A7C); box-shadow: 0 24px 40px -28px rgb(15 27 51 / .8); display: grid; gap: 8px; position: relative; overflow: hidden; }
.home-xmas::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(#fff 1px, transparent 1.5px); background-size: 26px 26px; opacity: .25; pointer-events: none; }
.home-xmas > * { position: relative; }
.home-xmas-kicker { font: 400 1.6rem/1 'Great Vibes', cursive; color: #F2C14E; }
.home-xmas h2 { font: 400 1.6rem/1.2 var(--font-display); }
.home-xmas p:not(.home-xmas-kicker) { color: #D7DEEA; font-size: .9375rem; }
.home-xmas-actions { display: grid; gap: 10px; margin-top: 10px; }
.home-xmas .btn { background: #F2C14E; color: #1C1606; border-color: #F2C14E; }
.home-xmas .btn-quiet { background: transparent; color: #FFF6EE; border-color: rgb(255 255 255 / .5); }
.crash { min-height: 100dvh; display: grid; align-content: center; justify-items: start; gap: 14px; max-width: 520px; margin: 0 auto; padding: 32px 22px; background: var(--bg, #FBF6F3); color: var(--text, #2E2630); }
.crash h1 { font: 400 1.8rem/1.2 var(--font-display, Georgia, serif); }
.crash-detail { font: .75rem/1.4 ui-monospace, monospace; color: var(--muted, #6E6470); overflow-wrap: anywhere; }
.home-sorry { margin-top: 40px; width: min(100%, 460px); padding: 24px 22px; border-radius: 22px; text-align: center; display: grid; gap: 10px; justify-items: center; background: linear-gradient(160deg, #FFE9EE, #FDF4E7); border: 1px solid #F3D3D9; color: #4A3B3F; }
.home-sorry h2 { font: 400 1.5rem/1.2 var(--font-display); }
.home-sorry p { font-size: .9375rem; color: #6E5A60; }
.duo-grid { display: grid; gap: 12px; margin-top: 20px; }
.duo-card { position: relative; display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); cursor: pointer; }
.duo-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.duo-card.is-on { border-color: var(--seal); box-shadow: 0 0 0 2px var(--seal); }
.duo-card:has(input:focus-visible) { outline: 2px solid var(--seal); outline-offset: 3px; }
.duo-art { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.duo-art .sr-critter { width: 100%; }
.duo-name { font-weight: 600; font-size: 1.0625rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photos { margin-top: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 10px; }
.photo-tile { position: relative; margin: 0; display: grid; gap: 6px; align-content: start; min-width: 0; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--line); display: block; }
.photo-tile.is-uploading img { opacity: .5; filter: blur(1px); }
.photo-remove { position: absolute; top: 6px; right: 6px; background: rgb(0 0 0 / .55); color: #fff; border: 0; }
.photo-caption { font-size: .875rem; padding: 8px 10px; line-height: 1.35; resize: none; font-family: inherit; }
.photo-spinner { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid rgb(255 255 255 / .6); border-top-color: var(--seal); animation: photo-spin .8s linear infinite; }
.photo-spinner { top: calc(50% - 20px); }
.photo-tile:not(:has(.photo-caption)) .photo-spinner { top: 50%; }
@keyframes photo-spin { to { rotate: 360deg; } }
.photo-add { display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 1; border-radius: 12px; border: 2px dashed color-mix(in srgb, var(--seal) 55%, var(--line)); background: color-mix(in srgb, var(--seal) 6%, var(--paper)); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; padding: 10px; text-align: center; }
.photo-add span { font-size: 2rem; line-height: 1; color: var(--seal); }
.photo-add:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.photo-privacy { margin-top: 14px; font-size: .875rem; }

/* Wheel: hamper / own prizes / no wheel */
.toggle-three .option > span { flex-direction: column; align-items: flex-start; gap: 4px; }
.toggle-three .option small { font-weight: 400; font-size: .875rem; line-height: 1.45; color: color-mix(in srgb, var(--paper-ink) 72%, transparent); }
.toggle-hamper > span::before { content: "Popular"; order: -1; font: 600 .6875rem/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--seal); }
.gift-wheel-note { margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--seal) 8%, var(--paper)); border: 1px solid color-mix(in srgb, var(--seal) 30%, var(--line)); line-height: 1.5; }

/* Photo captions with a suggest-another button */
.photo-caption-row { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.photo-caption-row .photo-caption { flex: 1 1 auto; min-width: 0; }
.photo-caption-new { flex: 0 0 auto; color: var(--seal); }
