/* Shubh Labh Moments. One stylesheet for the attendee, gallery and privacy
   pages, in the look of shubhlabhsummit.com: cream paper, plum ink, serif
   headings, mono labels, a lilac arch. Strict CSP: every style lives here,
   none inline. Fonts are served from /static/fonts/ (SIL OFL, see the
   OFL-*.txt files there); nothing is loaded from another site. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/dm-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/dm-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/dm-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/dm-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* The summit site's palette. Text colours pass WCAG AA on --paper and
     --card; coral is for fills, large type and accents, never small text. */
  --paper: #faf7f0;
  --card: #fffdf8;
  --lilac: #eee8f0;
  --lilac2: #e7dbe5;
  --lilac3: #c9b2da;
  --ink: #29252b;
  --ink2: #4a4550;
  --muted: #6f6a73;
  --rule: #ded7ce;
  --plum: #4b305d;
  --plum2: #684b79;
  --plumdeep: #31164d;
  --night: #18141c;
  --coral: #e8916f;
  --coral-wash: #fbebe3;
  --error: #9c3a1e;
  --error-wash: #fbebe3;
  --success: #2f6a43;
  --whatsapp: #25d366;
  --whatsapp-ink: #0b2e1a;
  --on-plum: #faf7f0;
  --on-plum2: #e7dbe5;
  --shadow: 0 1px 2px rgba(49, 22, 77, 0.04), 0 10px 30px rgba(49, 22, 77, 0.08);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Pages show and hide parts with the "hidden" attribute. Any rule below that
   sets "display" would otherwise win over the browser's own style for it. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* dvh is newer (Safari 15.4, Chrome 108); browsers without it keep 100vh. */
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
}

img { max-width: 100%; }
a { color: var(--plum); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--plumdeep); }
strong { font-weight: 700; }
em { font-style: italic; }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header and footer ---------- */

.site-header, main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: center; min-width: 0; }
/* The logo file is 276 x 77: shown at or below its native size. */
.summit-logo { display: block; height: 38px; width: auto; max-width: 136px; }
.favcy-logo { display: block; height: 24px; width: auto; flex: none; }

.wordmark {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.1;
  color: var(--plum);
}

.wordmark span {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink2);
}

main { flex: 1 0 auto; padding-top: 22px; padding-bottom: 40px; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 12px;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
  font-size: 0.86rem;
  color: #d9d0dc;
  text-align: center;
  background: #241a2b;
  border-top: 4px solid var(--coral);
}

.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: #ffffff; }
.site-footer a:focus-visible { outline-color: var(--coral); }
.site-footer > span { padding: 12px 0; }
.site-footer .sep { align-self: center; }
@media (max-width: 560px) { .site-footer { flex-direction: column; align-items: center; } .site-footer .sep { display: none; } }

/* ---------- Type ---------- */

h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}

h1 em, h2 em { color: var(--plum); }

.step-title {
  margin-bottom: 10px;
  font-size: 1.9rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.hero-title {
  margin-bottom: 14px;
  font-size: 2.2rem;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.lead { margin: 0 0 18px; color: var(--ink2); }
.muted, .hint, .fine { color: var(--muted); }
.fine { margin: 12px 0 0; font-size: 0.88rem; }
.center { text-align: center; }
.center-text { text-align: center; }
.block { display: block; }

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plum2);
}

.count { color: var(--plum); font-variant-numeric: tabular-nums; }

/* ---------- Surfaces ---------- */

.step { animation: rise 0.35s ease-out both; }

.panel, .help-card {
  padding: 24px 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--plum);
}

.panel.center .spinner { margin: 6px auto 18px; }
.center .guide-icon { margin-left: auto; margin-right: auto; }

.hero { position: relative; padding: 4px 0 8px; }

/* The site's recurring motif: a lilac arch. Here it holds three photos. */
.arch {
  position: relative;
  display: block;
  width: min(100%, 300px);
  height: 168px;
  margin: 0 auto 26px;
  overflow: hidden;
  background: var(--lilac2);
  border-radius: 999px 999px 0 0;
}

.arch i {
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 92px;
  height: 116px;
  margin-left: -46px;
  background: var(--card);
  border: 7px solid var(--card);
  border-bottom-width: 22px;
  box-shadow: 0 8px 24px rgba(49, 22, 77, 0.16);
}

.arch i::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--lilac3), var(--plum2));
}

.arch i:nth-child(1) { transform: translateX(-62px) rotate(-11deg); }
.arch i:nth-child(1)::before { background: linear-gradient(160deg, #f4c7b3, var(--coral)); }
.arch i:nth-child(2) { bottom: -6px; z-index: 1; transform: rotate(1deg); }
.arch i:nth-child(2)::before { background: linear-gradient(160deg, var(--plum2), var(--plumdeep)); }
.arch i:nth-child(3) { transform: translateX(62px) rotate(10deg); }

.note {
  margin: 14px 0;
  padding: 12px 14px;
  font-size: 0.93rem;
  color: var(--ink2);
  background: var(--lilac);
  border-left: 3px solid var(--plum2);
}

.note strong { display: block; margin-bottom: 2px; color: var(--ink); }

.stack > * + * { margin-top: 18px; }

.actions { display: grid; gap: 10px; margin-top: 18px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--plum);
  background: transparent;
  border: 1.5px solid var(--plum);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { color: var(--plumdeep); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-block { display: flex; width: 100%; }
.btn-large { min-height: 56px; font-size: 1.06rem; }

.btn-primary { color: var(--on-plum); background: var(--plum); border-color: var(--plum); }
.btn-primary:hover:not(:disabled) { color: var(--on-plum); background: var(--plumdeep); border-color: var(--plumdeep); }

.btn-secondary { background: var(--card); }
.btn-secondary:hover:not(:disabled) { background: var(--lilac); }

.btn-ghost {
  color: var(--plum);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.btn-whatsapp {
  color: var(--whatsapp-ink);
  background: var(--whatsapp);
  border-color: var(--whatsapp);
}

.btn-whatsapp:hover:not(:disabled) { color: var(--whatsapp-ink); background: #3ddc78; border-color: #3ddc78; }

.wa-icon {
  width: 22px;
  height: 22px;
  flex: none;
  background: url("/static/brand/whatsapp.svg") center / contain no-repeat;
}

.btn-small { min-height: 44px; padding: 8px 16px; font-size: 0.93rem; }

/* ---------- Spinner ---------- */

.spinner {
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--lilac2);
  border-top-color: var(--plum);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.spinner.light { border-color: rgba(255, 255, 255, 0.3); border-top-color: #ffffff; }

/* ---------- Instruction cards ---------- */

.cards {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 4px 16px 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.cards::-webkit-scrollbar { display: none; }

.guide-card {
  flex: 0 0 100%;
  min-height: 430px;
  padding: 26px 22px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--plum);
}

.guide-card h2 { margin-bottom: 14px; font-size: 1.6rem; line-height: 1.15; }
.guide-card p { margin: 0 0 12px; color: var(--ink2); }
.guide-card .muted { color: var(--muted); }

.guide-icon {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  background-color: var(--lilac);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 28px;
  border-radius: 999px 999px 0 0;
}

.icon-shield { background-image: url("/static/brand/icon-shield.svg"); }
.icon-face { background-image: url("/static/brand/icon-face.svg"); }
.icon-mail { background-image: url("/static/brand/icon-mail.svg"); }

.tips { margin: 0 0 14px; padding: 0; list-style: none; }

.tips li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 30px;
  color: var(--ink2);
}

.tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--lilac) url("/static/brand/icon-check.svg") center / 12px no-repeat;
}

.dots { display: flex; justify-content: center; gap: 4px; margin-top: -8px; }

.dot {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  background: var(--lilac3);
  border-radius: 999px;
  transition: width 0.2s ease, margin 0.2s ease, background-color 0.2s ease;
}

.dot[aria-current="true"]::before { width: 26px; margin-left: -13px; background: var(--plum); }

/* ---------- Selfie ---------- */

.frame {
  position: relative;
  width: min(100%, 340px, 54vh * 0.75);
  aspect-ratio: 3 / 4;
  margin: 4px auto 0;
  overflow: hidden;
  background: linear-gradient(160deg, var(--plum), var(--night));
  border-radius: 999px 999px 12px 12px;
}

/* Safari before 15 has no aspect-ratio: give the frame a height there. */
@supports not (aspect-ratio: 3 / 4) {
  .frame { height: 420px; }
}

.frame video, .frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame video, .frame img.mirrored { transform: scaleX(-1); }

.guide-oval { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.oval-shade { fill: rgba(24, 20, 28, 0.4); }

.oval-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
}

.frame.is-blocked .oval-line { opacity: 0.35; }

.frame-message, .frame-busy {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #ffffff;
  font-weight: 500;
  text-align: center;
}

.frame.is-blocked .spinner { display: none; }
.frame-busy { background: rgba(24, 20, 28, 0.62); }

.capture-controls { display: flex; justify-content: center; margin-top: 18px; }

.shutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
}

.shutter-ring {
  display: block;
  width: 78px;
  height: 78px;
  border: 5px solid var(--coral);
  border-radius: 50%;
  background: var(--plum);
  box-shadow: inset 0 0 0 4px var(--paper);
  transition: transform 0.12s ease;
}

.shutter:active:not(:disabled) .shutter-ring { transform: scale(0.92); }
.shutter:disabled { opacity: 0.45; cursor: not-allowed; }

.consent-line {
  max-width: 340px;
  margin: 14px auto 0;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

.help-card { margin-top: 16px; }
.help-card h2 { margin-bottom: 8px; font-size: 1.35rem; }
.help-card > p { margin: 0 0 12px; color: var(--ink2); }
.help-card .btn { margin-top: 10px; }

.link-box {
  display: block;
  margin: 8px 0 0;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  background: var(--card);
  border: 1px solid var(--rule);
  user-select: all;
  -webkit-user-select: all;
}

/* ---------- Form ---------- */

.field label, .field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--ink);
}

.optional { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 4px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, textarea:focus {
  outline: none;
  background: var(--card);
  border-color: var(--plum);
  box-shadow: 0 0 0 3px var(--lilac2);
}

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); background: var(--error-wash); }

.phone { display: flex; gap: 8px; }
.phone input:first-child { flex: 0 0 76px; text-align: center; }
.phone input:last-child { flex: 1 1 auto; min-width: 0; letter-spacing: 0.02em; }

.hint { margin: 6px 0 0; font-size: 0.87rem; }
.counter { text-align: right; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--error); font-weight: 700; }

.field-error, .form-error {
  margin: 6px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--error);
}

.form-error {
  padding: 10px 12px;
  background: var(--error-wash);
  border-left: 3px solid var(--error);
}

.check {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 4px;
}

.check input {
  width: 24px;
  height: 24px;
  margin: 1px 0 0;
  accent-color: var(--plum);
}

.check label { font-size: 0.93rem; line-height: 1.5; color: var(--ink2); }
.check .hint { margin-top: 2px; }
.check + .field-error { margin-top: 6px; }
/* :has is Safari 15.4+ and Chrome 105+; older browsers still mark the checkbox itself. */
.check:has(input[aria-invalid="true"]) { border-color: var(--error); background: var(--error-wash); }

/* ---------- Email code and finding ---------- */

.code-input {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4em;
  text-align: center;
}

.finding { padding-top: 34px; padding-bottom: 40px; }

.finding-stack {
  position: relative;
  display: block;
  width: 150px;
  height: 120px;
  margin: 0 auto 24px;
  overflow: hidden;
  background: var(--lilac2);
  border-radius: 999px 999px 0 0;
}

.finding-stack i {
  position: absolute;
  bottom: -8px;
  left: 37px;
  width: 76px;
  height: 92px;
  background: var(--card);
  border: 6px solid var(--card);
  border-bottom-width: 16px;
  box-shadow: 0 6px 18px rgba(49, 22, 77, 0.14);
  animation: shuffle 1.6s ease-in-out infinite;
}

.finding-stack i:nth-child(1) { --tilt: -10deg; --shift: -20px; background: var(--lilac3); }
.finding-stack i:nth-child(2) { --tilt: 8deg; --shift: 20px; background: var(--coral); animation-delay: 0.2s; }
.finding-stack i:nth-child(3) { --tilt: 0deg; --shift: 0; background: var(--plum2); animation-delay: 0.4s; }

.done-mark {
  display: block;
  width: 84px;
  height: 84px;
  margin: 6px auto 18px;
  border-radius: 50%;
  background: var(--plum) url("/static/brand/icon-check-white.svg") center / 40px no-repeat;
  box-shadow: 0 0 0 10px var(--lilac);
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

/* ---------- Gallery: community invite ---------- */

.invite {
  position: relative;
  margin: 0 0 20px;
  padding: 12px 14px 8px 16px;
  color: var(--on-plum);
  background: var(--plumdeep);
  border-left: 5px solid var(--coral);
}

.invite-eyebrow {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f0a28f;
}

.invite h2 {
  margin: 0 0 10px;
  padding-right: 34px;
  font-size: 1.25rem;
  line-height: 1.15;
  color: var(--on-plum);
}

.invite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.invite .btn-whatsapp { min-height: 44px; padding: 8px 16px; font-size: 0.95rem; }

.invite-more { font-size: 0.88rem; color: var(--on-plum2); }

.invite-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-plum);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}

.invite-more summary::-webkit-details-marker { display: none; }
.invite-more[open] { flex-basis: 100%; }
.invite-more p { margin: 2px 0 8px; }
.invite :focus-visible { outline-color: var(--coral); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; }

.chips li {
  padding: 4px 10px;
  font-size: 0.82rem;
  color: var(--on-plum);
  border: 1px solid rgba(250, 247, 240, 0.35);
  border-radius: 999px;
}

.invite-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--on-plum2);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.invite-close:hover { color: #ffffff; background: rgba(250, 247, 240, 0.1); }
.invite-soon { margin: 4px 0 0; font-size: 0.9rem; color: var(--on-plum2); }

/* ---------- Gallery page ---------- */

.gallery-hero { margin: 0 0 14px; }
.gallery-hero .step-title { margin-bottom: 8px; font-size: 1.85rem; }
.gallery-hero .eyebrow { margin-bottom: 8px; }

.shortlist-line {
  margin: 0;
  padding-left: 12px;
  font-size: 1.02rem;
  color: var(--ink);
  border-left: 3px solid var(--coral);
}

/* The shortlist bar sits above the grid and sticks to the top of the screen
   while the person scrolls through the photos. */
.shortlist-bar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px 10px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(250, 247, 240, 0.97);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 8px 20px rgba(49, 22, 77, 0.08);
}

.shortlist-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.shortlist-count { display: flex; align-items: center; gap: 2px 6px; flex-wrap: wrap; margin: 0; font-size: 0.94rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shortlist-count .btn-ghost { min-height: 44px; padding: 4px 6px; font-size: 0.9rem; }
.shortlist-save { flex: 0 1 auto; min-height: 48px; padding: 10px 14px; font-size: 0.9rem; }
.shortlist-share { flex: 0 0 auto; min-height: 48px; padding: 10px 14px; font-size: 0.9rem; }
.shortlist-note { margin: 6px 0 2px; font-size: 0.86rem; color: var(--ink2); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin: 12px -16px 0;
}

.photo {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--lilac);
  border: 0;
}

@supports not (aspect-ratio: 1) {
  .photo { height: 0; padding-bottom: 100%; }
  .photo-open { position: absolute; top: 0; left: 0; }
}

.photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.15s ease; }
/* Framed landscape photo in a square tile: crop the frame's bands away. */
.photo-open img.is-wide-frame { transform: scale(1.25); transform-origin: 50% 61%; }

.photo-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}

/* "Might be you": collapsed under the photos, one large photo per row on a
   phone so the guest can look for themselves, with two plain answers. */
.maybe-section { margin: 22px 0 0; }
.maybe-details { padding: 0 14px 14px; background: var(--card); border: 1px solid var(--lilac); border-radius: 14px; }
.maybe-details:not([open]) { padding-bottom: 0; }
.maybe-details > summary { min-height: 48px; padding: 12px 0; font-weight: 700; cursor: pointer; }
.maybe-intro { margin: 0 0 6px; font-size: 0.92rem; color: var(--ink2); }
.maybe-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 8px 0 0; }
/* Any shape of photo (the summit frame makes them taller): shown whole. */
.maybe-photo { aspect-ratio: 4 / 5; border-radius: 10px; }
.maybe-photo img { object-fit: contain; }
.maybe-actions { display: flex; gap: 8px; margin: 8px 0 0; }
.maybe-actions .btn { flex: 1 1 0; min-height: 48px; }

@media (min-width: 640px) {
  .maybe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Shortlist toggle on a tile: a small round mark, with a 44 px tap area. */
.tile-pick {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tile-pick::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  background: rgba(24, 20, 28, 0.32);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.tile-pick[aria-pressed="true"]::before {
  background: var(--plum) url("/static/brand/icon-check-white.svg") center / 15px no-repeat;
  animation: pop 0.2s ease-out;
}

.tile-pick:focus-visible { outline: 3px solid #ffffff; outline-offset: -5px; }
.photo.is-shortlisted { box-shadow: inset 0 0 0 3px var(--plum); }
.photo.is-shortlisted img { transform: scale(0.92); }

/* "Not me" hides behind a small dots button; the first tap asks, the second removes. */
.tile-more {
  position: absolute;
  bottom: 0;
  left: 0;
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tile-more span {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(24, 20, 28, 0.5);
  border-radius: 999px;
}

.tile-more.is-armed span { background: var(--error); }
.tile-more:focus-visible { outline: 3px solid #ffffff; outline-offset: -4px; }

.ready-line { margin: 6px 0 0; font-size: 0.9rem; font-weight: 500; color: var(--success); }

.help-line { margin: 16px 0 0; font-size: 0.92rem; color: var(--muted); text-align: center; }

/* Lower on the page: saving everything at once, and the link's lifetime. */
.more-saving {
  margin-top: 28px;
  padding: 22px 20px;
  background: var(--card);
  border: 1px solid var(--rule);
}

.more-saving h2 { margin-bottom: 6px; font-size: 1.35rem; }
.more-saving > p { margin: 0 0 14px; color: var(--ink2); }
.more-saving .toolbar { display: grid; gap: 10px; }
.more-saving .fine { margin-top: 14px; }

.saved-note { min-height: 1.4em; margin: 6px 0 0; font-size: 0.88rem; font-weight: 500; color: var(--success); }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }

/* A photo still being prepared: a soft shimmer instead of a broken image. */
.photo.is-loading {
  background: linear-gradient(100deg, var(--lilac) 30%, var(--lilac2) 50%, var(--lilac) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.photo.is-loading img,
.photo.is-failed img,
.viewer-stage.is-loading img,
.viewer-stage.is-failed img { visibility: hidden; }

.photo-note {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.photo.is-failed .photo-note { display: flex; }

/* ---------- Viewer ---------- */

.viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  color: #ffffff;
  background: var(--night);
  border: 0;
}

@supports (height: 100dvh) {
  .viewer { height: 100dvh; max-height: 100dvh; }
}

.viewer::backdrop { background: var(--night); }
/* Without <dialog> support (Safari before 15.4) the viewer is a fixed layer. */
.viewer:not([open]) { display: none; }
.viewer[open] { position: fixed; top: 0; left: 0; z-index: 50; }
body.has-viewer { overflow: hidden; }
.viewer :focus-visible { outline-color: var(--coral); }

.viewer-inner {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
}

.viewer-bar.bottom { padding-top: 8px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.viewer-count { font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.viewer-top-actions { display: flex; align-items: center; gap: 6px; }

.viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}

.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-loading { position: absolute; top: 50%; left: 50%; margin: -18px 0 0 -18px; }

.icon-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.icon-btn:disabled { opacity: 0.3; cursor: default; }

.viewer .btn { color: #ffffff; border-color: rgba(255, 255, 255, 0.45); }
.viewer .btn:hover:not(:disabled) { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.viewer-not-me { min-height: 44px; padding: 8px 14px; font-size: 0.88rem; }
.viewer .viewer-not-me.is-armed { background: var(--error); border-color: var(--error); }
.viewer-actions { display: flex; flex: 1 1 auto; flex-wrap: wrap; justify-content: center; gap: 8px; min-width: 0; }
.viewer-save { min-height: 48px; padding: 10px 16px; }

/* The main action in the viewer: coral fill with ink text when off, plum
   with a tick when the photo is on the shortlist. */
.viewer .viewer-pick {
  flex: 1 1 auto;
  max-width: 220px;
  color: var(--night);
  background: var(--coral);
  border-color: var(--coral);
}

.viewer .viewer-pick:hover:not(:disabled) { color: var(--night); background: #eea586; }

.viewer .viewer-pick[aria-pressed="true"] {
  color: #ffffff;
  background: var(--plum);
  border-color: var(--on-plum2);
}

.viewer .viewer-pick[aria-pressed="true"]:hover:not(:disabled) { color: #ffffff; background: var(--plum2); }

.pick-mark {
  width: 20px;
  height: 20px;
  flex: none;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.viewer-pick[aria-pressed="true"] .pick-mark {
  background: url("/static/brand/icon-check-white.svg") center / 13px no-repeat;
  border-color: #ffffff;
}

/* A save that had to wait: "Save now" stands out once it is ready. */
.btn.is-attention,
.btn.is-attention:hover:not(:disabled),
.viewer .btn.is-attention {
  color: var(--night);
  background: var(--coral);
  border-color: var(--coral);
  animation: nudge 1.6s ease-in-out 2;
}

.viewer .btn.is-waiting,
.viewer .btn.is-waiting:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.viewer-status { min-height: 1.4em; margin: 0; padding: 0 16px; font-size: 0.9rem; text-align: center; color: rgba(255, 255, 255, 0.82); }

/* ---------- Manage ---------- */

.manage-section + .manage-section { margin-top: 16px; }
.manage-section h2 { margin-bottom: 8px; font-size: 1.35rem; }
.manage-section p { margin: 0 0 12px; color: var(--ink2); }
.manage-section ul { margin: 0 0 14px; padding-left: 20px; color: var(--ink2); }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  font-weight: 500;
  cursor: pointer;
}

.switch input {
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: var(--lilac3);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(49, 22, 77, 0.3);
  transition: transform 0.2s ease;
}

.switch input:checked { background: var(--plum); }
.switch input:checked::after { transform: translateX(22px); }

.btn-danger { color: #ffffff; background: var(--error); border-color: var(--error); }
.btn-danger:hover:not(:disabled) { color: #ffffff; background: #7f2e17; border-color: #7f2e17; }
.danger-text { color: var(--error); border-color: var(--error); }
.danger-text:hover:not(:disabled) { color: var(--error); background: var(--error-wash); }

.confirm-box {
  margin-top: 12px;
  padding: 16px;
  background: var(--error-wash);
  border-left: 3px solid var(--error);
}

.confirm-box p { color: var(--ink); }
.confirm-box .actions { margin-top: 12px; }

.gallery-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 24px; }
.gallery-footer-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--plum);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}
.delete-section { margin-top: 18px; }

/* ---------- Privacy page ---------- */

.prose h1 { margin-bottom: 8px; font-size: 2.1rem; line-height: 1.1; }
.prose h2 { margin: 30px 0 8px; padding-top: 18px; font-size: 1.35rem; border-top: 1px solid var(--rule); }
.prose p, .prose li { color: var(--ink2); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--plum2); }
.prose .updated { font-size: 0.92rem; color: var(--muted); }

/* ---------- Motion ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shuffle {
  0%, 100% { transform: translateX(0) rotate(var(--tilt)); }
  50% { transform: translateX(var(--shift)) rotate(calc(var(--tilt) * -1)); }
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Larger screens ---------- */

@media (min-width: 720px) {
  main { padding-top: 34px; }
  main.wide { max-width: 1040px; }
  .site-header.wide { max-width: 1040px; }
  .hero-title { font-size: 2.9rem; }
  .step-title { font-size: 2.2rem; }
  .gallery-hero .step-title { font-size: 2.4rem; }
  .arch { height: 200px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin: 14px 0 0; }
  .shortlist-bar { margin: 0 0 10px; padding-left: 18px; padding-right: 18px; }
  .more-saving .toolbar { grid-template-columns: auto auto; justify-content: start; }
  .invite { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 24px; padding: 16px 64px 16px 24px; }
  .invite h2 { margin: 0; padding-right: 0; font-size: 1.5rem; }
  .invite-text { grid-column: 1; }
  .invite-actions { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 1.85rem; }
  .step-title { font-size: 1.6rem; }
  .favcy-logo { height: 20px; }
  .summit-logo { height: 32px; }
  .shortlist-save { padding-left: 12px; padding-right: 12px; font-size: 0.88rem; }
}
