/* ============================================================
   Fotobudka — "wedding atelier" theme
   Display: Fraunces · UI: Schibsted Grotesk (vendored, offline)
   ============================================================ */
:root {
  --paper:   oklch(0.972 0.018 83);
  --paper-2: oklch(0.945 0.022 80);
  --ink:     oklch(0.28 0.028 55);
  --muted:   oklch(0.52 0.03 58);
  --terra:   oklch(0.60 0.142 42);
  --terra-d: oklch(0.52 0.15 40);
  --gold:    oklch(0.74 0.10 84);
  --line:    oklch(0.78 0.03 70);
  --card:    oklch(0.99 0.012 86);
  --radius:  18px;

  --serif: "Fraunces", "Hoefler Text", Georgia, serif;
  --sans:  "Schibsted Grotesk", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(0.99 0.02 90) 0%, transparent 60%),
    radial-gradient(90% 70% at 110% 110%, oklch(0.93 0.04 60 / 0.6) 0%, transparent 55%),
    var(--paper);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  overflow-x: hidden;
}
/* fine paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

/* ---------- screen visibility ---------- */
.screen { display: none; }
body[data-screen="idle"]       .screen-idle       { display: flex; flex-direction: column; align-items: center; }
body[data-screen="processing"] .screen-processing,
body[data-screen="result"]     .screen-result,
body[data-screen="gallery"]    .screen-gallery {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  position: fixed; inset: 0; z-index: 20; padding: 4vh 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(0.99 0.02 90) 0%, transparent 60%),
    var(--paper);
  overflow-y: auto;
}

/* ---------- login gate ---------- */
body[data-screen="login"] .screen-login {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 40; padding: 4vh 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, oklch(0.99 0.02 90) 0%, transparent 60%),
    var(--paper);
}
.login-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: min(90vw, 360px); padding: 40px 34px;
  background: #fff; border-radius: 20px; text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .16);
}
.login-mono { font-size: 2.2rem; margin-bottom: 4px; }
.login-card h1 { font-family: var(--serif); margin: 0; font-size: 2rem; }
.login-sub { margin: 0 0 8px; opacity: .65; font-size: .95rem; }
.login-card input {
  width: 100%; padding: 13px 15px; font-size: 1.15rem;
  border: 1px solid oklch(0.85 0.02 90); border-radius: 12px; text-align: center;
}
.login-card button {
  width: 100%; padding: 13px 15px; font-size: 1.15rem; cursor: pointer;
  border: 0; border-radius: 12px; background: #1c1c1c; color: #fff;
}
.login-card button:disabled { opacity: .5; cursor: default; }
.login-error { color: #b00020; margin: 0; font-size: .95rem; }

/* ---------- top bar (idle only) ---------- */
#topbar { display: none; }
body[data-screen="idle"] #topbar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1000px; padding: 20px clamp(16px, 4vw, 40px) 4px;
}
.monogram { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.04em; }
.monogram .amp { font-style: italic; color: var(--terra); }
.topbar-date { font-size: 0.82rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.pill {
  font-family: var(--sans); font-size: 0.9rem; letter-spacing: 0.02em;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper); border: none;
  transition: transform .15s ease, opacity .15s ease;
}
.pill:hover { transform: translateY(-1px); opacity: 0.9; }
.pill.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }

/* ---------- camera stage ---------- */
#stage {
  position: relative; display: none;
  width: min(84vw, 900px); aspect-ratio: 4/3;
  border-radius: var(--radius); overflow: hidden;
  background: #000; margin: 14px 0 6px;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.6), 0 26px 60px -24px oklch(0.3 0.05 50 / 0.55);
  outline: 1px solid var(--line); outline-offset: 8px;
}
body[data-screen="idle"]  #stage { display: block; }
body[data-screen="shoot"] #stage {
  display: block; position: fixed; inset: 0; margin: auto;
  width: min(92vw, 1100px); height: min(80vh, 825px); aspect-ratio: auto; z-index: 20;
  outline-offset: 12px;
}
#video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.stage-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: #fff; background: oklch(0 0 0 / 0.35); backdrop-filter: blur(4px);
  padding: 5px 12px 5px 22px; border-radius: 999px;
}
.stage-tag::before {
  content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: oklch(0.7 0.2 25);
  box-shadow: 0 0 0 0 oklch(0.7 0.2 25 / 0.7); animation: live 1.6s ease-out infinite;
}
@keyframes live { 70%,100% { box-shadow: 0 0 0 8px oklch(0.7 0.2 25 / 0); } }

#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none;
  transition: opacity 90ms ease-out; z-index: 60; }
#flash.on { opacity: 1; transition: none; }

#standMarks {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: stretch; justify-content: space-evenly;
  padding: 0 2.5%;
}
#standMarks[hidden] { display: none; }
.stand-mark {
  flex: 1 1 0; min-width: 0; margin: 0 1.2%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 0.5rem; padding-bottom: 7%;
  border-left: 2px dashed oklch(1 0 0 / 0.28);
  border-right: 2px dashed oklch(1 0 0 / 0.28);
}
.stand-num {
  display: flex; align-items: center; justify-content: center;
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1;
  color: #fff; background: oklch(0 0 0 / 0.5); backdrop-filter: blur(4px);
  border: 2px solid oklch(1 0 0 / 0.92);
  box-shadow: 0 6px 20px -6px oklch(0 0 0 / 0.6);
}
.stand-label {
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.9rem; font-weight: 600; color: #fff;
  background: oklch(0 0 0 / 0.5); backdrop-filter: blur(4px);
  padding: 4px 11px; border-radius: 999px;
}
.stand-mark::after {
  content: "stań tu"; font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: oklch(1 0 0 / 0.82); margin-top: -0.15rem;
}
body[data-screen="shoot"] .stand-num { width: 3.4rem; height: 3.4rem; font-size: 1.9rem; }
body[data-screen="shoot"] .stand-label { font-size: 1.05rem; padding: 5px 14px; }

#countdown {
  position: absolute; inset: 0; display: none; place-items: center; z-index: 4;
  font-family: var(--serif); font-size: 32vh; font-weight: 600; color: #fff;
  text-shadow: 0 6px 40px oklch(0 0 0 / 0.55);
}
/* only ever visible during the shoot countdown — never leak onto the shared idle stage */
body[data-screen="shoot"] #countdown:not([hidden]) { display: grid; animation: pop .9s ease-out; }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1); } }

/* ---------- idle card ---------- */
.screen-idle { width: 100%; padding-bottom: 6vh; }
.card {
  width: min(94vw, 780px); margin: 8px auto 0; padding: 26px clamp(18px, 4vw, 38px) 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: 0 30px 70px -40px oklch(0.3 0.05 50 / 0.5);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  position: relative;
}

/* ---- model picker (discreet test panel) ---- */
.cog {
  position: absolute; top: 14px; right: 16px; z-index: 50;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--muted);
  font-size: 1.05rem; line-height: 1; cursor: pointer; transition: transform .15s, color .15s;
}
.cog:hover { color: var(--terra-d); transform: rotate(40deg); }
.model-panel {
  position: absolute; top: 54px; right: 16px; z-index: 60; width: min(86vw, 340px);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px -30px oklch(0.3 0.05 50 / 0.6); padding: 14px; text-align: left;
}
.model-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.model-panel-title { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }
.model-close { border: none; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; }
.model-list { display: flex; flex-direction: column; gap: 6px; }
.model-row {
  display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
  font-family: var(--sans); padding: 9px 11px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--paper-2); color: var(--ink);
}
.model-row:hover { border-color: var(--terra); }
.model-row.is-current { border-color: var(--terra); background: oklch(0.60 0.142 42 / 0.12); }
.model-name { font-size: 0.96rem; font-weight: 600; }
.model-row.is-current .model-name { color: var(--terra-d); }
.model-hint { font-size: 0.82rem; color: var(--muted); }
.model-spend { margin: 10px 0 4px; font-size: 0.86rem; color: var(--terra-d); font-weight: 600; }
.eyebrow { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--terra);
  margin: 0; letter-spacing: 0.02em; }
.control { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.control:focus-within { z-index: 40; }   /* whole block (with the open dropdown) floats above the CTA */
.field-label { margin: 0; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; }
.field-sub { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: 0.8; }
.hint { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }

/* bars + chips */
.bar { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.chip {
  font-family: var(--sans); font-size: 1.02rem; cursor: pointer;
  padding: 10px 16px; border-radius: 13px; background: var(--paper-2);
  border: 1.5px solid transparent; color: var(--ink);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] {
  background: oklch(0.60 0.142 42 / 0.12); border-color: var(--terra); color: var(--terra-d);
}
#peopleCount .chip { min-width: 52px; font-variant-numeric: tabular-nums; font-weight: 600; }
.chip-disabled { opacity: 0.35; pointer-events: none; }

/* people boxes + searchable pickers */
.people-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
@media (max-width: 560px) { .people-boxes { grid-template-columns: 1fr; } }
.person-box { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 13px 14px; text-align: left; }
.person-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.person-title { margin: 0; font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }
.person-clear {
  flex: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; line-height: 1;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 0.8rem;
  transition: all .15s ease;
}
.person-clear:hover { border-color: var(--terra); color: var(--terra-d); background: oklch(0.60 0.142 42 / 0.1); }
.star-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.hair-row { display: flex; margin-top: 8px; }

/* group theme picker + lineup banner */
.theme-control { margin-bottom: 6px; }
.theme-picker { display: flex; }
.theme-info {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: oklch(0.60 0.142 42 / 0.08); border: 1px solid oklch(0.60 0.142 42 / 0.22);
}
.theme-info-lead { margin: 0 0 7px; font-family: var(--sans); font-size: 0.9rem; color: var(--ink); }
.theme-info-lead b { color: var(--terra-d); }
.theme-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 0.86rem; color: var(--ink);
  padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
}
.theme-chip b {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  font-size: 0.72rem; color: #fff; background: var(--terra);
}

/* static costume badge shown in a person box when a theme assigns them a role */
.theme-badge {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
  padding: 9px 11px; border-radius: 10px;
  background: oklch(0.60 0.142 42 / 0.1); border: 1.5px solid oklch(0.60 0.142 42 / 0.3);
}
.theme-badge-icon { font-size: 1.15rem; line-height: 1; }
.theme-badge-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.theme-badge-text b { font-family: var(--sans); font-size: 0.96rem; color: var(--terra-d); }
.theme-badge-text small { font-size: 0.72rem; color: var(--muted); }
.picker.is-disabled { opacity: 0.4; }
.picker-input:disabled { cursor: not-allowed; background: var(--paper-2); }
.picker-row { display: flex; gap: 8px; }

/* per-person custom request */
.custom-wrap { margin-top: 8px; }
.custom-toggle {
  font-family: var(--sans); font-size: 0.82rem; cursor: pointer; color: var(--muted);
  background: none; border: none; padding: 2px 0; transition: color .15s ease;
}
.custom-toggle:hover { color: var(--terra-d); }
.custom-toggle.has { color: var(--terra-d); font-weight: 600; }
.custom-input {
  width: 100%; margin-top: 6px; resize: vertical; box-sizing: border-box;
  font-family: var(--sans); font-size: 0.92rem; color: var(--ink); line-height: 1.35;
  padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card);
}
.custom-input:focus { outline: none; border-color: var(--terra); }
.custom-input::placeholder { color: var(--muted); opacity: 0.8; }
.picker { position: relative; flex: 1; min-width: 0; }
.picker:focus-within { z-index: 60; }   /* lift the open dropdown above the CTA */
.picker-input {
  width: 100%; font-family: var(--sans); font-size: 0.96rem; color: var(--ink);
  padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card);
  cursor: pointer; transition: border-color .12s ease;
}
.picker-input::placeholder { color: var(--muted); }
.picker-input:focus { outline: none; border-color: var(--terra); }
.picker-menu {
  position: absolute; z-index: 50; top: calc(100% + 4px); left: 0;
  width: max-content; min-width: 100%; max-width: 62vw;
  max-height: 230px; overflow-y: auto; padding: 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -16px oklch(0.3 0.05 50 / 0.5);
}
.picker-item {
  display: block; width: 100%; text-align: left; cursor: pointer; white-space: nowrap;
  font-family: var(--sans); font-size: 0.96rem; color: var(--ink);
  padding: 9px 11px; border: none; border-radius: 8px; background: transparent;
}
.picker-item:hover { background: oklch(0.60 0.142 42 / 0.12); }
.picker-item.is-current { color: var(--terra-d); font-weight: 600; }
.picker-clear { color: var(--muted); }
.picker-empty { padding: 9px 11px; color: var(--muted); font-size: 0.9rem; font-style: italic; }
.picker-group {
  padding: 9px 11px 4px; margin-top: 2px;
  font-family: var(--sans); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  position: sticky; top: -5px; background: var(--card);
}
.picker-group:first-child { margin-top: 0; }

/* person tabs (legacy) */
.tabs { gap: 4px; }
.tabs .tab { font-family: var(--sans); font-size: 0.95rem; cursor: pointer; color: var(--muted);
  background: transparent; border: none; padding: 7px 15px 9px; border-radius: 10px 10px 0 0; }
.tabs .tab[aria-pressed="true"] { color: var(--terra-d); font-weight: 600; box-shadow: inset 0 -2.5px 0 var(--terra); }

/* buttons */
.big-btn {
  position: relative; z-index: 1;
  font-family: var(--sans); font-size: 1.25rem; font-weight: 600; letter-spacing: 0.01em;
  margin-top: 6px; padding: 17px 46px; border: none; cursor: pointer; border-radius: 999px;
  color: #fff; background: linear-gradient(180deg, var(--terra), var(--terra-d));
  box-shadow: 0 12px 26px -10px oklch(0.55 0.15 40 / 0.7), inset 0 1px 0 oklch(1 0 0 / 0.25);
  transition: transform .14s ease, box-shadow .14s ease;
}
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px oklch(0.55 0.15 40 / 0.8); }
.big-btn:active { transform: translateY(1px); }
/* locked until something is selected */
.big-btn.is-locked {
  background: var(--line); color: oklch(1 0 0 / 0.85); box-shadow: none; cursor: not-allowed;
}
.big-btn.is-locked:hover { transform: none; box-shadow: none; }

.start-wrap { position: relative; display: flex; justify-content: center; margin-top: 6px; }
.start-hint {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; z-index: 5;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 600; color: #fff;
  background: var(--ink); padding: 9px 15px; border-radius: 12px;
  box-shadow: 0 12px 26px -12px oklch(0.3 0.05 50 / 0.7);
}
.start-hint::after {  /* little speech-bubble tail pointing at the button */
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--ink);
}
.start-hint.shake { animation: hintShake .4s ease; }
@keyframes hintShake {
  0%,100% { transform: translateX(-50%); }
  20%,60% { transform: translateX(-50%) rotate(-2.5deg) translateY(-2px); }
  40%,80% { transform: translateX(-50%) rotate(2.5deg) translateY(-2px); }
}

/* ---------- processing ---------- */
.screen-processing h2 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 6px 0 0; }
.magic { position: relative; width: 120px; height: 120px; }
.magic .ring { position: absolute; inset: 0; border-radius: 50%;
  border: 6px solid transparent; border-top-color: var(--terra); animation: spin 1s linear infinite; }
.magic .ring-2 { inset: 16px; border-top-color: var(--gold); animation-duration: 1.5s; animation-direction: reverse; }
.magic .sparkle { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.4rem; animation: twinkle 1.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%,100% { transform: scale(0.85); opacity: 0.6; } 50% { transform: scale(1.1); opacity: 1; } }

/* ---------- result ---------- */
.result-frame { width: auto; max-width: min(94vw, 720px); font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  animation: reveal .5s cubic-bezier(.2,.8,.25,1) both; }
/* size the photo by viewport height so the shot is as big as the screen allows */
.result-frame .frame-photo { width: auto; max-width: 100%; max-height: 66vh; }
@keyframes reveal { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }
.saved { font-family: var(--serif); font-style: italic; color: var(--terra-d); font-size: 1.5rem; margin: 0; }
.saved.error { color: oklch(0.5 0.16 28); font-style: normal; font-family: var(--sans); font-size: 1.05rem; }
.saved.error a { color: var(--terra-d); }
.retry-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.retry-model { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--muted); }
.retry-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ai-error {
  max-width: min(92vw, 640px); max-height: 28vh; overflow-y: auto; margin: 0; text-align: left;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; line-height: 1.45;
  color: oklch(0.45 0.16 28); white-space: pre-wrap; word-break: break-word;
  background: oklch(0.5 0.16 28 / 0.08); border: 1px solid oklch(0.5 0.16 28 / 0.3);
  border-radius: 12px; padding: 12px 14px;
}

/* ---------- gallery ---------- */
.gallery-title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; width: min(94vw, 1280px); max-height: 74vh; overflow-y: auto; padding: 6px; }
.grid img { width: 100%; border-radius: 10px; box-shadow: 0 14px 30px -18px oklch(0.3 0.05 50 / 0.6);
  transition: transform .18s ease; }
.grid img:hover { transform: scale(1.03); }
.grid p { grid-column: 1/-1; color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1.2rem; }

.error { color: oklch(0.5 0.16 28); }

/* ---------- lightbox (gallery zoom) ---------- */
#lightbox[hidden] { display: none; }
#lightbox {
  position: fixed; inset: 0; z-index: 100; cursor: zoom-out;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 3vh 4vw; cursor: zoom-out;
  background: oklch(0.2 0.02 50 / 0.82); backdrop-filter: blur(6px);
  animation: fade .25s ease both;
}
.frame-lb {
  font-size: clamp(0.95rem, 2.1vw, 1.4rem); width: auto; max-height: 80vh; cursor: default;
  box-shadow: 0 40px 90px -30px oklch(0 0 0 / 0.7);
  animation: reveal .3s cubic-bezier(.2,.8,.25,1) both;
}
.frame-lb .frame-photo { max-height: 62vh; width: auto; max-width: 84vw; }
.lightbox-close {
  position: fixed; top: 22px; right: 26px; z-index: 101;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid oklch(1 0 0 / 0.4); background: oklch(0 0 0 / 0.3); color: #fff;
  font-size: 1.3rem; line-height: 1; transition: background .15s ease, transform .15s ease;
}
.lightbox-close:hover { background: oklch(0 0 0 / 0.55); transform: scale(1.06); }
.grid img { cursor: zoom-in; }

/* ---------- gallery: sort + like badges ---------- */
.sort-bar { display: flex; gap: 8px; }
.sort-btn {
  font-family: var(--sans); font-size: 0.9rem; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--muted); transition: all .15s ease;
}
.sort-btn:hover { border-color: var(--terra); color: var(--terra-d); }
.sort-btn.is-on { background: var(--terra); border-color: var(--terra); color: #fff; }

/* gallery tiles: clean photo only (frame appears on zoom) */
.tile { position: relative; margin: 0; cursor: zoom-in; }
.tile img { display: block; width: 100%; }
.tile-likes {
  position: absolute; top: 9px; right: 9px; pointer-events: none; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px; line-height: 1;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 700; color: #fff;
  padding: 5px 11px; border-radius: 999px; background: oklch(0 0 0 / 0.5);
  backdrop-filter: blur(3px);
}
.tile-likes .tile-heart { font-size: 0.95em; opacity: 0.7; }
.tile-likes.has { background: oklch(0.55 0.18 18 / 0.9); }
.tile-likes.has .tile-heart { opacity: 1; }
.tile-cost { display: block; margin-top: 7px; text-align: center;
  font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }

/* ---------- wedding frame (CSS overlay; baked into pixels only when printing) ---------- */
.frame {
  margin: 0; background: var(--paper); border-radius: 8px; padding: 1em 1em 0;
  box-shadow: 0 20px 50px -28px oklch(0.3 0.05 50 / 0.55);
  display: flex; flex-direction: column;
}
.frame-photo-wrap { position: relative; line-height: 0; overflow: hidden; border-radius: 3px; }
.frame-photo { display: block; width: 100%; height: auto; }
.frame-cap { text-align: center; padding: 0.8em 0 1em; display: flex; flex-direction: column;
  align-items: center; gap: 0.42em; }
.frame-names { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--terra);
  font-size: 1.28em; line-height: 1.1; letter-spacing: 0.005em; }
/* date à la wedding stationery: letterspaced caps flanked by hairline rules */
.frame-date {
  display: flex; align-items: center; justify-content: center; gap: 0.7em;
  font-family: var(--serif); color: var(--muted); font-size: 0.64em;
  letter-spacing: 0.36em; text-transform: uppercase; padding-left: 0.36em; white-space: nowrap;
}
.frame-date::before, .frame-date::after {
  content: ""; flex: 0 0 1.3em; height: 1px; background: currentColor; opacity: 0.45;
}

/* print button in the lightbox */
.print-btn {
  font-family: var(--sans); font-size: 1.02rem; font-weight: 600; cursor: pointer; color: #fff;
  padding: 10px 20px; border-radius: 999px; border: 1.5px solid oklch(1 0 0 / 0.35);
  background: oklch(0 0 0 / 0.4); transition: background .15s ease;
}
.print-btn:hover { background: oklch(0 0 0 / 0.6); }
.print-btn:disabled { opacity: 0.6; cursor: default; }

/* the baked print surface is hidden on screen, shown alone on paper */
#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: grid !important; place-items: center; }
  #printImg { max-width: 100%; max-height: 100vh; }
  @page { margin: 12mm; }
}

/* ---------- lightbox: nav arrows + like + fountain ---------- */
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 101;
  width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid oklch(1 0 0 / 0.4); background: oklch(0 0 0 / 0.3); color: #fff;
  font-size: 2rem; line-height: 1; padding-bottom: 4px; transition: background .15s, transform .15s;
}
.lb-nav:hover { background: oklch(0 0 0 / 0.55); }
.lb-prev { left: 22px; }
.lb-next { right: 22px; }
.lb-prev:hover { transform: translateY(-50%) scale(1.08) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) scale(1.08) translateX(2px); }
#lightbox.solo .lb-nav { display: none; }

.like-bar { z-index: 101; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.lb-meta { margin: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.lb-cost { font-family: var(--sans); font-size: 0.82rem; color: oklch(1 0 0 / 0.55); }
.lb-dot { color: oklch(1 0 0 / 0.3); font-size: 0.8rem; }
.prompt-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--sans); font-size: 0.8rem; color: oklch(1 0 0 / 0.4);
  text-decoration: underline; text-underline-offset: 2px; transition: color .15s ease;
}
.prompt-toggle:hover { color: oklch(1 0 0 / 0.85); }
.like-hint {
  margin: 0; width: 100%; text-align: center; font-family: var(--sans); font-size: 0.9rem;
  font-weight: 600; color: #fff; animation: fade .2s ease both;
}
.prompt-panel[hidden] { display: none; }
.prompt-panel {
  z-index: 101; width: min(86vw, 680px); max-height: 30vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: oklch(0 0 0 / 0.55); border: 1px solid oklch(1 0 0 / 0.18); border-radius: 14px;
  padding: 14px 16px; backdrop-filter: blur(4px); animation: fade .2s ease both;
}
.prompt-label { margin: 0; font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: oklch(1 0 0 / 0.55); }
.prompt-text {
  margin: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem;
  line-height: 1.45; color: oklch(1 0 0 / 0.92); white-space: pre-wrap; word-break: break-word;
}
.prompt-panel .print-btn { align-self: flex-start; font-size: 0.85rem; padding: 6px 14px; }
.like-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--sans); font-size: 1.1rem; font-weight: 700; color: #fff;
  padding: 10px 22px; border-radius: 999px; border: 1.5px solid oklch(1 0 0 / 0.35);
  background: oklch(0 0 0 / 0.4); transition: transform .12s ease, background .15s ease;
}
.like-btn:hover { background: oklch(0.55 0.18 18 / 0.55); }
.like-btn:active { transform: scale(0.92); }
.like-heart { font-size: 1.35rem; filter: drop-shadow(0 0 6px oklch(0.6 0.2 18 / 0.8)); }
.like-count { min-width: 1ch; }

.fountain { position: fixed; inset: 0; z-index: 102; pointer-events: none; overflow: hidden; }
.heart {
  position: absolute; bottom: 7vh; will-change: transform, opacity;
  filter: drop-shadow(0 2px 7px oklch(0 0 0 / 0.5));
  animation-name: floatUp; animation-timing-function: cubic-bezier(.25,.6,.3,1); animation-fill-mode: both;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 0; }
  12%  { transform: translate(calc(var(--dx, 0) * 0.15), -9vh) scale(1.2) rotate(-6deg); opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translate(var(--dx, 0), -88vh) scale(1.05) rotate(12deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .heart { display: none; } }

/* ---------- entrance stagger (idle) ---------- */
body[data-screen="idle"] #topbar { animation: fade .6s ease both; }
body[data-screen="idle"] #stage { animation: fade .6s ease .08s both; }
body[data-screen="idle"] .card > * { animation: rise .55s ease both; }
.card > *:nth-child(1) { animation-delay: .16s; }
.card > *:nth-child(2) { animation-delay: .22s; }
.card > *:nth-child(3) { animation-delay: .28s; }
.card > *:nth-child(4) { animation-delay: .34s; }
.card > *:nth-child(5) { animation-delay: .40s; }
.card > *:nth-child(6) { animation-delay: .46s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ---------- idle: two columns (controls left, preview right) ---------- */
@media (min-width: 901px) {
  body[data-screen="idle"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
    grid-template-areas: "top top" "controls preview";
    align-items: start;
    gap: 14px 32px; padding: 0 32px 5vh;
  }
  body[data-screen="idle"] #topbar { grid-area: top; justify-self: center; }
  body[data-screen="idle"] .screen-idle {
    grid-area: controls; width: 100%; max-height: none; overflow: visible; padding: 0;
  }
  body[data-screen="idle"] .screen-idle .card { width: 100%; margin: 0; }
  body[data-screen="idle"] #stage {
    grid-area: preview; width: 100%; margin: 0; position: sticky; top: 18px;
  }
}

/* ============================================================
   KREATOR (step-by-step wizard) — idle UI
   ============================================================ */
.wz-card { align-items: stretch; text-align: left; gap: 14px; width: min(96vw, 860px); }
@media (min-width: 901px) { .wz-card { width: 100%; } }
.wz-card .eyebrow { text-align: center; }
.wizard { display: flex; flex-direction: column; gap: 16px; }

/* step rail */
.wz-rail { display: flex; gap: 6px; flex-wrap: wrap; }
.wz-step {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid transparent; color: var(--muted); font-size: 0.86rem; font-weight: 600;
}
.wz-step .wz-n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.8rem; background: var(--paper-2); border: 1px solid var(--line);
}
.wz-step.on { background: var(--card); border-color: var(--line); color: var(--ink); }
.wz-step.on .wz-n { background: var(--terra); color: #fff; border-color: var(--terra); }
.wz-step.done { color: var(--ink); }
.wz-step.done .wz-n { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.wz-body { display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.wz-title-block { margin-bottom: 2px; }
.wz-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; margin: 0; }
.wz-sub { color: var(--muted); font-size: 0.92rem; margin: 2px 0 0; }
.wz-fieldh { font-weight: 600; font-size: 0.95rem; margin: 8px 0 0; display: flex; align-items: baseline; gap: 7px; }
.wz-fieldh small { font-weight: 400; color: var(--muted); }
.wz-helper {
  display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; color: var(--muted);
  background: oklch(0.60 0.142 42 / 0.07); border: 1px solid oklch(0.60 0.142 42 / 0.18);
  border-radius: 12px; padding: 10px 12px;
}
.wz-helper .i { flex: none; }
.wz-helper b { color: var(--ink); font-weight: 600; }

/* mode cards */
.wz-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
@media (max-width: 560px) { .wz-modes { grid-template-columns: 1fr; } }
.wz-mode {
  position: relative; text-align: left; border: 1.5px solid var(--line); background: var(--paper);
  border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; transition: transform .14s ease, border-color .14s, background .14s;
}
.wz-mode:hover { border-color: var(--terra); transform: translateY(-2px); }
.wz-mode.on { border-color: var(--terra); background: oklch(0.60 0.142 42 / 0.08); box-shadow: 0 0 0 3px oklch(0.60 0.142 42 / 0.14); }
.wz-mode .wz-ic { font-size: 1.8rem; line-height: 1; }
.wz-mode .wz-nm { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wz-mode .wz-ds { font-size: 0.84rem; color: var(--muted); line-height: 1.4; }
.wz-mode-exp { border-style: dashed; grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; }
.wz-mode-exp .wz-ds { flex-basis: 100%; }
.wz-exp {
  font-family: var(--sans); font-size: 0.6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--terra-d); background: oklch(0.60 0.142 42 / 0.12);
  border: 1px solid oklch(0.60 0.142 42 / 0.30); border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}
.wz-mode .wz-tick {
  position: absolute; top: 11px; right: 11px; width: 21px; height: 21px; border-radius: 50%;
  background: var(--terra); color: #fff; display: none; place-items: center; font-size: 0.78rem;
}
.wz-mode.on .wz-tick { display: grid; }

/* search + filter toolbar */
.wz-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wz-search {
  flex: 1; min-width: 170px; display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px;
}
.wz-search input { border: 0; background: transparent; outline: none; font-family: inherit; font-size: 0.95rem; color: var(--ink); width: 100%; }
.wz-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.wz-filter { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 0.82rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: .12s; }
.wz-filter.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* emoji tiles */
.wz-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 3px; margin: -3px; }
.wz-tiles.compact { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); max-height: 300px; }
.wz-tile {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 13px; padding: 10px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  cursor: pointer; transition: .12s; min-height: 76px; justify-content: center;
}
.wz-tile:hover { border-color: var(--terra); background: oklch(0.60 0.142 42 / 0.05); }
.wz-tile.on { border-color: var(--terra); background: oklch(0.60 0.142 42 / 0.12); box-shadow: 0 0 0 2px oklch(0.60 0.142 42 / 0.2); }
.wz-tile .wz-e { font-size: 1.5rem; line-height: 1; }
.wz-tile .wz-l { font-size: 0.78rem; line-height: 1.15; color: var(--ink); }
.wz-none { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 22px; font-size: 0.9rem; }

/* person tabs + costume sub-tabs */
.wz-ptabs { display: flex; gap: 7px; flex-wrap: wrap; }
.wz-ptab { display: flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 13px; font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.wz-ptab.on { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.wz-ptab .wz-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--terra); opacity: 0; transition: .12s; }
.wz-ptab.filled .wz-dot { opacity: 1; }
.wz-ptab.wz-add { color: var(--terra-d); border-style: dashed; }
.wz-ptab .wz-plus { font-size: 1.05rem; line-height: 1; }
.wz-subtabs { display: inline-flex; background: var(--paper-2); border-radius: 10px; padding: 3px; gap: 2px; align-self: flex-start; }
.wz-subtabs button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.86rem; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.wz-subtabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px oklch(0.3 0.05 50 / 0.12); }

/* note + review */
.wz-note { margin-top: 4px; }
.wz-ta { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); font-family: inherit; font-size: 0.95rem; padding: 10px 12px; resize: vertical; color: var(--ink); min-height: 58px; margin-top: 7px; }
.wz-review { display: grid; gap: 9px; }
.wz-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.wz-row .who { font-weight: 700; min-width: 92px; flex: none; }
.wz-row .what { color: var(--muted); font-size: 0.92rem; }

/* wizard nav */
.wz-nav { display: flex; justify-content: space-between; gap: 12px; }
.wz-btn { border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 11px 22px; font-weight: 600; font-size: 0.96rem; color: var(--ink); cursor: pointer; transition: .14s; }
.wz-btn:hover:not(:disabled) { border-color: var(--terra); }
.wz-btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.wz-btn.primary:hover:not(:disabled) { opacity: 0.9; }
.wz-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* persistent footer: summary + shoot */
.wz-footer { display: flex; flex-direction: column; align-items: stretch; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.booth-summary h4 { margin: 0 0 7px; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wz-chip { font-size: 0.82rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.wz-chip.theme { background: oklch(0.60 0.142 42 / 0.12); border-color: oklch(0.60 0.142 42 / 0.3); }
.wz-empty { color: var(--muted); font-size: 0.86rem; }
.wz-footer .big-btn { align-self: center; }
.wz-footer .start-hint { position: static; transform: none; text-align: center; align-self: center; }
.wz-footer .start-hint::after { display: none; }

/* custom-prompt box: dictation mic + clear button */
.wz-note-box { position: relative; margin-top: 7px; }
.wz-note-box .wz-ta { margin-top: 0; padding-right: 84px; }
.wz-note-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.wz-note-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: 0.95rem; line-height: 1;
  display: grid; place-items: center; cursor: pointer; transition: transform .12s, border-color .12s, background .12s, color .12s;
}
.wz-note-btn:hover { border-color: var(--terra); transform: translateY(-1px); }
.wz-clear { color: var(--muted); }
.wz-mic.on { background: var(--terra); border-color: var(--terra); color: #fff; animation: wzMicPulse 1.2s ease-in-out infinite; }
@keyframes wzMicPulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.60 0.142 42 / 0.45); }
  50%      { box-shadow: 0 0 0 7px oklch(0.60 0.142 42 / 0); }
}
@media (prefers-reduced-motion: reduce) { .wz-mic.on { animation: none; } }
