/* ============================================================
   The Shared Album — visual language
   ============================================================ */
:root {
  --bg:      #19121f;
  --bg-2:    #221829;
  --paper:   #fbf7f1;
  --ink:     #f3e9df;
  --muted:   #b29db5;
  --gold:    #e7c58a;
  --gold-2:  #f0d6a6;
  --rose:    #e79a8c;
  --danger:  #e6736b;
  --line:    rgba(231, 197, 138, 0.18);
  --shadow:  0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(1100px 700px at 50% -10%, rgba(231, 197, 138, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(231, 154, 140, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh; min-height: 100dvh;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ---------------- Buttons ---------------- */
.btn {
  font-family: inherit; font-size: 0.98rem; font-weight: 500;
  border: 1px solid transparent; border-radius: 999px;
  padding: 0.85rem 1.5rem; cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
  letter-spacing: 0.01em;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-sm { padding: 0.55rem 1.05rem; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #2a1d12;
  box-shadow: 0 8px 22px -10px rgba(231, 197, 138, 0.6);
}
.btn-primary:hover { background: var(--gold-2); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(230, 115, 107, 0.4); }
.btn-danger:hover { background: rgba(230, 115, 107, 0.12); }
.icon-btn {
  background: transparent; border: none; color: var(--ink);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
  width: 2.6rem; height: 2.6rem; border-radius: 999px;
  display: grid; place-items: center; transition: background 0.18s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); }

/* ---------------- Invite gate ---------------- */
.gate {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 1.5rem; overflow: hidden;
}
.room {
  position: absolute; inset: 0; z-index: 0;
  background-image: url('/bg-desktop.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
@media (max-width: 640px) {
  .room { background-image: url('/bg-mobile.png'); background-position: center top; }
}
.hero-scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 46%, rgba(25, 18, 31, 0.18) 0%, rgba(25, 18, 31, 0.72) 100%);
}
.sparkle-canvas {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; width: 100%; height: 100%;
}

.gate-card {
  position: relative; z-index: 4;
  width: 100%; max-width: 27rem; text-align: center;
  padding: 2.4rem 1.8rem;
  background: rgba(25, 18, 31, 0.34);
  border: 1px solid rgba(231, 197, 138, 0.35); border-radius: 20px;
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  box-shadow:
    0 0 0 1px rgba(231, 197, 138, 0.08) inset,
    0 0 22px rgba(231, 197, 138, 0.18),
    0 0 60px rgba(231, 197, 138, 0.08);
  animation: cardGlow 4s ease-in-out infinite;
}
@keyframes cardGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(231, 197, 138, 0.06) inset,
      0 0 18px rgba(231, 197, 138, 0.16),
      0 0 55px rgba(231, 197, 138, 0.07);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(231, 197, 138, 0.12) inset,
      0 0 30px rgba(231, 197, 138, 0.32),
      0 0 80px rgba(231, 197, 138, 0.18),
      0 0 120px rgba(231, 154, 140, 0.09);
  }
}
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1.5rem;
  opacity: 0; animation: fadeUp 0.9s ease 0.5s both;
}
.ring-wrap { position: relative; width: 4.6rem; height: 4.6rem; margin: 0 auto 1.3rem; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle {
  fill: none; stroke: var(--gold); stroke-width: 1.4;
  stroke-dasharray: 295; stroke-dashoffset: 295;
  animation: draw 1.5s ease 0.35s forwards;
}
.monogram {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; object-position: center top;
  opacity: 0; animation: fadeIn 1s ease 0.9s both;
}
.couple {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 3.7rem); line-height: 1.05;
  margin: 0; font-optical-sizing: auto;
  opacity: 0; animation: fadeUp 1s ease 0.7s both;
}
.gate-date {
  font-family: "Caveat", cursive; font-size: 1.55rem; color: var(--gold);
  margin: 0.5rem 0 0; opacity: 0; animation: fadeUp 1s ease 1.05s both;
}
.gate-venue {
  font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em;
  margin: 0.3rem 0 0;
  opacity: 0; animation: fadeUp 1s ease 1.15s both;
}
.gate-lede {
  color: var(--muted); font-size: 1rem; line-height: 1.6;
  margin: 1.3rem auto 1.9rem; max-width: 21rem;
  opacity: 0; animation: fadeUp 1s ease 1.2s both;
}
.gate-form { display: flex; flex-direction: column; gap: 0.7rem; opacity: 0; animation: fadeUp 1s ease 1.35s both; }
.code-input {
  font-family: inherit; font-size: 1.1rem; text-align: center;
  letter-spacing: 0.18em; padding: 0.95rem 1rem; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--ink); text-transform: uppercase;
}
.code-input::placeholder { color: var(--muted); letter-spacing: 0.05em; text-transform: none; }
.code-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 197, 138, 0.18); }
.gate-error { color: var(--rose); font-size: 0.92rem; margin: 1rem 0 0; }
.gate-or {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0.9rem 0 0.5rem; color: var(--muted); font-size: 0.8rem;
  opacity: 0; animation: fadeUp 1s ease 1.5s both;
}
.gate-or::before, .gate-or::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.btn-qr {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; font-size: 0.95rem;
  opacity: 0; animation: fadeUp 1s ease 1.55s both;
}
.qr-reader {
  margin-top: 0.8rem; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
}
.qr-reader video { width: 100%; display: block; }
.gate-footer {
  margin-top: 1.6rem; font-size: 0.8rem; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  opacity: 0; animation: fadeUp 1s ease 1.5s both;
}
.gate-footer-sep { opacity: 0.4; }
.gate-admin-link {
  color: var(--muted); text-decoration: none; transition: color 0.2s ease;
}
.gate-admin-link:hover { color: var(--gold); }
.gate-dev-link {
  color: var(--gold); text-decoration: none; transition: opacity 0.2s ease;
}
.gate-dev-link:hover { opacity: 0.75; }

/* ---------------- Dev bypass bar (dev only, fixed top) ---------------- */
.dev-bypass {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  padding: 0.4rem 1rem;
  background: rgba(20, 14, 28, 0.92);
  border-bottom: 1px dashed rgba(200, 168, 75, 0.4);
  backdrop-filter: blur(8px);
  font-size: 0.75rem; color: #c8a84b;
  display: flex; align-items: center; gap: 0.6rem;
}
.dev-badge {
  background: #c8a84b; color: #1a1620;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem; border-radius: 3px; flex-shrink: 0;
}
.dev-btn {
  background: rgba(200, 168, 75, 0.12);
  border: 1px solid rgba(200, 168, 75, 0.38);
  color: #c8a84b; border-radius: 4px;
  padding: 0.22rem 0.7rem; font-size: 0.72rem; cursor: pointer;
  transition: background 0.15s;
}
.dev-btn:hover { background: rgba(200, 168, 75, 0.26); }
.dev-btn.dev-active {
  background: rgba(200, 168, 75, 0.28);
  border-color: rgba(200, 168, 75, 0.7);
  font-weight: 600;
}
/* push page content below the fixed bar */
body:has(#devBypass:not([hidden])) { padding-top: 36px; }

/* ---------------- Invitation mode ---------------- */
.invitation-mode .gate-card { max-width: 28rem; }

.invite-countdown {
  margin: 0.2rem 0 1.6rem;
  opacity: 0; animation: fadeUp 1s ease 1.35s both;
}
.countdown-label {
  font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.85rem;
}
.countdown-grid {
  display: flex; align-items: flex-start; justify-content: center; gap: 0.15rem;
}
.countdown-unit {
  display: flex; flex-direction: column; align-items: center; min-width: 3.2rem;
}
.countdown-unit span {
  font-family: "Fraunces", serif; font-size: 2.2rem; font-weight: 500;
  color: var(--gold); line-height: 1; letter-spacing: 0.02em;
}
.countdown-unit small {
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin-top: 0.3rem;
}
.countdown-sep {
  font-family: "Fraunces", serif; font-size: 1.8rem; color: var(--gold);
  opacity: 0.4; line-height: 1; padding-top: 0.05rem; align-self: flex-start;
}

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 5; background: transparent; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1.1rem 0.5rem 0.9rem; font-size: 0.8rem; letter-spacing: 0.04em;
  transition: border-color 0.2s ease, color 0.2s ease;
  opacity: 0; animation: fadeIn 1s ease 2s both;
}
.scroll-hint svg { animation: bounce 2s ease-in-out infinite; }
.scroll-hint:hover { border-color: var(--gold); color: var(--gold); }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(3px); }
}

/* ---------------- Thank-you message section ---------------- */
.message-section {
  position: relative; overflow: hidden;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 5rem 1.5rem 6rem;
}
.message-inner {
  position: relative; z-index: 1;
  max-width: 34rem; margin: 0 auto; text-align: center;
}
.message-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 1.4rem;
}
.message-heading {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.15;
  margin: 0 0 2.4rem; color: var(--ink);
}
.message-body {
  text-align: left; color: var(--muted); line-height: 1.85; font-size: 1rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.message-body p { margin: 0; }
.message-sig {
  margin: 2.6rem 0 0; font-family: "Fraunces", serif;
  font-size: 1.1rem; color: var(--ink); line-height: 1.6;
}
.message-sig strong { font-size: 1.25rem; color: var(--gold-2); }
.message-divider {
  width: 3rem; height: 1px; background: var(--line);
  margin: 2.4rem auto;
}
.message-note {
  font-size: 0.85rem; color: var(--muted); line-height: 1.65;
  max-width: 26rem; margin: 0 auto;
}

/* ---------------- RSVP / registration section ---------------- */
.rsvp-section {
  position: relative; overflow: hidden;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 5rem 1.5rem 5.5rem;
}
.rsvp-inner {
  position: relative; z-index: 1;
  max-width: 28rem; margin: 0 auto;
}
.rsvp-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 1rem; text-align: center;
}
.rsvp-heading {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.2;
  margin: 0 0 0.9rem; color: var(--ink); text-align: center;
}
.rsvp-sub {
  font-size: 0.95rem; color: var(--muted); line-height: 1.7;
  margin: 0 0 1.6rem; text-align: center;
}
.rsvp-why {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin: 0 0 2rem;
}
.rsvp-why-item {
  display: flex; align-items: flex-start; gap: 0.9rem;
  background: rgba(231,197,138,0.06);
  border: 1px solid rgba(231,197,138,0.14);
  border-radius: 12px; padding: 0.85rem 1rem;
  text-align: left;
}
.rsvp-why-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1.4; }
.rsvp-why-item strong {
  display: block; font-size: 0.9rem; color: var(--ink);
  margin-bottom: 0.2rem; font-weight: 600;
}
.rsvp-why-item p {
  margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.6;
}
.rsvp-form { display: flex; flex-direction: column; gap: 1rem; }
.field-group { display: flex; flex-direction: column; gap: 0.45rem; }
.field-label {
  font-size: 0.82rem; letter-spacing: 0.06em; color: var(--muted);
  text-transform: uppercase;
}
.text-input {
  font-family: inherit; font-size: 0.98rem;
  padding: 0.8rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.04);
  color: var(--ink); width: 100%;
}
.text-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231,197,138,0.15); }
.role-select { cursor: pointer; }
.rsvp-check-label {
  display: flex; align-items: flex-start; gap: 0.7rem;
  cursor: pointer; font-size: 0.95rem; color: var(--ink); line-height: 1.5;
}
.rsvp-checkbox { width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--gold); flex-shrink: 0; }
.rsvp-success {
  text-align: center; padding: 1.5rem 0;
}
.rsvp-check-icon {
  display: inline-grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: rgba(231,197,138,0.12); border: 1px solid var(--gold);
  font-size: 1.4rem; color: var(--gold); margin-bottom: 1rem;
}
.rsvp-success-title {
  font-family: "Fraunces", serif; font-size: 1.5rem;
  color: var(--ink); margin: 0 0 0.7rem; font-weight: 500;
}
.rsvp-success-msg { font-size: 0.95rem; color: var(--muted); line-height: 1.7; margin: 0; }
.rsvp-success-msg strong { color: var(--ink); }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(25, 18, 31, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: baseline; gap: 0.7rem; min-width: 0; }
.brand-mono { font-family: "Fraunces", serif; color: var(--gold); font-size: 1.05rem; letter-spacing: 0.05em; }
.brand-names { font-family: "Fraunces", serif; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Album ---------------- */
.album {
  max-width: 1240px; margin: 0 auto;
  padding: 1.5rem 1.25rem 6rem;
}

/* Sort / filter toolbar */
.album-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.album-meta {
  font-family: "Caveat", cursive; font-size: 1.35rem; color: var(--gold);
  min-height: 1.4rem;
}
.album-sort { display: flex; align-items: center; gap: 0.5rem; }
.sort-select {
  font-family: inherit; font-size: 0.88rem; font-weight: 500;
  padding: 0.45rem 2rem 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b29db5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  -webkit-appearance: none; appearance: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.sort-select:focus { outline: none; border-color: var(--gold); }
.sort-select option { background: var(--bg-2); color: var(--ink); }

/* Album banner slideshow */
.album-banner {
  position: relative; width: 100%; height: 52vw; max-height: 58vh;
  overflow: hidden; margin-bottom: 0.5rem; border-radius: 0;
}
.album-banner-slides { position: absolute; inset: 0; }
.album-banner-slides .banner-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
}
.album-banner-slides .banner-slide.active { opacity: 1; }
.album-banner-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, rgba(8,5,11,0.72) 100%);
  pointer-events: none;
}
@media (max-width: 600px) { .album-banner { height: 56vw; max-height: 52vh; } }

/* Masonry grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
@media (min-width: 600px)  { .grid { grid-template-columns: repeat(4, 1fr); gap: 4px; } }
@media (min-width: 900px)  { .grid { grid-template-columns: repeat(5, 1fr); gap: 4px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 5px; } }

.card {
  background: var(--bg-2);
  cursor: pointer; position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, outline 0.12s ease;
}
.card:hover, .card:focus-visible {
  transform: scale(1.03);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.7);
  outline: none; z-index: 2;
}
.card-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(0,0,0,0.12);
  width: 100%;
}
.card-img img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center;
}
.card-by {
  font-family: "Caveat", cursive; font-size: 1.15rem;
  color: #6a4a3a; margin: 0.5rem 0.2rem 0; text-align: center;
  line-height: 1.2; min-height: 1rem;
}

/* Select mode */
.card-check {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 1.6rem; height: 1.6rem; border-radius: 999px;
  border: 2px solid rgba(180,140,100,0.5);
  background: rgba(25,18,31,0.6);
  display: none;
  align-items: center; justify-content: center;
  font-size: 0.85rem; color: #2a1d12; font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}
#app.select-mode .card { cursor: pointer; }
#app.select-mode .card-check { display: flex; }
#app.select-mode .card:hover { transform: rotate(0deg) scale(1.008); }
.card.selected { outline: 3px solid var(--gold); outline-offset: 2px; }
.card.selected .card-check { background: var(--gold); border-color: var(--gold); }

/* Bulk action bar */
.bulk-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  bottom: env(safe-area-inset-bottom, 0);
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom));
  background: rgba(34, 24, 41, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  animation: slideUpBar 0.22s ease both;
}
@keyframes slideUpBar { from { transform: translateY(100%); } to { transform: none; } }
.bulk-count { font-family: "Caveat", cursive; font-size: 1.25rem; color: var(--gold); }
.bulk-actions { display: flex; gap: 0.5rem; }

/* ---------------- Empty + loading ---------------- */
.empty { text-align: center; padding: 5rem 1rem; }
.empty-title { font-family: "Fraunces", serif; font-size: 1.7rem; margin: 0; }
.empty-sub { color: var(--muted); margin: 0.4rem 0 1.6rem; }
.loading { text-align: center; color: var(--muted); padding: 4rem 1rem; }

/* ---------------- Floating add (mobile) ---------------- */
.fab {
  position: fixed;
  right: 1.1rem; bottom: 1.1rem;
  bottom: calc(1.1rem + env(safe-area-inset-bottom));
  width: 3.7rem; height: 3.7rem; border-radius: 999px; border: none;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #2a1d12; font-size: 2rem; line-height: 1; cursor: pointer;
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.7);
  display: none; z-index: 30;
}
@media (max-width: 760px) { .fab { display: grid; place-items: center; } .btn-sm#addBtn { display: none; } }

/* ---------------- Upload sheet ---------------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 6, 14, 0.72); backdrop-filter: blur(3px); }
.sheet-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(100% - 2rem); max-width: 30rem;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 22px;
  max-height: 90dvh; display: flex; flex-direction: column;
  animation: sheetIn 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 1.4rem 1rem;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.sheet-head h2 { font-family: "Fraunces", serif; font-weight: 500; font-size: 1.5rem; margin: 0; }
.sheet-body {
  flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem 0;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.sheet-foot {
  flex-shrink: 0;
  padding: 1rem 1.4rem calc(1.2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.field-label { display: block; font-size: 0.92rem; margin: 0 0 0.45rem; font-weight: 500; }
.field-hint { color: var(--muted); font-weight: 400; }
.text-input {
  width: 100%; font-family: inherit; font-size: 1rem;
  padding: 0.8rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--ink); margin-bottom: 1.2rem;
}
.text-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 197, 138, 0.16); }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 16px; padding: 1.8rem 1rem;
  text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  transition: border-color 0.2s ease, background 0.2s ease; margin-bottom: 1rem;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag {
  border-color: var(--gold); background: rgba(231, 197, 138, 0.06); outline: none;
}
.dropzone-plus { font-size: 1.8rem; color: var(--gold); }
.dropzone-text { font-weight: 500; }
.dropzone-sub { color: var(--muted); font-size: 0.88rem; }
.previews {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 0.5rem; margin-bottom: 1.2rem;
  max-height: 172px; overflow-y: auto; overscroll-behavior: contain;
}
.previews:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.05); }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview.done::after {
  content: "✓"; position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(25, 18, 31, 0.55); color: var(--gold); font-size: 1.4rem;
}
.preview-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); width: 0; transition: width 0.2s ease; }
.preview-play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  pointer-events: none;
}
.card-play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 10px rgba(0,0,0,0.6); pointer-events: none;
  background: rgba(0,0,0,0.18);
}
.preview-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(10, 6, 14, 0.78); border: none;
  color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s ease;
  padding: 0;
}
.preview:hover .preview-remove { opacity: 1; }
@media (pointer: coarse) { .preview-remove { opacity: 1; } }
.upload-status { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0.9rem 0 0; }

/* ---------------- Lightbox ---------------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8, 5, 11, 0.94); display: flex; flex-direction: column; }
.lightbox[hidden] { display: none !important; }
.lightbox-close {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 3;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.24); }
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  font-size: 2rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.26); }
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
.lightbox-arrow[disabled] { opacity: 0.2; pointer-events: none; }
.lightbox-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3.5rem 4rem 1rem; min-height: 0; overflow: hidden; }
.lightbox-img { max-width: 100%; max-height: calc(100dvh - 10rem); object-fit: contain; border-radius: 4px; box-shadow: var(--shadow); }
.lightbox-video-wrap {
  position: relative; max-width: 100%; max-height: calc(100dvh - 10rem);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; overflow: hidden; cursor: pointer;
}
.lightbox-video-el {
  max-width: 100%; max-height: calc(100dvh - 10rem); display: block;
  border-radius: 4px; box-shadow: var(--shadow);
}
.lb-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.28); transition: opacity 0.25s;
}
.lb-play-overlay.playing { opacity: 0; pointer-events: none; }
.lb-play-btn {
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff; padding-left: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.lightbox-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.lightbox-by { font-family: "Caveat", cursive; font-size: 1.3rem; color: var(--gold); }
.lightbox-actions { display: flex; gap: 0.6rem; }

/* ---------------- Gate background slideshow ---------------- */
.gate-slideshow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.gate-slideshow .gate-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.6s ease;
}
.gate-slideshow .gate-slide.active { opacity: 0.28; }

/* ---------------- Motion ---------------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn {
  from { transform: translate(-50%, -50%) scale(0.96); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 0.62; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .card { transform: none !important; }
  .card:hover { transform: none !important; }
  .ring circle { stroke-dashoffset: 0 !important; }
  .eyebrow, .couple, .gate-date, .gate-lede, .gate-form, .monogram { opacity: 1 !important; }
}

/* ── Mobile fixes ── */
@media (max-width: 480px) {
  /* Gate card fits snugly on small phones */
  .gate-card { padding: 1.8rem 1.2rem; }

  /* Countdown numbers don't overflow on 320px phones */
  .countdown-unit { min-width: 2.6rem; }
  .countdown-unit span { font-size: 1.8rem; }
  .countdown-sep { font-size: 1.5rem; }

  /* RSVP section breathing room */
  .rsvp-section { padding: 3.5rem 1rem 4rem; }

  /* Message section */
  .message-section { padding: 3.5rem 1rem 4.5rem; }

  /* Topbar brand: shrink on tiny screens */
  .brand-names { font-size: 1rem; }
  .topbar-inner { padding: 0.75rem 1rem; }

  /* Album padding */
  .album { padding: 1rem 0.85rem 6rem; }

  /* Bulk-bar buttons wrap cleanly */
  .bulk-actions { gap: 0.4rem; }
  .bulk-actions .btn-sm { padding: 0.5rem 0.8rem; font-size: 0.82rem; }
}

/* Improve tap targets globally on touch devices */
@media (hover: none) {
  .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .card { touch-action: manipulation; }
  .code-input { font-size: 1rem; } /* prevent iOS zoom on focus */
  .text-input { font-size: 1rem; }
}
