/* Taklifnoma maker. Jomi Studio brand: ink, cream, mint, Inter Tight. Phone first.
   The chrome stays quiet (ink on cream, one mint accent); the colour comes from the real cards: the fan on the landing,
   the live card in the maker, the finished card on the result screen. Only transform and opacity move. */
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --ink: #1F1D24; --ink-2: #141318; --cream: #F6F1E9; --cream-2: #EFE8DC; --table: #E9E1D3; --paper: #FFFDF9; --mint: #E3F5EC; --accent: #4FC59A; --accent-ink: #0F2A1F;
  --muted: #66626C; --line: rgba(31,29,36,.12); --line-strong: rgba(31,29,36,.26); --danger: #b3261e;
  --shadow-paper: 0 1px 2px rgba(31,29,36,.14), 0 24px 44px -22px rgba(31,29,36,.45);
  --r: 12px; --r-sm: 8px; --gutter: 16px; --wrap: 1120px;
  --ease: cubic-bezier(.2,.8,.2,1); --fast: 160ms; --slow: 420ms;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.5 var(--sans); overflow-x: hidden; }
body.no-scroll { overflow: hidden; }
/* clip here, not on the viewport: 3D tilts and the step slide-in must never widen the phone's layout viewport */
#app { overflow-x: clip; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
a { color: inherit; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter); background: rgba(246,241,233,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
/* the language picker: a quiet pill with the code; the phone's own list opens over it (an invisible <select>) */
.ui-lang { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px 0 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 600 13px/1 var(--sans); letter-spacing: .02em; cursor: pointer;
  transition: border-color var(--fast), box-shadow var(--fast); }
.ui-lang:hover { border-color: var(--ink); }
.ui-lang:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.ui-lang-code { min-width: 2.2em; text-align: center; }
.ui-lang-chev { color: var(--muted); }
.ui-lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; border: 0; appearance: none; }
/* chips that tick: the invitation's extra languages, and "with a photo / no photo" */
.lang-chips, .pick-chips { gap: 8px; }
.pick-chips { margin: 6px 0 2px; }
.lang-chips legend { width: 100%; }
.lang-chip.check, .pick-chip.check { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px 0 10px; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper);
  font-weight: 500; font-size: 14px; cursor: pointer; }
.lang-chip.check input, .pick-chip.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.pick-chip.check span, .lang-chip.check span { white-space: nowrap; color: var(--ink); }
.lang-chip.check:has(input:checked), .pick-chip.check:has(input:checked) { border-color: var(--ink); background: var(--mint); }
.lang-chip.check:has(input:disabled) { opacity: .45; cursor: default; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform var(--fast) var(--ease), background-color var(--fast), border-color var(--fast), box-shadow var(--fast); }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn-main { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: 0 10px 24px -14px rgba(31,29,36,.7); }
.btn-main:hover { background: var(--ink-2); }
.btn-big { min-height: 58px; font-size: 17px; padding: 0 28px; width: 100%; }
.btn-soft { background: var(--paper); }
.btn-sm { min-height: 42px; font-size: 14px; padding: 0 16px; }
.btn-mint { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.is-sent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* ---------- landing: the promise on the left, a hand of real cards on the right ---------- */
.hero { padding: 28px 0 8px; max-width: var(--wrap); margin: 0 auto; display: grid; gap: 8px; }
.hero-copy { padding: 0 var(--gutter); }
.hero h1 { font-size: clamp(40px, 11vw, 76px); font-weight: 600; letter-spacing: -0.035em; line-height: .96; text-wrap: balance; margin: 0 0 16px; }
.lede { margin: 0 0 22px; color: var(--muted); font-size: 17px; line-height: 1.45; max-width: 32em; text-wrap: pretty; }
.hero-cta { display: grid; gap: 10px; justify-items: start; }
.free { margin: 0; font-size: 14px; color: var(--muted); }
.example-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.example-link:hover { text-decoration-thickness: 2px; }
.example-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.scene { position: relative; aspect-ratio: 1 / .8; margin: 4px 0 0; perspective: 1300px; perspective-origin: 50% 30%; --scroll: 0; --spread: 11deg; }
.fan-tilt { position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc(14deg + var(--rx, 0deg) + var(--scroll) * 18deg)) rotateY(var(--ry, 0deg)); }
.fan-sway { position: absolute; inset: 0; transform-style: preserve-3d; animation: sway 12s ease-in-out infinite alternate; }
.fan-ground { position: absolute; left: 8%; right: 8%; bottom: 6%; height: 22%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(31,29,36,.26), rgba(31,29,36,.08) 50%, transparent 72%); transform: translateZ(-2px); }
.fcard { position: absolute; left: 50%; bottom: 12%; width: 33%; --a: calc(var(--k) * var(--spread)); aspect-ratio: 9 / 16; margin: 0; border-radius: 6px; background: var(--bg, var(--paper));
  transform-origin: 50% 150%; transform: translateX(-50%) rotate(0deg) translateZ(var(--z));
  box-shadow: 0 1px 1px rgba(31,29,36,.18), 0 18px 34px -18px rgba(31,29,36,.55), -8px 0 24px -16px rgba(31,29,36,.35);
  transition: transform .95s var(--ease); transition-delay: calc(var(--i) * 55ms); overflow: hidden; }
.scene.open .fcard { transform: translateX(-50%) rotate(var(--a)) translateZ(var(--z)); }
.fcard canvas, .fcard img { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease; }
.fcard.drawn canvas, .fcard.drawn img { opacity: 1; }
/* a soft highlight that slides across the paper as the fan tilts */
.fcard::after { content: ""; position: absolute; inset: 0 -70%; pointer-events: none;
  background: linear-gradient(112deg, transparent 44%, rgba(255,255,255,.22) 50%, transparent 56%); transform: translateX(calc(var(--sx, 0) * 1%)); }
@keyframes sway { from { transform: rotateY(-5deg) rotateZ(-1.2deg); } to { transform: rotateY(5deg) rotateZ(1.2deg); } }

.how { margin: 10px var(--gutter) 0; padding: 20px 0 0; list-style: none; counter-reset: how; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.how li { counter-increment: how; display: flex; gap: 14px; align-items: baseline; font-size: 16px; color: var(--muted); }
.how li::before { content: counter(how); flex: none; font-weight: 600; font-size: 13px; color: var(--accent-ink); background: var(--mint); width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; transform: translateY(5px); }

.mine { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter) 0; }
.mine h2 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.mine-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mine-list a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--paper); text-decoration: none; }
.mine-list small { color: var(--muted); }

/* ---------- maker: one step per screen ---------- */
.maker { max-width: 680px; margin: 0 auto; padding: 14px var(--gutter) 150px; display: grid; gap: 18px; grid-template-areas: "head" "stage" "body" "foot"; }
.steps { grid-area: head; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps li { display: block; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--cream-2); margin-bottom: 10px; transition: background-color var(--slow); }
.steps li.is-done::before, .steps li[aria-current]::before { background: var(--ink); }
.steps li[aria-current] { color: var(--ink); font-weight: 600; }
.steps .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; font-weight: 600; vertical-align: -5px; margin-right: 2px; }
.steps li.is-done .n { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.wiz-body { grid-area: body; }
.pane { display: grid; gap: 18px; }
.pane.in-r { animation: pane-in var(--slow) var(--ease) both; }
.pane.in-l { animation: pane-in-l var(--slow) var(--ease) both; }
@keyframes pane-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes pane-in-l { from { opacity: 0; transform: translateX(-28px); } }
.step { font-size: clamp(26px, 7vw, 32px); font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.step:focus { outline: none; }

/* step 1: the celebrations; "your own" is the wide mint tile at the end */
.events { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ev { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px 10px 12px; border-radius: 14px; background: var(--paper);
  border: 1px solid var(--line-strong); text-align: left; font: 500 15px/1.25 var(--sans); color: var(--ink); cursor: pointer;
  transition: transform var(--fast) var(--ease), background-color var(--fast), border-color var(--fast), box-shadow var(--fast); }
.ev-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--cream); color: var(--ink); transition: background .2s, color .2s; }
.ev-icon svg { display: block; }
.ev[aria-checked="true"] .ev-icon { background: rgba(246,241,233,.12); color: var(--cream); }
.ev-custom .ev-icon { background: rgba(15,42,31,.08); color: var(--accent-ink); }
.ev-label { display: grid; gap: 2px; text-wrap: balance; }
.ev-label small { font-size: 13px; font-weight: 400; color: var(--muted); }
.ev:hover { border-color: var(--ink); }
.ev:active { transform: scale(.98); }
.ev[aria-checked="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: 0 12px 26px -16px rgba(31,29,36,.75); }
.ev[aria-checked="true"] .ev-label small { color: rgba(246,241,233,.7); }
.ev-custom { grid-column: 1 / -1; min-height: 76px; background: var(--mint); border: 1.5px dashed rgba(15,42,31,.35); border-radius: 16px; }
.ev-custom .ev-label { font-weight: 600; font-size: 17px; }
.ev-custom[aria-checked="true"] { border-style: solid; }
.event-name { display: grid; gap: 6px; font-weight: 500; font-size: 14px; color: var(--muted); animation: pane-in var(--slow) var(--ease) both; }
.event-name input { font: 18px/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--r-sm); padding: 14px 16px; width: 100%; min-height: 56px; }

/* step 2: the form */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; color: var(--muted); }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea, .event-name input {
  font: 16px/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 12px 14px; width: 100%; min-height: 48px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--ink); }
.form textarea { resize: vertical; }
.row2 { display: grid; gap: 16px; }
.row2.tight { grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.checks legend { font-weight: 500; font-size: 14px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.form .check, .print-form .check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); min-height: 40px; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.hint { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
/* the words on the card: every line shown with its usual wording, a ↺ at the end of each brings it back */
.words { margin: 6px 0 0; padding: 14px 16px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); display: grid; gap: 14px; min-width: 0; }
.words legend { float: left; width: 100%; display: grid; gap: 2px; padding: 0; margin: 0 0 14px; }
.words label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; color: var(--muted); }
.word-row { display: grid; grid-template-columns: 1fr 44px; gap: 6px; align-items: start; }
.word-row input, .word-row textarea { font: 16px/1.4 var(--sans); color: var(--ink); background: var(--cream); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 12px 14px; width: 100%; min-height: 48px; min-width: 0; }
.word-row input:focus, .word-row textarea:focus { border-color: var(--ink); background: var(--paper); }
.word-row textarea { resize: vertical; }
.word-reset { width: 44px; height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; transition: color var(--fast), border-color var(--fast); }
.word-reset:hover { color: var(--ink); border-color: var(--ink); }
.words .hint { margin: -6px 0 0; }
.share-check { padding-top: 4px; border-top: 1px solid var(--line); }
.more { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); padding: 0 16px; margin-top: 6px; }
.more summary, .more-done summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; min-height: 64px; padding: 10px 0; }
.more summary::-webkit-details-marker, .more-done summary::-webkit-details-marker { display: none; }
.more summary::after, .more-done summary::after { content: "+"; grid-column: 2; grid-row: 1 / 3; font-size: 26px; font-weight: 400; color: var(--ink); line-height: 1; transition: transform var(--fast) var(--ease); }
.more[open] summary::after, .more-done[open] summary::after { transform: rotate(45deg); }
.more-title { font-weight: 600; font-size: 16px; }
.more-lede { font-size: 13px; color: var(--muted); }
.more[open] { padding-bottom: 16px; }
.more[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.prow { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; margin-bottom: 8px; }
.prow button { border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--r-sm); font-size: 20px; cursor: pointer; }
.photo-box, .program-box { display: grid; gap: 8px; }
.label { font-weight: 500; font-size: 14px; color: var(--muted); margin: 0; }
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#photoThumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }

/* step 3: the live card above a rail of real thumbnails you swipe through */
.stage { grid-area: stage; display: none; }
.maker[data-step="3"] .stage { display: grid; justify-items: center; }
.preview-wrap { display: block; width: min(100%, 250px); padding: 0; border: 0; background: none; border-radius: 6px; cursor: zoom-in; }
.preview-wrap:active { transform: scale(.99); }
#preview { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 6px; background: var(--paper); box-shadow: var(--shadow-paper); }
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 10px; margin: 0; padding: 8px 0 12px; }
.designs::-webkit-scrollbar { display: none; }
.dz { min-width: 0; display: grid; gap: 8px; padding: 0; border: 0; border-radius: 0; background: none; cursor: pointer; font: 500 13px/1.2 var(--sans); color: var(--muted); text-align: left; }
.dz canvas { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 4px; background: var(--bg, var(--cream-2)); display: block;
  box-shadow: 0 1px 2px rgba(31,29,36,.12), 0 10px 20px -12px rgba(31,29,36,.4); transition: transform var(--fast) var(--ease), box-shadow var(--fast); }
.dz:hover canvas { transform: translateY(-2px); }
.dz[aria-checked="true"] { color: var(--ink); font-weight: 600; }
.dz[aria-checked="true"] canvas { box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--ink), 0 14px 24px -12px rgba(31,29,36,.5); transform: translateY(-4px); }

/* design groups: one row of pills, swiped on phones; the chosen one is ink */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -6px calc(var(--gutter) * -1) -4px; padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  font: 500 14px/1 var(--sans); cursor: pointer; transition: background-color var(--fast), border-color var(--fast), color var(--fast); }
.chip:hover { border-color: var(--ink); }
.chip[aria-checked="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }
/* the two "your own" cards: the same real thumbnail, a dashed edge and a small plus */
.dz-own canvas { outline: 1.5px dashed rgba(15,42,31,.55); outline-offset: 3px; }
.dz-own { position: relative; }
.dz-own::after { content: "+"; position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font: 700 17px/24px var(--sans); text-align: center; box-shadow: 0 1px 2px rgba(31,29,36,.2); pointer-events: none; }
.dz-own[aria-checked="true"] canvas { outline-color: transparent; }

/* "make your own" and "my own picture" panels under the rail */
.style-panel { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); animation: pane-in var(--slow) var(--ease) both; }
.style-panel h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.style-panel .hint { margin: -8px 0 0; }
.style-panel .warn { margin: 0; }
.style-row { display: grid; gap: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 4px; }
.swatches { gap: 2px; }
.swatch { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.swatch::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--c, var(--paper)); box-shadow: inset 0 0 0 1px rgba(31,29,36,.18), 0 1px 2px rgba(31,29,36,.12); transition: transform var(--fast) var(--ease); }
.swatch:hover::before { transform: scale(1.08); }
.swatch[aria-checked="true"]::before { box-shadow: inset 0 0 0 1px rgba(31,29,36,.18), 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch-other::before { background: conic-gradient(#f06a4f, #e2b75a, #4fc59a, #1f6fb2, #b0246a, #f06a4f); }
.swatch-other.is-set::before { background: var(--c); }
.swatch-other::after { content: "+"; position: absolute; font: 700 16px/1 var(--sans); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); pointer-events: none; }
.swatch-other.is-set::after { content: none; }
.swatch-other input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.swatch-other:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt { display: grid; justify-items: center; align-content: start; gap: 6px; min-width: 64px; min-height: 44px; padding: 8px 6px 6px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--muted);
  font: 500 12px/1.15 var(--sans); cursor: pointer; text-align: center; transition: border-color var(--fast), background-color var(--fast), color var(--fast); }
.opt:hover { border-color: var(--line-strong); }
.opt[aria-checked="true"] { border-color: var(--ink); background: var(--cream); color: var(--ink); font-weight: 600; }
.opt .aa { display: grid; place-items: center; height: 40px; color: var(--ink); white-space: nowrap; }
.opt svg { display: block; color: var(--ink); }
.fonts .opt, .frames .opt { flex: 1 1 56px; min-width: 56px; }
.own-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.own-panel .photo-row .hint { margin: 0; }

/* the bottom bar: Back, the small live card, Next */
.wiz-foot { grid-area: foot; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(246,241,233,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.wiz-btns { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; max-width: 648px; margin: 0 auto; width: 100%; }
.wiz-btns .btn-big { min-height: 54px; }
.peek { display: block; width: 46px; height: 82px; padding: 0; border: 0; background: none; border-radius: 3px; cursor: zoom-in; position: relative; }
.peek canvas { display: block; width: 100%; height: 100%; border-radius: 3px; background: var(--paper); box-shadow: 0 1px 2px rgba(31,29,36,.2), 0 8px 14px -8px rgba(31,29,36,.5); transition: transform var(--fast) var(--ease); }
.peek:hover canvas { transform: translateY(-2px) rotate(-2deg); }
.maker[data-step="3"] .peek { display: none; }
.maker[data-step="3"] .wiz-btns { grid-template-columns: auto 1fr; }
.error { margin: 0; padding: 10px 14px; border-left: 3px solid var(--danger); background: #fde8e6; color: var(--danger); font-weight: 500; font-size: 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; max-width: 648px; width: 100%; justify-self: center; }
/* a field named in the "Fill in:" line (or a gift amount that is not a number) until it is fixed */
.form input[aria-invalid="true"]:not([type=checkbox]):not([type=radio]):not([type=file]), .event-name input[aria-invalid="true"], .gift-form input[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); background: #fffafa; }

/* the enlarged card */
.lightbox { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; align-content: center; gap: 16px; padding: 16px; background: rgba(20,19,24,.72); backdrop-filter: blur(6px); cursor: zoom-out; }
.lightbox canvas { display: block; width: min(calc(100vw - 32px), calc((100dvh - 130px) * 9 / 16), 460px); height: auto; aspect-ratio: 9 / 16; border-radius: 8px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); cursor: default; animation: pop var(--slow) var(--ease) both; }
.lightbox-close { background: var(--cream); border-color: var(--cream); cursor: pointer; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }

/* ---------- the result: the card, then 1 · 2 · 3 ---------- */
.done { max-width: 720px; margin: 0 auto; padding: 24px var(--gutter) 56px; display: grid; gap: 22px; }
.done:focus { outline: none; }
.done h2 { font-size: clamp(30px, 8.5vw, 46px); font-weight: 600; letter-spacing: -0.035em; text-align: center; text-wrap: balance; }
.done-aside { display: grid; justify-items: center; }
.done-card { margin: 0; display: grid; gap: 10px; width: min(100%, 272px); animation: pop var(--slow) var(--ease) both; }
.done-card canvas { width: 100%; height: auto; aspect-ratio: 9 / 16; display: block; border-radius: 6px; background: var(--paper); box-shadow: var(--shadow-paper); }
.done-card figcaption { font-size: 13px; color: var(--muted); text-align: center; text-wrap: balance; }
.done-main { display: grid; gap: 18px; }
.actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.act { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 18px 16px 18px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.act-1 { background: var(--mint); border-color: transparent; padding-top: 22px; padding-bottom: 22px; }
.num { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--cream); font: 600 20px/1 var(--sans); display: grid; place-items: center; }
.act-body { display: grid; gap: 12px; min-width: 0; }
.act h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.025em; padding-top: 9px; }
.act-lede { margin: -4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.act-1 .act-lede { color: var(--accent-ink); opacity: .8; }
.act-btns { display: grid; gap: 10px; }
.act-1 .act-btns .btn-big { min-height: 60px; }
.act-note { margin: 0; font-size: 14px; color: var(--accent-ink); }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; font: 14px/1.3 var(--sans); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns .btn { flex: 1 1 140px; }
.print-form { display: grid; gap: 14px; }
/* the live page preview: the sheet lies on the table, its shadow tells its size against the others */
.print-preview { margin: 2px 0 4px; display: grid; justify-items: center; gap: 10px; }
.print-desk { width: 100%; display: grid; place-items: center; min-height: 220px; padding: 22px 12px; border-radius: 18px;
  background: radial-gradient(120% 90% at 30% 10%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%), var(--table); }
.print-page { display: block; max-width: 100%; height: auto; border-radius: 1px;
  box-shadow: 0 1px 2px rgba(31,29,36,.18), 0 14px 28px -12px rgba(31,29,36,.35); }
.print-preview figcaption { font-size: 14px; color: var(--muted); text-align: center; }
.print-made { margin: 0; font-weight: 600; font-size: 15px; }
.print-form .form, .panel .form { gap: 6px; }
.progress { height: 6px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.more-done { border-top: 1px solid var(--line-strong); padding-top: 6px; }
.more-done summary { min-height: 72px; }
.more-done .more-title { font-size: 20px; letter-spacing: -0.02em; }
.more-body { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 8px; }
.panel { background: var(--paper); padding: 20px 16px; display: grid; gap: 12px; }
.panel h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.totals { display: flex; flex-wrap: wrap; gap: 8px; }
.totals span { background: var(--cream); color: var(--ink); padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rows li { padding: 10px 12px; background: var(--cream); font-size: 14px; }
.rows li.gift { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rows li.gift .btn { min-height: 36px; padding: 0 12px; }
.guest-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.guest-links li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--cream); border-radius: var(--r-sm); font-size: 14px; }
.guest-links li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-links .btn { min-height: 38px; flex: none; }
.warn { margin: 0; padding: 10px 14px; border-left: 3px solid #d9a441; background: #fff6df; color: #5a4300; font-size: 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.gift-form { display: grid; gap: 8px; }
.gift-form input, .panel input[type=search] { font: 16px/1.4 var(--sans); padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); width: 100%; min-height: 48px; }
.danger { color: var(--danger); border-color: rgba(179,38,30,.35); }

.foot { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gutter) 56px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 8px; max-width: 60em; }
.foot .small { font-size: 13px; }
/* «Фикру пешниҳод»: an open question with the button under it, at the top of the footer (under the landing, the
   wizard and the done screen); the sheet has its own css */
.foot-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 22px; padding: 16px 18px;
  border-radius: 20px; background: var(--mint); color: var(--accent-ink); }
.foot-feedback p { margin: 0; flex: 1 1 12em; font: 600 16px/1.35 var(--sans); letter-spacing: -0.01em; }
.fb-btn { flex: none; gap: 10px; border-color: transparent; }
.fb-btn svg { flex: none; color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 999px; font-weight: 500; z-index: 50; max-width: calc(100% - 32px); animation: pop var(--fast) var(--ease) both; }

@media (min-width: 640px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .events { grid-template-columns: repeat(3, 1fr); }
  .designs { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; margin: 0; padding: 8px 0; }
  .dz { flex: none; }
  .hero { padding-top: 48px; }
  .scene { max-width: 560px; margin-inline: auto; width: 100%; }
  .how { display: flex; gap: 32px; margin-top: 22px; }
  .act-btns { grid-template-columns: 1fr auto; }
  .act-pic { grid-template-columns: 1fr auto auto; }
  .act-2 .act-btns { grid-template-columns: 1fr 1fr auto; }
  .act-1 .act-btns .btn-soft { min-height: 60px; }
  .done { grid-template-columns: 272px 1fr; column-gap: 36px; align-items: start; max-width: var(--wrap); }
  .done h2 { grid-column: 1 / -1; text-align: left; }
  .done-aside { position: sticky; top: 84px; }
}
@media (min-width: 960px) {
  .hero { grid-template-columns: 1.05fr 1fr; column-gap: 32px; align-items: center; padding: 56px 0 16px; }
  .hero-copy { max-width: 560px; }
  .hero .btn-big { width: auto; }
  .scene { aspect-ratio: 1 / .86; max-width: none; margin: 0 var(--gutter) 0 0; --scroll: 0 !important; --spread: 13deg; }
  .fcard { width: 32%; }
  .how { grid-column: 1 / -1; margin-top: 36px; }
  .maker { max-width: var(--wrap); grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "head stage" "body stage" "foot stage"; column-gap: 56px; padding: 40px var(--gutter) 60px; align-content: start; }
  .stage, .maker[data-step="3"] .stage { display: grid; position: sticky; top: 84px; align-self: start; }
  .preview-wrap { width: 100%; max-width: 380px; }
  .wiz-foot { position: static; padding: 8px 0 0; background: none; backdrop-filter: none; border-top: 1px solid var(--line); }
  .wiz-btns { max-width: none; grid-template-columns: auto 1fr; }
  .peek { display: none; }
  .wiz-btns .btn-big { width: auto; justify-self: end; padding: 0 36px; }
  .designs { grid-template-columns: repeat(4, 1fr); }
  .chips { flex-wrap: wrap; overflow: visible; margin: -6px 0 -4px; padding: 0; }
  .events { grid-template-columns: repeat(3, 1fr); }
  .done { grid-template-columns: 300px 1fr; column-gap: 56px; }
  .done-card { width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .fan-sway { animation: none; }
  .fcard, .pane, .event-name, .done-card, .lightbox canvas, .toast { transition: none; animation: none; }
  .fcard { transform: translateX(-50%) rotate(var(--a)) translateZ(var(--z)); }
  .fcard canvas, .fcard img { transition: none; }
  .btn:active, .ev:active, .dz canvas, .dz[aria-checked="true"] canvas, .peek canvas, .swatch::before { transform: none; transition: none; }
  .style-panel { animation: none; }
  .progress i, .steps li::before, .more summary::after, .more-done summary::after { transition: none; }
}
