/* =============================
   Event creation wizard (/create)
   =============================
   Three steps beside a live invite preview. Markup is built by
   www/js/event-wizard.js; every class here is prefixed wz-. Loaded after
   theme.css, main.css and auth.css. Colors come from the theme.css tokens so
   the light/dark toggle works; the seal red and confetti colors match the
   home page (home.css). */

:root {
  --wz-seal: #E8505B;
  --wz-seal-deep: #C8324A;
  --wz-seal-soft: rgba(232, 80, 91, 0.14);
  --wz-seal-text: #FF8A8F;
  --wz-mint: #4FD1A1;
  --wz-sun: #F7C548;
  --wz-card: var(--bg-surface);
  --wz-line: var(--overlay-strong);
  --wz-field: rgba(15, 23, 42, 0.55);
  --wz-muted: var(--text-muted-2);
  --wz-glow: rgba(232, 80, 91, 0.22);
  --wz-display: "Fraunces", Georgia, "Times New Roman", serif;
}

:root[data-theme="light"] {
  --wz-seal-text: #B4233B;
  --wz-field: #FFFFFF;
  --wz-glow: rgba(232, 80, 91, 0.12);
}

/* main.css pins html/body to height:100% with overflow-x:hidden, which makes
   body its own scroller and breaks position:sticky. Scroll the viewport. */
html { height: auto; overflow-x: clip; }

body.wz-page {
  height: auto;
  min-height: 100%;
  overflow: visible;
  background:
    radial-gradient(700px 420px at 100% 0%, var(--wz-glow), transparent 70%),
    var(--bg-page);
  background-attachment: fixed;
}

/* The header's own "+ Create Event" button is redundant on this page. */
.wz-page .auth-header-btn.primary { display: none; }
.wz-page .auth-header-bar { background: transparent; min-height: 56px; }
.wz-page .auth-header-btn { border-radius: 999px; padding: 8px 16px; }

.wz [hidden] { display: none !important; }

.wz {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 20px 0;
  color: var(--text-primary);
}

.wz-gate {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: var(--wz-muted);
}

.wz-gate-title { font-family: var(--wz-display); font-size: 28px; color: var(--text-primary); }

/* ── Top bar: title, stepper, cancel ─────────────────────── */

.wz-top-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 16px;
  padding: 8px 0 20px;
}

.wz-top-title h1 {
  font-family: var(--wz-display);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.wz-step-text { margin-top: 4px; font-size: 14px; color: var(--wz-muted); }

.wz-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--wz-line);
  background: var(--overlay-weak);
  color: var(--text-faint-3);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wz-cancel:hover { background: var(--overlay-stronger); color: var(--text-primary); }

.wz-steps {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.wz-step { flex: 1; min-width: 0; }

.wz-step-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 0;
  border: 0;
  border-top: 3px solid var(--overlay-strong);
  background: none;
  color: var(--wz-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.2s ease;
}

.wz-step-num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--overlay-strong);
  color: var(--text-faint-3);
  transition: background 0.2s ease, color 0.2s ease;
}

.wz-step.is-current .wz-step-btn { border-top-color: var(--wz-seal); color: var(--text-primary); }
.wz-step.is-current .wz-step-num { background: var(--wz-seal-deep); color: #fff; }
.wz-step.is-done .wz-step-btn { border-top-color: var(--wz-mint); color: var(--text-faint-3); }
.wz-step.is-done .wz-step-num { background: var(--wz-mint); color: #06281C; }
.wz-step-btn:hover { color: var(--text-primary); }

/* ── Layout ──────────────────────────────────────────────── */

.wz-grid { display: grid; gap: 20px; }
.wz-main { min-width: 0; }

.wz-card {
  background: var(--wz-card);
  border: 1px solid var(--wz-line);
  border-radius: 22px;
  padding: 24px 20px;
  box-shadow: 0 20px 50px var(--scrim-weak);
  animation: wz-in 0.3s ease;
}

@keyframes wz-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.wz-card-head { margin-bottom: 22px; }

.wz-card-title {
  font-family: var(--wz-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
}

.wz-card-sub { margin-top: 4px; font-size: 15px; color: var(--wz-muted); }

/* ── Fields ──────────────────────────────────────────────── */

.wz-field { margin-bottom: 18px; min-width: 0; }

.wz-label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}

.wz-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }

.wz-optional {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wz-muted);
}

.wz-counter {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-disabled);
  font-variant-numeric: tabular-nums;
}

.wz-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-default);
  background: var(--wz-field);
  color: var(--text-primary);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wz-input::placeholder { color: var(--text-disabled); }
.wz-input:hover { border-color: var(--border-strong); }

.wz-input:focus,
.wz-input:focus-visible {
  border-color: var(--wz-seal);
  box-shadow: 0 0 0 3px var(--wz-seal-soft);
}

.wz-textarea { min-height: 150px; resize: vertical; line-height: 1.5; }

.wz-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.wz-select option { background: var(--bg-surface); color: var(--text-primary); }

.wz-date-wrap { position: relative; }

.wz-date-wrap::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  pointer-events: none;
  background: var(--wz-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wz-date-alt { cursor: pointer; padding-right: 40px; }

.wz-hint { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--wz-muted); }

.wz-error {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--status-error);
}

.wz-error:empty { display: none; }

[aria-invalid="true"].wz-input,
[aria-invalid="true"] .wz-input { border-color: var(--status-error-solid); }

.wz-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--status-error-soft-bg);
  border: 1px solid var(--status-error-solid);
  color: var(--status-error-strong);
  font-size: 14px;
  font-weight: 500;
}

/* Groups: When, Where, RSVP settings */
.wz-group {
  border: 0;
  border-top: 1px solid var(--overlay-mid);
  margin: 6px 0 0;
  padding: 20px 0 0;
  min-width: 0;
}

.wz-group-title {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wz-seal-text);
}

.wz-group-title + * { clear: both; }
.wz-group-title .wz-optional { margin-left: 6px; }

.wz-row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }

.wz-switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 16px;
}

.wz-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.wz-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.wz-switch-track {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.2s ease;
}

.wz-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.wz-switch-input:checked + .wz-switch-track { background: var(--wz-seal-deep); }
.wz-switch-input:checked + .wz-switch-track::after { transform: translateX(18px); }
.wz-switch-input:focus-visible + .wz-switch-track { box-shadow: 0 0 0 3px var(--wz-seal-soft), 0 0 0 1px var(--wz-seal); }

.wz-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--overlay-mid);
}

.wz-seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--wz-muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wz-seg-btn:hover { color: var(--text-primary); }

.wz-seg-btn[aria-pressed="true"] {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  box-shadow: 0 2px 8px var(--scrim-weak);
}

[data-theme="light"] .wz-seg-btn[aria-pressed="true"] { background: #fff; }

/* ── Buttons ─────────────────────────────────────────────── */

.wz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease;
}

.wz-btn:active { transform: scale(0.97); }
.wz-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wz-btn-small { min-height: 40px; padding: 0 16px; font-size: 14px; }

.wz-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #D63C50 0%, var(--wz-seal-deep) 100%);
  box-shadow: 0 8px 22px rgba(200, 50, 74, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.wz-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(200, 50, 74, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.wz-btn-primary svg { transition: transform 0.2s ease; }
.wz-btn-primary:hover svg { transform: translateX(3px); }

.wz-btn-ghost {
  color: var(--text-primary);
  background: var(--overlay-soft);
  border-color: var(--wz-line);
}

.wz-btn-ghost:hover:not(:disabled) { background: var(--overlay-stronger); }

.wz-btn-danger {
  color: var(--status-error);
  background: transparent;
  border-color: var(--status-error);
}

.wz-btn-danger:hover:not(:disabled) { background: var(--status-error-soft-bg); }

.wz button:focus-visible,
.wz-dialog button:focus-visible {
  outline: 2px solid var(--wz-seal);
  outline-offset: 3px;
}

/* ── Step navigation ─────────────────────────────────────── */

.wz-nav {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-page-translucent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--overlay-mid);
}

.wz-nav-note { font-size: 13px; color: var(--wz-muted); }
.wz-nav .wz-btn-primary { margin-left: auto; }

/* ── Photo ───────────────────────────────────────────────── */

.wz-drop {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px;
  border-radius: 16px;
  border: 1.5px dashed var(--border-strong);
  background: var(--overlay-weak);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wz-drop:hover { border-color: var(--wz-seal); background: var(--wz-seal-soft); }

.wz-drop-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--wz-seal-soft);
  color: var(--wz-seal-text);
}

.wz-drop-title { font-size: 15px; font-weight: 700; }
.wz-drop-hint { font-size: 13px; color: var(--wz-muted); text-align: center; }

.wz-photo-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--wz-line);
  aspect-ratio: 3 / 2;
  max-width: 420px;
}

.wz-photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wz-photo-actions { display: flex; gap: 10px; margin-top: 12px; }

.wz-crop-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 50vh;
  margin-top: 10px;
  line-height: 0;
  overflow: hidden;
  border-radius: 12px;
  touch-action: none;
}

.wz-crop-img {
  display: block;
  max-width: 100%;
  max-height: 50vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.wz-crop-rect {
  position: absolute;
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.6);
  cursor: move;
  touch-action: none;
}

.wz-crop-handle {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: 8px 0 4px 0;
  background: #fff;
  cursor: nwse-resize;
  touch-action: none;
}

/* ── RSVP settings ───────────────────────────────────────── */

.wz-setting { margin-bottom: 20px; }

.wz-setting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.wz-setting-value { font-size: 14px; color: var(--wz-muted); }
.wz-range { width: 100%; accent-color: var(--wz-seal); cursor: pointer; }
.wz-range:disabled { cursor: not-allowed; opacity: 0.5; }

.wz-setting-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wz-setting-inline .wz-hint { max-width: 36ch; }

.wz-stepper {
  flex: none;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--wz-field);
}

.wz-stepper-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
}

.wz-stepper-btn:hover:not(:disabled) { background: var(--overlay-strong); }
.wz-stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.wz-stepper-value {
  min-width: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Background picker ───────────────────────────────────── */

.wz-search { position: relative; margin-bottom: 12px; }

.wz-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  color: var(--wz-muted);
  pointer-events: none;
}

.wz-search-input { padding-left: 40px; }

.wz-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -20px 18px;
  padding: 2px 20px 8px;
  scrollbar-width: none;
}

.wz-chips::-webkit-scrollbar { display: none; }

.wz-chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--wz-line);
  background: var(--overlay-weak);
  color: var(--text-faint-3);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wz-chip:hover { color: var(--text-primary); border-color: var(--border-strong); }

.wz-chip[aria-pressed="true"] {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-page);
}

.wz-bg-section + .wz-bg-section { margin-top: 24px; }

.wz-bg-heading {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}

.wz-bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.wz-bg-tile {
  position: relative;
  display: block;
  padding: 0;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  border: 0;
  overflow: hidden;
  background: var(--bg-surface-alt);
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: transform 0.15s ease, outline-color 0.15s ease;
}

.wz-bg-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.wz-bg-tile:hover img { transform: scale(1.06); }

.wz-bg-name {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 8px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.78));
}

.wz-bg-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wz-seal-deep);
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.wz-bg-tile[aria-pressed="true"] { outline-color: var(--wz-seal); }
.wz-bg-tile[aria-pressed="true"] .wz-bg-check { opacity: 1; transform: none; }

.wz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 16px;
  text-align: center;
  color: var(--wz-muted);
  font-size: 15px;
}

.wz-empty .loading-spinner,
.wz-gate .loading-spinner { border-top-color: var(--wz-seal); margin: 0; }

/* ── Live preview ────────────────────────────────────────── */

/* Small screens: the preview only appears on the Look step, as a short
   banner pinned above the picker so each tap shows on the invite. */
.wz-aside { display: none; }
.wz-aside-label, .wz-aside-note { display: none; }

.wz[data-step="look"] .wz-aside {
  display: block;
  order: -1;
  position: sticky;
  top: 8px;
  z-index: 15;
}

.wz-phone {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--wz-line);
  box-shadow: 0 16px 40px var(--scrim-mid);
}

.wz-invite {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 132px;
  padding: 16px;
  color: #fff;
  text-align: center;
  background-color: #334155;
  background-image: linear-gradient(135deg, #3B4A63, #1E293B);
  background-size: cover;
  background-position: center;
  transition: background-image 0.3s ease;
}

.wz-invite.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.28);
}

.wz-invite > * { position: relative; }

.wz-invite p { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); overflow-wrap: anywhere; }
.wz-invite .is-placeholder { opacity: 0.55; }

.wz-invite-title { font-size: 20px; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.wz-invite-date, .wz-invite-time { font-size: 14px; font-weight: 600; line-height: 1.4; }
.wz-invite-address { display: none; }
.wz-invite-desc, .wz-invite-foot { display: none; }

@media (min-width: 640px) {
  .wz { padding: 12px 28px 0; }
  .wz-card { padding: 32px; }
  .wz-nav { margin: 16px 0 0; padding: 14px 4px; border-radius: 18px 18px 0 0; }
  .wz-chips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--overlay-stronger) transparent; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
  .wz-chips::-webkit-scrollbar { display: block; height: 6px; }
  .wz-chips::-webkit-scrollbar-thumb { background: var(--overlay-stronger); border-radius: 3px; }
  .wz-row { grid-template-columns: 1fr 1fr; }
  .wz-row-when { grid-template-columns: 1.4fr 1fr 1fr; }
  .wz-bg-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .wz-top-inner { grid-template-columns: auto 1fr auto; gap: 24px; padding-bottom: 28px; }
  .wz-steps { grid-column: auto; max-width: 440px; width: 100%; justify-self: center; }
  .wz-step-text { display: none; }
}

@media (max-width: 639px) {
  .wz-step-label { display: none; }
  .wz-step-btn { padding-top: 0; border-top-width: 4px; border-radius: 2px; height: 4px; overflow: hidden; }
  .wz-step-num { display: none; }
  .wz-nav-note { display: none; }
  .wz-nav .wz-btn { flex: 1; }
  .wz-nav .wz-btn-ghost { flex: 0 0 auto; }
  .wz-cancel span { display: none; }
  .wz-cancel { padding: 9px; grid-row: 1; grid-column: 2; }
  .wz-bg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wz-setting-inline { align-items: flex-start; }
}

/* Keep the fixed theme toggle clear of the sticky Back/Continue bar. */
@media (max-width: 959px) {
  .wz-page .theme-toggle-btn { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

/* Wide screens: the full invite sits beside the form on every step. */
@media (min-width: 960px) {
  .wz-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }

  .wz-aside,
  .wz[data-step="look"] .wz-aside {
    display: block;
    order: 0;
    position: sticky;
    top: 24px;
    z-index: 1;
  }

  .wz-aside-label {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wz-muted);
    text-align: center;
  }

  .wz-aside-note {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--wz-muted);
    text-align: center;
  }

  .wz-phone {
    width: 300px;
    margin: 0 auto;
    padding: 9px;
    border-radius: 44px;
    border: 0;
    background: #0B1220;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 30px 60px var(--scrim-strong);
  }

  .wz-invite {
    justify-content: flex-start;
    gap: 14px;
    height: 580px;
    min-height: 0;
    padding: 40px 16px 16px;
    border-radius: 36px;
    overflow: hidden;
  }

  .wz-invite-title { font-size: 24px; margin-bottom: 10px; }
  .wz-invite-date, .wz-invite-time { font-size: 16px; }
  .wz-invite-address { display: block; margin-top: 10px; font-size: 12px; line-height: 1.4; }

  .wz-invite-desc {
    display: block;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.5);
    text-align: left;
    -webkit-mask-image: linear-gradient(#000 70%, transparent);
    mask-image: linear-gradient(#000 70%, transparent);
  }

  .wz-invite-photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; margin-bottom: 10px; display: block; }
  .wz-invite-desc-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }

  .wz-invite-foot { display: block; }
  .wz-invite-deadline { margin-bottom: 8px; padding: 7px; border-radius: 10px; background: rgba(220, 38, 38, 0.82); font-size: 12px; font-weight: 700; }

  .wz-invite-rsvp {
    padding: 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: #0F172A;
    font-size: 15px;
    font-weight: 800;
  }
}

/* ── Discard dialog ──────────────────────────────────────── */

.wz-dialog {
  width: min(92vw, 400px);
  margin: auto;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--wz-line);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 30px 80px var(--scrim-stronger);
}

.wz-dialog::backdrop { background: rgba(2, 6, 23, 0.6); backdrop-filter: blur(3px); }
.wz-dialog h2 { font-family: var(--wz-display); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.wz-dialog p { font-size: 15px; line-height: 1.5; color: var(--wz-muted); }
.wz-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ── flatpickr calendar ──────────────────────────────────── */

/* Theme-aware override of flatpickr's own light default CSS — references
   the shared theme tokens so the popup follows data-theme like the rest of
   the page, since flatpickr's popup is appended to <body> rather than
   scoped inside .wizard-container. */
.flatpickr-calendar {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    box-shadow: 0 8px 24px var(--scrim-strong);
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
    border-bottom-color: var(--bg-surface);
}

.flatpickr-months .flatpickr-month {
    color: var(--text-secondary);
    fill: var(--text-secondary);
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent;
    color: var(--text-secondary);
}

.flatpickr-current-month input.cur-year {
    color: var(--text-secondary);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: var(--text-muted-2);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--text-secondary);
}

.flatpickr-weekdays {
    background: var(--bg-surface);
}

span.flatpickr-weekday {
    background: var(--bg-surface);
    color: var(--text-muted-2);
}

.flatpickr-day {
    color: var(--text-secondary);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--border-strong);
}

.flatpickr-day:hover {
    background: var(--border-default);
    border-color: var(--border-default);
}

.flatpickr-day.today {
    border-color: var(--wz-seal);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--wz-seal);
    border-color: var(--wz-seal);
    color: var(--text-strong);
}

.flatpickr-time {
    border-top: 1px solid var(--border-default);
}

.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text-secondary);
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--border-default);
}

.numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-muted-2);
}

.numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-muted-2);
}

.numInputWrapper:hover {
    background: transparent;
}


.flatpickr-calendar { border-radius: 14px; font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  .wz-card { animation: none; }
  .wz *, .wz *::after { transition: none !important; }
}
