: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; }
