/* ==========================================================
   Meow Webpages — public site styles.
   Used by the gallery (index.html) and both customize pages.
   Mobile first: most visitors arrive on a phone from Instagram.
   ========================================================== */
:root {
  --ink: #1c1430;
  --ink-soft: #453c5c;
  --muted: #756c8c;
  --line: #ebe5f6;
  --line-strong: #dcd2f1;
  --bg: #fcfaff;
  --surface: #fff;
  --tint: #f5f0fe;
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --pink: #ec4899;
  --grad: linear-gradient(120deg, #7c3aed 0%, #b83adf 52%, #ec4899 100%);
  /* a shade deeper than --grad so white button text stays readable */
  --grad-btn: linear-gradient(120deg, #6d28d9 0%, #a21caf 55%, #db2777 100%);
  --shadow-sm: 0 1px 2px rgba(28, 20, 48, 0.04), 0 4px 14px rgba(124, 58, 237, 0.06);
  --shadow-md: 0 2px 6px rgba(28, 20, 48, 0.05), 0 14px 34px rgba(124, 58, 237, 0.13);
  --shadow-lg: 0 24px 60px rgba(76, 29, 149, 0.22);
  --radius: 20px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
  --topbar-h: 60px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);

  /* earlier names, still read by the shared lovearea form and a few inline styles */
  --color-primary: var(--primary);
  --color-primary-dark: var(--primary-dark);
  --color-pink: var(--pink);
  --color-bg: var(--bg);
  --color-border: var(--line);
  --color-text: var(--ink);
  --color-muted: var(--muted);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(124, 58, 237, 0.45); outline-offset: 2px; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@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;
  }
}

.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid var(--line-strong); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
.loading-row { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 12px 4px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 22px; font: 700 14px/1.2 var(--font);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.primary { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 18px rgba(124, 58, 237, 0.28); }
.btn.secondary { background: #fff; color: var(--primary-dark); border-color: var(--line-strong); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 9px 14px; font-size: 13px; }
.btn.small svg { width: 14px; height: 14px; }
.btn.big { padding: 15px 28px; font-size: 15.5px; }
.btn.block { width: 100%; }
.btn:active:not(:disabled) { transform: scale(0.97); transition-duration: 0.08s; }
.btn:disabled, .btn[disabled] { opacity: 0.6; cursor: not-allowed; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { transform: translateY(-1px); }
  .btn.primary:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(124, 58, 237, 0.36); }
  .btn.secondary:hover:not(:disabled) { border-color: var(--primary); background: #fdfcff; }
  .btn.ghost:hover:not(:disabled) { background: var(--tint); color: var(--primary-dark); }
}
.btn .ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255, 255, 255, 0.5); pointer-events: none;
  animation: rippleOut 0.55s ease-out forwards;
}
.btn.secondary .ripple, .btn.ghost .ripple { background: rgba(124, 58, 237, 0.2); }
@keyframes rippleOut { to { transform: scale(2.6); opacity: 0; } }

/* ---------- small message that slides up from the bottom ---------- */
.mw-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 12px 30px rgba(28, 20, 48, 0.3);
  max-width: calc(100vw - 32px); text-align: center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}
.mw-toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ==========================================================
   Gallery page
   ========================================================== */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter);
  background: rgba(252, 250, 255, 0.84);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.topbar.scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(28, 20, 48, 0.05); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--ink); font-weight: 800; font-size: 16.5px; letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.3);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name span { color: var(--primary); }
.brand, .brand-name { white-space: nowrap; flex-shrink: 0; } /* the name is two words now; never break between them */
.topbar-links { margin-left: auto; display: flex; gap: 2px; }
.topbar-links a {
  padding: 8px 13px; border-radius: 999px; color: var(--ink-soft);
  text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.topbar-links a:hover { background: var(--tint); color: var(--primary-dark); }

.hero {
  position: relative; overflow: hidden;
  padding: clamp(26px, 5vw, 64px) var(--gutter) clamp(26px, 5vw, 60px);
  background:
    radial-gradient(640px 420px at 88% 0%, rgba(236, 72, 153, 0.15), transparent 62%),
    radial-gradient(720px 480px at 0% 0%, rgba(124, 58, 237, 0.15), transparent 62%);
}
.hero-inner {
  max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 40px; align-items: center;
}
.hero-copy { animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.live-stats {
  display: inline-flex; align-items: center; gap: 8px; text-align: left;
  margin: 0; padding: 7px 14px 7px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.live-stats-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex-shrink: 0;
  animation: liveStatsPulse 1.8s ease-out infinite;
}
@keyframes liveStatsPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.live-stats-sep { color: #b9aed6; margin: 0 7px; }
.ls-short { display: none; } /* phone wording, switched on further down */
/* the headline keeps the site's original serif and its shimmer */
.hero .hero-title {
  margin: 18px 0 16px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 5vw, 54px); line-height: 1.14; letter-spacing: -0.01em;
}
.hero .hero-title .shimmer-text {
  background: linear-gradient(100deg, var(--primary-dark) 30%, var(--pink) 45%, #fff 50%, var(--pink) 55%, var(--primary) 70%);
  background-size: 260% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmerSweep 4.5s ease-in-out infinite;
}
@keyframes shimmerSweep {
  0% { background-position: 120% 50%; }
  100% { background-position: -20% 50%; }
}
.hero .sub { margin: 0; max-width: 500px; font-size: clamp(15px, 1.5vw, 17.5px); color: var(--ink-soft); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-points {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
}
.hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.hero-points svg { width: 16px; height: 16px; color: #16a34a; flex-shrink: 0; }

/* three real template covers, shown as phones */
.hero-showcase { position: relative; height: 440px; }
.phone-card {
  position: absolute; left: 50%; top: 50%; width: 214px; aspect-ratio: 3 / 4.25;
  border: 6px solid #fff; border-radius: 30px; overflow: hidden;
  background: var(--tint); box-shadow: var(--shadow-lg);
  animation: phoneIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both, phoneBob 6s ease-in-out infinite;
}
.phone-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone-card:nth-child(1) { transform: translate(-50%, -50%) translate(-150px, 26px) rotate(-9deg) scale(0.84); z-index: 1; animation-delay: 0.05s, 0s; }
.phone-card:nth-child(2) { transform: translate(-50%, -50%); z-index: 3; animation-delay: 0.15s, 0.8s; }
.phone-card:nth-child(3) { transform: translate(-50%, -50%) translate(150px, 26px) rotate(9deg) scale(0.84); z-index: 1; animation-delay: 0.25s, 1.6s; }
@keyframes phoneIn { from { opacity: 0; } }
@keyframes phoneBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* three steps */
.how { max-width: var(--wrap); margin: 0 auto; padding: 4px var(--gutter) 0; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.how-step {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.how-num {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: var(--tint); color: var(--primary-dark);
  font-weight: 800; font-size: 15px; display: grid; place-items: center;
}
.how-step h3 { margin: 0 0 3px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.how-step p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* browse heading + search */
.browse { scroll-margin-top: var(--topbar-h); }
.browse-head {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(28px, 4vw, 46px) var(--gutter) 8px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
}
.browse-head .browse-title { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.browse-head p { margin: 5px 0 0; color: var(--muted); }
.search-wrap { position: relative; flex: 1 1 280px; max-width: 380px; }
.search-icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
#searchInput {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 12px 42px 12px 42px; font-size: 16px; color: var(--ink); background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none; appearance: none;
}
#searchInput::placeholder { color: #9a92ad; }
#searchInput:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.13); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--tint);
  color: var(--ink-soft); cursor: pointer; display: grid; place-items: center;
}
.search-clear svg { width: 12px; height: 12px; }

/* category chips stay in reach while the grid scrolls */
.filterbar {
  position: sticky; top: var(--topbar-h); z-index: 20;
  background: rgba(252, 250, 255, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.category-nav {
  max-width: var(--wrap); margin: 0 auto; padding: 10px var(--gutter);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-pills { display: flex; gap: 8px; width: max-content; }
.pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 15px; font: 600 13.5px/1.2 var(--font); color: var(--ink-soft);
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pill-icon { width: 13px; height: 13px; flex-shrink: 0; fill: currentColor; }
.pill-count { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pill:active { transform: scale(0.96); }
@media (hover: hover) { .pill:hover { border-color: var(--primary); color: var(--primary-dark); } }
.pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.active .pill-count { color: rgba(255, 255, 255, 0.7); }

.gallery-wrap { max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter) 72px; }
.result-count { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.gallery, .skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); gap: 20px; }
.skeleton-grid { grid-column: 1 / -1; }
.skeleton-card {
  aspect-ratio: 3 / 5; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(100deg, #f3eefc 30%, #fbf9ff 50%, #f3eefc 70%);
  background-size: 220% 100%; animation: skeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes skeletonShimmer { 0% { background-position: 140% 0; } 100% { background-position: -40% 0; } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.thumb-wrap { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--tint); }
.thumb { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
@media (hover: hover) {
  .card.in-view:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
  .card:hover .thumb { transform: scale(1.04); }
}
.featured-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--grad-btn); color: #fff; font-size: 11px; font-weight: 700;
  padding: 5px 10px 5px 8px; border-radius: 999px; box-shadow: 0 4px 10px rgba(28, 20, 48, 0.2);
}
.featured-badge svg { width: 11px; height: 11px; fill: currentColor; flex-shrink: 0; }
.featured-badge.trending { background: linear-gradient(120deg, #c2410c, #d97706); }
.featured-badge.recommended { background: linear-gradient(120deg, #6d28d9, #7c3aed); }
.card-body { display: flex; flex-direction: column; gap: 11px; flex: 1; padding: 12px 14px 14px; }
.card h3 {
  margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.card-cat { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
/* the two card buttons keep the look the site has always had: an outlined
   Preview and a solid purple Customize, stacked full-width on a phone */
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; padding: 10px 12px; font-size: 13px; }
.card-actions .btn.primary { background: var(--primary); box-shadow: none; }
@media (hover: hover) {
  .card-actions .btn.primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 8px 18px rgba(124, 58, 237, 0.3); }
}

.no-results { text-align: center; padding: 56px 20px 40px; color: var(--muted); }
.no-results strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.no-results .btn { margin-top: 16px; }

/* questions and answers */
.faq { max-width: 820px; margin: 0 auto; padding: 0 var(--gutter) 56px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.faq:has(.faq-list:empty) { display: none; } /* only the homepage carries them */
.faq h2 { margin: 0 0 16px; text-align: center; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -0.03em; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.faq-item[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.faq-item summary {
  position: relative; cursor: pointer; list-style: none; padding: 15px 46px 15px 18px;
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item p { margin: 0; padding: 0 18px 16px; font-size: 14.5px; color: var(--ink-soft); }

.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 4px 0 12px; }
.foot-links:empty { display: none; }
.foot-links a { color: var(--ink-soft); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.foot-links a:hover { color: var(--primary-dark); text-decoration: underline; }

footer.site-foot {
  border-top: 1px solid var(--line); padding: 26px var(--gutter) 40px;
  text-align: center; color: var(--muted); font-size: 13px;
}
footer.site-foot .brand { justify-content: center; font-size: 15px; margin-bottom: 8px; }
footer.site-foot a.plain { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
footer.site-foot a.plain:hover { text-decoration: underline; }

/* small floating Instagram credit */
.ig-badge {
  position: fixed; bottom: 14px; right: 14px; z-index: 40;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 11.5px; font-weight: 700;
  color: var(--primary-dark); text-decoration: none;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.18);
}
.ig-badge-icon { width: 11px; height: 11px; fill: var(--pink); }

/* ==========================================================
   Customize pages
   ========================================================== */
body.cz { --side-w: 460px; --cz-top: 58px; background: #f5f0fc; }
.cz-top {
  position: sticky; top: 0; z-index: 30; height: var(--cz-top);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 0 14px; background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cz-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px 8px 9px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px;
}
.cz-back svg { width: 17px; height: 17px; }
.cz-back:hover { background: var(--tint); color: var(--primary-dark); }
.cz-steps { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.cz-steps li { display: inline-flex; align-items: center; gap: 8px; }
.cz-steps li + li::before { content: ""; width: 22px; height: 1.5px; background: var(--line-strong); margin-right: 2px; }
.cz-steps b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tint); color: var(--primary-dark); font-size: 11.5px;
}
.cz-steps li.on { color: var(--ink); }
.cz-steps li.on b { background: var(--primary); color: #fff; }
.cz-tabs { display: none; background: var(--tint); border-radius: 999px; padding: 4px; }
.cz-tabs button {
  border: 0; background: none; padding: 8px 20px; border-radius: 999px;
  font: 700 13.5px/1.2 var(--font); color: var(--muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cz-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.cz-tabs .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); margin-left: 6px; vertical-align: middle; }
.cz-top-right { justify-self: end; }

#customizeLayout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
#customizeSidebar {
  background: #fff; border-right: 1px solid var(--line);
  min-height: calc(100vh - var(--cz-top)); min-height: calc(100dvh - var(--cz-top));
  padding: 22px 22px 130px;
}
.cz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cz-thumb {
  width: 54px; height: 72px; border-radius: 12px; object-fit: cover; object-position: top;
  flex-shrink: 0; background: var(--tint); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.cz-eyebrow { margin: 0 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.cz-head h1 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
#customizeSidebar .hint { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.cz-notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff8e8; border: 1px solid #f3deaa; border-radius: 14px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #6b4e07;
}
.cz-notice span { flex: 1; min-width: 160px; }
.cz-notice button {
  border: 0; background: none; padding: 4px 0; font: 700 13px var(--font);
  color: #8a5a00; text-decoration: underline; cursor: pointer;
}

/* the create button never scrolls out of reach */
.cz-footer {
  position: fixed; left: 0; bottom: 0; z-index: 25; width: var(--side-w);
  padding: 22px 22px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #fff 68%, rgba(255, 255, 255, 0));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.cz-footer > * { pointer-events: auto; }
#createStatus { font-size: 13px; text-align: center; color: var(--muted); }
#createStatus:empty { display: none; }
#createStatus.err { color: #dc2626; }
.cz-footer-note { margin: 0; text-align: center; font-size: 11.5px; color: var(--muted); }

#customizePreviewPane {
  position: sticky; top: var(--cz-top);
  height: calc(100vh - var(--cz-top)); height: calc(100dvh - var(--cz-top));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 14px 24px 22px;
}
#previewHeaderBar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.preview-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.auto-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; user-select: none; }
.auto-toggle input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }
#refreshPreviewBtn.stale { border-color: var(--pink); color: #be185d; }
.phone {
  position: relative; flex: 0 1 auto; min-height: 0;
  height: min(740px, 100%); aspect-ratio: 9 / 18.6; max-width: 100%;
  background: #17111f; border-radius: 42px; padding: 9px; box-shadow: var(--shadow-lg);
}
#customizeFrame { width: 100%; height: 100%; border: 0; border-radius: 33px; background: #fff; display: block; transition: opacity 0.25s ease; }
#customizeFrame.loading { opacity: 0.35; }
.phone-loading {
  position: absolute; inset: 9px; border-radius: 33px; display: none; place-items: center; pointer-events: none;
}
#customizeFrame.loading + .phone-loading { display: grid; }
.phone-loading .spinner { width: 30px; height: 30px; border-width: 3px; }

/* ---------- form pieces (also used by the admin's lovearea form) ---------- */
.section-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  margin-bottom: 10px; overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.section-card:not(.collapsed) { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.section-header {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 14px 16px; font: 700 14.5px/1.3 var(--font); color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.sec-num {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--tint); color: var(--primary-dark);
  font-size: 12.5px; font-weight: 800;
}
.sec-num svg { width: 14px; height: 14px; }
.section-card.done .sec-num { background: #e6f7ed; color: #15803d; }
.sec-title { flex: 1; min-width: 0; }
.sec-title::first-letter { text-transform: uppercase; }
.sec-meta { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.chevron { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.section-card.collapsed .chevron { transform: rotate(-90deg); }
.section-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.25s ease; }
.section-body > .inner { overflow: hidden; min-height: 0; padding: 2px 16px 16px; transition: padding 0.25s ease, visibility 0s; }
.section-card.collapsed .section-body { grid-template-rows: 0fr; }
/* a closed section takes no space, and its fields can't be tapped or tabbed into */
.section-card.collapsed .section-body > .inner { padding-top: 0; padding-bottom: 0; visibility: hidden; transition: padding 0.25s ease, visibility 0s 0.25s; }
.sec-next { margin-top: 2px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input[type="text"], .field input[type="number"], .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font: 500 15px/1.45 var(--font); color: var(--ink); background: #fbf9ff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}
.checkbox-field { display: flex; align-items: center; gap: 10px; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.checkbox-field label { margin: 0; }

.asset-field {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: #fbf9ff;
}
.asset-preview {
  width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: var(--tint); border: 1px solid var(--line);
}
div.asset-preview { display: grid; place-items: center; color: #b3a6d6; }
div.asset-preview svg { width: 24px; height: 24px; }
.asset-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.photo-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line-strong);
  font: 700 13px/1.2 var(--font); color: var(--primary-dark); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-btn svg { width: 15px; height: 15px; }
.photo-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-btn:focus-within { outline: 3px solid rgba(124, 58, 237, 0.45); outline-offset: 2px; }
@media (hover: hover) { .photo-btn:hover { border-color: var(--primary); } }
.upload-status { font-size: 12px; color: var(--muted); }
.upload-status.ok { color: #15803d; }
.upload-status.err { color: #dc2626; }

.array-item { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: #fff; }
.array-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.array-item-head span { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.array-item .remove-item {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 4px 6px; border-radius: 8px;
  font: 600 12px var(--font); color: var(--muted); cursor: pointer;
}
.array-item .remove-item:hover { color: #dc2626; background: #fef2f2; }
.add-item-btn {
  width: 100%; padding: 11px; border: 1.5px dashed var(--line-strong); border-radius: 12px;
  background: #fbf9ff; font: 700 13px var(--font); color: var(--primary-dark); cursor: pointer;
}
.add-item-btn:hover { background: var(--tint); }

/* ---------- "your page is ready" ---------- */
#successOverlay {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px 16px;
  background: rgba(28, 20, 48, 0.6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: overlayFadeIn 0.25s ease both;
}
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardPopIn { from { opacity: 0; transform: scale(0.94) translateY(12px); } to { opacity: 1; transform: none; } }
#successCard {
  position: relative; width: 100%; max-width: 420px; text-align: center;
  margin: auto; /* centred when there's room, scrollable from the top when there isn't */
  background: #fff; border-radius: 26px; padding: 28px 24px 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3);
  animation: cardPopIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.success-emoji {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px;
  display: grid; place-items: center; font-size: 30px; background: var(--tint);
}
#successCard h2 { margin: 0 0 6px; font-size: 23px; font-weight: 800; letter-spacing: -0.03em; }
.success-main > p { margin: 0; color: var(--muted); font-size: 14px; }
#shareLinkRow {
  display: flex; align-items: center; gap: 6px; margin: 18px 0 12px;
  background: var(--tint); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px;
}
#shareLinkInput {
  flex: 1; min-width: 0; border: 0; background: none; padding: 6px 0;
  font: 600 13.5px var(--font); color: var(--ink); text-overflow: ellipsis;
}
#shareLinkInput:focus { outline: none; }
#copyLinkBtn { flex-shrink: 0; }
#copyLinkBtn.copied { background: #e6f7ed; border-color: #b7e4c7; color: #15803d; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-grid .btn { padding: 13px 12px; }
.share-grid .btn.whatsapp { background: #128c4b; color: #fff; box-shadow: 0 6px 16px rgba(18, 140, 75, 0.28); }
.share-grid .btn.instagram { background: linear-gradient(120deg, #d62976 0%, #962fbf 60%, #4f5bd5 100%); color: #fff; box-shadow: 0 6px 16px rgba(150, 47, 191, 0.28); }
.share-grid .btn.whatsapp svg, .share-grid .btn.instagram svg { width: 18px; height: 18px; }
/* with no system share sheet to offer, "Open my page" takes the whole row */
#nativeShareBtn[hidden] + #openLinkBtn { grid-column: 1 / -1; }
.lbl-long { display: none; }
.share-hint { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: #15803d; }
.qr-caption { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.qr-details { margin-top: 14px; }
.qr-details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--primary-dark); list-style: none; }
.qr-details summary::-webkit-details-marker { display: none; }
#qrFrame {
  width: 172px; height: 172px; margin: 14px auto 2px; padding: 10px; border-radius: 20px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md);
}
#qrImage { width: 100%; height: 100%; border-radius: 10px; }
.success-foot { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
#closeSuccessBtn { border: 0; background: none; padding: 4px; font: 700 13px var(--font); color: var(--primary-dark); cursor: pointer; }
#closeSuccessBtn:hover { text-decoration: underline; }
#igCredit { font-size: 12px; color: var(--muted); text-decoration: none; }
#igCredit:hover { color: var(--primary-dark); text-decoration: underline; }
/* On a computer: a wide card, words and buttons on the left, the QR code
   always showing on the right (the quickest way to get the link onto a phone). */
@media (min-width: 761px) {
  #successOverlay { padding: 28px; }
  #successCard {
    max-width: 780px; text-align: left; padding: 36px 36px 22px;
    display: grid; grid-template-columns: minmax(0, 1fr) 236px; column-gap: 34px; align-items: center;
  }
  .success-emoji { margin: 0 0 16px; }
  #successCard h2 { font-size: 28px; }
  .success-main > p { font-size: 15px; }
  #shareLinkRow { margin: 20px 0 12px; }
  .lbl-long { display: inline; }
  /* a computer's own share sheet adds nothing the buttons here don't */
  #nativeShareBtn { display: none !important; }
  #openLinkBtn { grid-column: 1 / -1; }
  .qr-details {
    grid-column: 2; grid-row: 1; margin: 0; text-align: center;
    background: var(--tint); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px 18px;
  }
  .qr-details summary { display: none; }
  #qrFrame { width: 196px; height: 196px; margin: 0 auto; box-shadow: none; }
  .qr-caption { margin-top: 12px; font-size: 13px; }
  .success-foot { grid-column: 1 / -1; justify-content: space-between; margin-top: 24px; }
}
.burst-heart { position: fixed; top: 42%; z-index: 51; pointer-events: none; color: var(--pink); animation: heartBurst 1.1s ease-out forwards; }
@keyframes heartBurst {
  0% { transform: translate(0, 0) rotate(0deg) scale(0.4); opacity: 1; }
  100% { transform: translate(var(--dx), -190px) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* ==========================================================
   Instagram / Facebook in-app browser prompt
   ========================================================== */
#browserPromptOverlay {
  position: fixed; inset: 0; background: rgba(28, 20, 48, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px;
  animation: overlayFadeIn 0.25s ease both;
}
#browserPromptCard {
  position: relative; overflow: hidden; width: 100%; max-width: 400px; text-align: center;
  background: #fff; border-radius: 24px; padding: 30px 24px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; gap: 10px;
  animation: cardPopIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
#browserPromptStripe { position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--grad); }
#browserPromptCard .eyebrow { margin: 8px 0 0; font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #be185d; }
#browserPromptCard h2 { margin: 0 0 4px; font-size: 23px; font-weight: 800; letter-spacing: -0.03em; }
#browserPromptCard .hint { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
#browserPromptButtons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.icon-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  height: 74px; background: #fff; border: 1px solid var(--line-strong); border-radius: 16px; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.icon-btn:active { transform: scale(0.97); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn svg.icon-chrome { width: 29px; height: 29px; }
.icon-btn span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.icon-btn-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; width: 100%; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 14px; cursor: pointer; font: 600 14px var(--font); color: var(--ink);
}
.icon-btn-row svg { width: 16px; height: 16px; flex-shrink: 0; }
.icon-btn-row:active { transform: scale(0.98); }
.icon-btn-row.primary { background: var(--grad-btn); border-color: transparent; color: #fff; margin-top: 4px; }

/* ==========================================================
   Smaller screens
   ========================================================== */
@media (max-width: 1100px) {
  body.cz { --side-w: 400px; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .hero .sub { margin: 0 auto; }
  .hero-cta, .hero-points { justify-content: center; }
  .hero-showcase { height: 300px; }
  .phone-card { width: 150px; border-width: 5px; border-radius: 24px; }
  .phone-card:nth-child(1) { transform: translate(-50%, -50%) translate(-104px, 20px) rotate(-9deg) scale(0.84); }
  .phone-card:nth-child(3) { transform: translate(-50%, -50%) translate(104px, 20px) rotate(9deg) scale(0.84); }

  /* customize: one thing at a time, switched from the top bar */
  .cz-steps { display: none; }
  .cz-tabs { display: inline-flex; }
  .cz-back span { display: none; }
  .cz-back { padding: 8px; }
  #customizeLayout { display: block; }
  #customizeSidebar { border-right: 0; padding: 18px 16px 130px; }
  .cz-footer { width: 100%; border-right: 0; padding: 20px 16px calc(12px + env(safe-area-inset-bottom)); }
  #customizePreviewPane { display: none; }
  body.cz-show-preview #customizeSidebar { display: none; }
  body.cz-show-preview #customizePreviewPane {
    display: flex; position: fixed; top: var(--cz-top); left: 0; right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom)); height: auto;
    padding: 8px 0 0; gap: 8px; justify-content: flex-start;
  }
  body.cz-show-preview .cz-footer { background: #fff; border-top: 1px solid var(--line); padding-top: 12px; }
  body.cz-show-preview .cz-footer-note { display: none; }
  .phone { flex: 1 1 auto; width: 100%; height: auto; aspect-ratio: auto; border-radius: 0; padding: 0; box-shadow: none; background: #fff; }
  #customizeFrame { border-radius: 0; }
  .phone-loading { inset: 0; border-radius: 0; }
  body.cz .ig-badge { display: none; }
  .auto-toggle { display: none; } /* nothing is being typed while the preview is showing */
  #previewHeaderBar { width: 100%; justify-content: space-between; flex-wrap: nowrap; padding: 0 12px; }
  .field input[type="text"], .field input[type="number"], .field textarea { font-size: 16px; } /* stops iOS zooming in on focus */
}

@media (max-width: 760px) {
  /* the header scrolls away so the chips alone stay pinned */
  .topbar { position: static; }
  .topbar-links { display: none; }
  .topbar-cta { margin-left: auto; }
  .filterbar { top: 0; }
  .browse { scroll-margin-top: 0; }
  .how { scroll-margin-top: 12px; }

  /* phone type sizes: everything in the hero a step smaller, so the
     headline is two lines and the stats line is one, down to a 320px screen */
  .brand { font-size: 15.5px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .hero { padding-top: 18px; }
  .live-stats { max-width: 100%; white-space: nowrap; font-size: 12px; gap: 7px; padding: 6px 12px 6px 10px; }
  #liveStatsText { overflow: hidden; text-overflow: ellipsis; }
  .live-stats-sep { margin: 0 5px; }
  .ls-long { display: none; }
  .ls-short { display: inline; }
  .hero .hero-title { font-size: min(7.8vw, 34px); margin: 14px 0 10px; }
  .hero .sub { font-size: 14.5px; max-width: 34ch; }
  .hero-cta { margin-top: 20px; }
  .btn.big { padding: 14px 24px; font-size: 15px; }
  .hero-points { margin-top: 16px; gap: 6px 10px; font-size: 11.5px; }
  .hero-points li { gap: 5px; }
  .hero-points svg { width: 13px; height: 13px; }
  .browse-head .browse-title { font-size: 22px; }
  .browse-head p { font-size: 13.5px; }
  .pill { padding: 8px 13px; font-size: 13px; }
  .faq { padding-bottom: 40px; }
  .faq-item summary { font-size: 14px; padding: 14px 42px 14px 15px; }
  .faq-item p { font-size: 13.5px; padding: 0 15px 14px; }

  .how-grid { gap: 8px; }
  .how-step { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 12px 8px; border-radius: 16px; }
  .how-num { width: 30px; height: 30px; border-radius: 10px; font-size: 13px; }
  .how-step h3 { font-size: 12.5px; margin: 0; line-height: 1.3; }
  .how-step p { display: none; }

  .browse-head { align-items: stretch; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .gallery, .skeleton-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gallery-wrap { padding-bottom: 84px; }
  .card { border-radius: 16px; }
  .card-body { padding: 10px 10px 11px; gap: 9px; }
  .card h3 { font-size: 13px; }
  .card-cat { font-size: 11.5px; }
  .card-actions { flex-direction: column; gap: 7px; }
  .card-actions .btn { padding: 11px 10px; font-size: 13px; }
  .featured-badge { top: 8px; left: 8px; font-size: 10px; padding: 4px 8px 4px 6px; }
  .ig-badge { padding: 6px 11px; font-size: 10.5px; bottom: max(10px, env(safe-area-inset-bottom)); right: 10px; }
}

@media (min-width: 540px) and (max-width: 760px) {
  .gallery, .skeleton-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 350px) {
  .live-stats { font-size: 11px; }
  .ls-love { display: none; }
  .how-step h3 { font-size: 11.5px; }
}

@media (max-width: 420px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-cta .btn.secondary { display: none; } /* the three steps sit right below anyway */
  .hero-showcase { height: 262px; }
  .phone-card { width: 132px; }
  .phone-card:nth-child(1) { transform: translate(-50%, -50%) translate(-88px, 18px) rotate(-9deg) scale(0.84); }
  .phone-card:nth-child(3) { transform: translate(-50%, -50%) translate(88px, 18px) rotate(9deg) scale(0.84); }
  .share-grid .btn { padding: 13px 8px; font-size: 13.5px; }
}

/* the song field on the customize form */
.audio-field { flex-direction: column; align-items: stretch; gap: 10px; }
.audio-preview { width: 100%; height: 40px; }
