/* ==========================================================================
   SantaPet Forest Editorial Theme
   Palette: Deep Forest Green (#163826) · Warm Ivory (#faf7f2)
            Crimson (#c0392b) · Antique Gold (#c99b49) · Soft Sand (#efe9de)
   ========================================================================== */

:root,
body:has(#app),
.studio-home {
  --paper: #faf7f2;
  --surface: #f3ede2;
  --sand: #efe9de;
  --card: #ffffff;
  --forest: #163826;
  --forest-light: #204c35;
  --ink: #1a2d22;
  --muted: #646a64;
  --line: #e9e2d6;
  --wine: #c0392b;
  --wine-hover: #a72f22;
  --gold: #c99b49;
  --gold-soft: #f5ebd6;
  --sage: #e5efe7;
  --font-serif: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", serif;
  --font-body: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html:lang(zh) body:has(#app) {
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

body:has(#app) {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

/* Editorial Serif Headings */
body:has(#app) :is(h1, h2, .brand-title, .footer-wordmark, .credit-packs .price) {
  font-family: var(--font-serif);
  color: var(--forest);
  font-weight: 700;
  letter-spacing: -0.02em;
}

body:has(#app) h3 {
  font-family: var(--font-serif);
  color: var(--forest);
  font-weight: 700;
}

body:has(#app) .primary,
body:has(#app) .secondary {
  font-family: var(--font-body);
  font-weight: 600;
}

/* Anchor scroll offset for sticky header */
#templates,
#how,
#about,
#faq,
#support,
.portrait-delivery,
.site-faq,
.site-support,
.closing-create {
  scroll-margin-top: 96px;
}

/* Top announcement notice */
body:has(#app) .notice {
  background: var(--surface);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  padding: 7px 16px;
}

/* ==========================================================================
   Full-Width Translucent Ivory Sticky Header (Single-Row, Zero Text Wrapping)
   ========================================================================== */
body:has(#app) header,
.studio-home header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px max(24px, calc((100% - 1220px) / 2));
  min-height: 72px;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: nowrap;
}

body:has(#app) .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--forest);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-badge .paw {
  margin: 0;
  width: 18px;
  height: 18px;
  color: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-title {
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
}

body:has(#app) header nav,
.studio-home header nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 500;
  color: #36433b;
  flex-shrink: 0;
}

body:has(#app) header nav a,
body:has(#app) header nav button,
body:has(#app) header nav select {
  white-space: nowrap;
  flex-shrink: 0;
}

body:has(#app) header nav a:hover {
  color: var(--forest);
  text-decoration: none;
}

body:has(#app) #language,
.studio-home #language {
  background: var(--sand);
  border: 1px solid #e2d9ca;
  border-radius: 9999px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
}

/* Account dropdown in Forest theme */
.account-trigger {
  color: var(--forest);
  font-weight: 600;
  white-space: nowrap;
}

.account-dropdown {
  background: #ffffff;
  border-color: var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 36px -16px rgba(22, 56, 38, 0.25);
}

/* ==========================================================================
   Pill Buttons
   ========================================================================== */
body:has(#app) .primary,
.studio-home .primary {
  background: var(--wine);
  color: #ffffff;
  border: 1px solid var(--wine);
  border-radius: 9999px;
  padding: 13px 26px;
  min-height: 48px;
  font-size: 14px;
  box-shadow: 0 8px 20px -10px rgba(192, 57, 43, 0.65);
}

body:has(#app) .primary:hover:not(:disabled),
.studio-home .primary:hover:not(:disabled) {
  background: var(--wine-hover);
  border-color: var(--wine-hover);
  box-shadow: 0 12px 24px -10px rgba(192, 57, 43, 0.72);
}

body:has(#app) .secondary,
.studio-home .secondary,
.studio-home .home-watch {
  background: var(--sand);
  color: var(--forest);
  border: 1px solid #e2d9ca;
  border-radius: 9999px;
  padding: 12px 22px;
  min-height: 48px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

body:has(#app) .secondary:hover:not(:disabled),
.studio-home .secondary:hover:not(:disabled),
.studio-home .home-watch:hover {
  background: #e6dfd1;
  color: var(--forest);
}

body:has(#app) :is(a, button, input, select, summary):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ==========================================================================
   Hero Section — Forest Editorial Layout
   ========================================================================== */
.studio-home main {
  max-width: 1220px;
  padding: 0 24px 72px;
}

.studio-home .home-hero.hero {
  position: relative;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 48px;
  min-height: 580px;
  padding: 44px 0 64px;
  align-items: center;
}

.studio-home .home-hero.hero::before {
  content: "";
  position: absolute;
  inset: -40px calc((100% - 100vw) / 2) 0 calc((100% - 100vw) / 2);
  background:
    radial-gradient(540px 520px at 76% 48%, rgba(235, 218, 192, 0.52), transparent 72%),
    radial-gradient(420px 340px at 14% 20%, rgba(245, 235, 214, 0.55), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.studio-home .home-depth {
  display: none;
}

.hero-pill-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--gold-soft);
  border: 1px solid #ead9b7;
  color: #6e5221;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-pill-eyebrow .star {
  color: var(--gold);
}

.studio-home .home-hero.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--forest);
  max-width: 560px;
}

html:lang(zh) .studio-home .home-hero.hero h1 {
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.22;
  letter-spacing: 0;
}

.studio-home .home-hero h1 span {
  color: var(--wine);
  font-style: italic;
  font-weight: 600;
}

.studio-home .home-hero.hero .home-copy > p {
  font-size: 16px;
  line-height: 1.7;
  color: #5b635e;
  max-width: 460px;
  margin: 20px 0 28px;
}

.hero-trust-row {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 12px;
  color: #525d56;
}

.hero-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hero-trust-row b {
  color: var(--forest);
  font-weight: 700;
}

/* Right Hero Framed Portrait + Floating Merge Pill */
.hero-visual-wrap {
  position: relative;
  padding-left: 24px;
}

.hero-merge-pill {
  position: absolute;
  top: -18px;
  left: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 32px -14px rgba(22, 56, 38, 0.25);
}

.hero-merge-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-merge-thumb .crop {
  width: 38px;
  height: 38px;
  aspect-ratio: 1;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(22, 56, 38, 0.16);
}

.hero-merge-thumb small {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.hero-merge-plus {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.hero-merge-copy {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  line-height: 1.3;
}

.hero-merge-copy strong {
  display: block;
  font-size: 11px;
  color: var(--wine);
  white-space: nowrap;
}

.hero-merge-copy span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.studio-home .portrait-demo {
  max-width: 560px;
  border: 0;
  border-radius: 28px;
  background: #ffffff;
  padding: 12px 12px 6px;
  box-shadow: 0 28px 60px -28px rgba(22, 56, 38, 0.26), 0 4px 16px -4px rgba(22, 56, 38, 0.08);
}

.studio-home .portrait-stage {
  height: 410px;
  border-radius: 20px;
  background: #ebe3d6;
}

.studio-home .portrait-output figcaption {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0;
  padding: 46px 18px 16px;
  background: linear-gradient(to top, rgba(16, 38, 26, 0.88) 0%, rgba(16, 38, 26, 0.42) 58%, transparent 100%);
  color: #ffffff;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.studio-home .portrait-input {
  bottom: 72px;
  width: 78px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.studio-home .input-person {
  right: 106px;
}

.studio-home .input-pet {
  right: 16px;
}

.studio-home .demo-controls {
  padding: 12px 8px 6px;
  min-height: 52px;
}

.studio-home .demo-toggle {
  background: var(--forest);
  border-color: var(--forest);
  border-radius: 9999px;
  width: 38px;
  height: 38px;
}

.studio-home .demo-toggle:hover {
  background: var(--forest-light);
}

.studio-home .demo-progress {
  margin: 0 8px;
}

.studio-home .demo-progress span {
  background: var(--forest);
}

.studio-home .home-hero.hero .demo-disclosure {
  margin: 8px 8px 6px;
}

/* ==========================================================================
   Template Gallery
   ========================================================================== */
#templates .section-head {
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.studio-home .tabs {
  border-block: 0;
  padding: 6px;
  background: var(--sand);
  border-radius: 9999px;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin-bottom: 0;
}

.quick-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.quick-pills::-webkit-scrollbar {
  display: none;
}

.quick-pill {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 9999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.quick-pill:hover {
  border-color: var(--forest);
}

.quick-pill.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #ffffff;
}

.studio-home .tabs button {
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #4f5852;
  white-space: nowrap;
}

.studio-home .tabs button.active {
  background: var(--forest);
  color: #ffffff;
}

.studio-home .tabs button.active small {
  color: #cddbd2;
}

.studio-home .template,
body:has(#app) .template {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 7px 14px;
  box-shadow: 0 10px 24px -20px rgba(22, 56, 38, 0.25);
}

.studio-home .template .crop,
body:has(#app) .template .crop {
  border-radius: 14px;
  background: #ede6da;
}

.studio-home .template:hover,
body:has(#app) .template:hover {
  border-color: #d0c3ae;
  box-shadow: 0 20px 36px -22px rgba(22, 56, 38, 0.24);
}

.badge {
  background: rgba(250, 247, 242, 0.94);
  color: var(--forest);
  border-radius: 9999px;
  padding: 4px 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.round {
  border-color: var(--line);
  color: var(--forest);
}

.library-toolbar input,
.library-toolbar select {
  border-radius: 12px;
  border-color: var(--line);
  background: #ffffff;
}

.library-toolbar .secondary {
  min-height: 42px;
  padding: 8px 16px;
}

/* ==========================================================================
   How It Works & Delivery Band
   ========================================================================== */
.how.how-illustrated {
  background: var(--surface);
  border-block: 1px solid var(--line);
  margin-inline: calc((100% - 100vw) / 2);
  padding: 56px max(24px, calc((100% - 1220px) / 2));
}

.how-step {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.how-step-title > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--forest);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   Pricing Section — Deep Forest Green Centerpiece Card
   ========================================================================== */
.credit-packs {
  align-items: center;
  gap: 24px;
  margin: 40px 0 24px;
}

.credit-packs .purchase {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 14px 34px -22px rgba(22, 56, 38, 0.18);
}

.credit-packs .pack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.credit-packs .pack-pill {
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.credit-packs .pack-save {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--sage);
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
}

.credit-packs .price {
  font-family: var(--font-serif);
  color: var(--forest);
  font-size: 44px;
  font-variant-numeric: tabular-nums;
}

body:has(#app) .credit-packs .purchase:not(.is-featured) .primary {
  background: var(--sand);
  color: var(--forest);
  border-color: #e2d9ca;
  box-shadow: none;
}

body:has(#app) .credit-packs .purchase:not(.is-featured) .primary:hover:not(:disabled) {
  background: #e6dfd1;
}

/* Featured 10-credit Deep Forest Green Card */
.credit-packs .purchase.is-featured {
  background: var(--forest);
  color: #ffffff;
  border-color: var(--forest);
  padding: 36px 28px 30px;
  box-shadow: 0 26px 52px -20px rgba(22, 56, 38, 0.45);
}

.credit-packs .pack-popular-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 5px 16px;
  border-radius: 9999px;
  background: var(--gold);
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px -6px rgba(22, 56, 38, 0.45);
}

body:has(#app) .credit-packs .purchase.is-featured h2,
body:has(#app) .credit-packs .purchase.is-featured .price,
body:has(#app) .credit-packs .purchase.is-featured .pack-count {
  color: #ffffff;
}

.credit-packs .purchase.is-featured .pack-pill {
  background: rgba(255, 255, 255, 0.14);
  color: #dce8df;
}

.credit-packs .purchase.is-featured .pack-description,
.credit-packs .purchase.is-featured .pack-unit,
.credit-packs .purchase.is-featured .price small {
  color: #c2d4c8;
}

.credit-packs .purchase.is-featured .pack-save {
  background: rgba(201, 155, 73, 0.22);
  color: #f4d38a;
}

.credit-packs .purchase.is-featured ul {
  border-top-color: rgba(255, 255, 255, 0.16);
  color: #eaf2ec;
}

.credit-packs .purchase.is-featured ul li::marker {
  color: var(--gold);
}

/* ==========================================================================
   Creation Studio: Upload Drag & Drop, Darkroom Waiting, Framed Reveal
   ========================================================================== */
.upload-card {
  border-radius: 22px;
  border-color: var(--line);
  box-shadow: 0 12px 28px -24px rgba(22, 56, 38, 0.25);
}

.upload-label {
  border: 1.5px dashed #cfc4b2;
  background: var(--paper);
  border-radius: 16px;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.upload-label.is-dragover {
  border-color: var(--forest);
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(22, 56, 38, 0.12);
}

.upload-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 14px;
}

.upload-secondary-actions .sample-action {
  margin-top: 0;
}

.inline-packs {
  margin: 14px 0 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.inline-packs-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 10px;
}

.inline-packs-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

body:has(#app) .inline-pack-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border-radius: 16px;
  padding: 10px 16px;
  min-height: 52px;
  text-align: left;
}

body:has(#app) .inline-pack-btn strong {
  font-size: 13.5px;
  line-height: 1.25;
}

body:has(#app) .inline-pack-btn small {
  font-size: 11px;
  opacity: 0.88;
  color: inherit;
}

.consent-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 16px 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.6;
}

.consent-box input {
  margin-top: 3px;
  accent-color: var(--forest);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Darkroom Waiting Card */
.waiting-card {
  max-width: 820px;
  margin: 28px auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: center;
  box-shadow: 0 22px 48px -28px rgba(22, 56, 38, 0.26);
}

.waiting-preview {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}

.waiting-preview .crop {
  filter: blur(4px) saturate(0.85);
  transform: scale(1.04);
}

.darkroom-veil {
  position: absolute;
  inset: 0;
  height: 55%;
  background: linear-gradient(180deg, transparent, rgba(250, 247, 242, 0.58) 50%, rgba(201, 155, 73, 0.18) 54%, transparent);
  animation: sp-scan 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sp-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(220%); }
}

.waiting-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 9999px;
  background: var(--gold-soft);
  color: #6e5221;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.waiting-card .status-box {
  margin: 16px 0 20px;
  padding: 16px 18px;
  background: var(--paper);
  border-radius: 16px;
}

.waiting-card .status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 8px;
}

.waiting-card .spinner {
  border-color: #dcd3c4;
  border-top-color: var(--forest);
  margin: 0;
  flex-shrink: 0;
}

/* Framed Result Reveal */
.result-frame {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 14px;
  box-shadow: 0 24px 48px -26px rgba(22, 56, 38, 0.3);
}

.result-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  animation: sp-reveal 580ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes sp-reveal {
  from { filter: blur(10px) saturate(0.8); opacity: 0.5; transform: scale(1.02); }
  to { filter: blur(0) saturate(1); opacity: 1; transform: scale(1); }
}

.result-aside {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  display: grid;
  gap: 14px;
}

.result-aside .primary,
.result-aside .secondary {
  width: 100%;
}

/* Mobile Sticky CTA Bar (hidden on desktop) */
.mobile-sticky-cta {
  display: none;
}

/* ==========================================================================
   Full-Bleed Deep Forest Green Footer
   ========================================================================== */
footer.site-footer {
  max-width: none;
  width: 100%;
  background: var(--forest);
  color: #d4e0d8;
  border-top: 0;
  padding: 56px max(24px, calc((100% - 1220px) / 2)) 32px;
}

body:has(#app) footer.site-footer .footer-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 22px;
}

footer.site-footer .footer-paw-badge {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

footer.site-footer .footer-brand p {
  color: #acc0b2;
}

body:has(#app) footer.site-footer .footer-top h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

footer.site-footer .footer-top a {
  color: #dce7df;
}

footer.site-footer .footer-top a:hover {
  color: #ffffff;
}

footer.site-footer .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.14);
  color: #95ab9c;
}

/* ==========================================================================
   Responsive Breakpoints: Tablet / Narrow Desktop / Mobile 390px
   ========================================================================== */
@media (max-width: 1080px) {
  body:has(#app) header,
  .studio-home header {
    padding: 12px 20px;
    border-radius: 0;
    width: 100%;
    margin: 0;
    top: 0;
  }

  body:has(#app) header .menu-toggle,
  .studio-home header .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid #dfd6c8;
    background: #ffffff;
    color: var(--forest);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
  }

  body:has(#app) header nav,
  .studio-home header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    padding: 14px 20px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    background: #faf7f2;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 16px 32px -16px rgba(22, 56, 38, 0.2);
    max-height: calc(100dvh - 76px);
    overflow: auto;
  }

  body:has(#app) header nav.open,
  .studio-home header nav.open {
    display: flex;
  }

  body:has(#app) header nav a,
  .studio-home header nav a {
    padding: 10px 12px;
    border-radius: 12px;
  }

  body:has(#app) header nav a:hover,
  .studio-home header nav a:hover {
    background: var(--sand);
  }
}

@media (max-width: 900px) {
  .studio-home .home-hero.hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 0 44px;
    min-height: 0;
    max-width: 560px;
    margin-inline: auto;
  }

  .hero-visual-wrap {
    padding-left: 0;
  }

  .hero-merge-pill {
    position: relative;
    top: auto;
    left: auto;
    margin: 0 auto 14px;
    display: flex;
    width: fit-content;
    max-width: 100%;
  }

  .credit-packs {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-inline: auto;
    gap: 28px;
  }

  .credit-packs .purchase.is-featured {
    order: -1;
    margin-top: 8px;
  }

  .waiting-card {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 22px;
  }
}

@media (max-width: 700px) {
  #templates,
  #how,
  #about,
  #faq,
  #support,
  .portrait-delivery,
  .site-faq,
  .site-support,
  .closing-create {
    scroll-margin-top: 82px;
  }

  .studio-home main {
    padding: 0 18px 56px;
  }

  .studio-home .home-hero.hero .home-copy {
    text-align: left;
  }

  .studio-home .home-hero.hero h1 {
    font-size: 38px;
    margin: 0;
  }

  html:lang(zh) .studio-home .home-hero.hero h1 {
    font-size: 34px;
  }

  .studio-home .home-hero.hero .home-copy > p {
    margin: 16px 0 22px;
    font-size: 15px;
    max-width: none;
  }

  .studio-home .home-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .studio-home .home-actions > * {
    width: 100%;
    justify-content: center;
  }

  .hero-trust-row {
    gap: 8px 14px;
  }

  .studio-home .portrait-stage {
    height: 320px;
  }

  .studio-home .portrait-input {
    width: 68px;
    bottom: 68px;
  }

  .studio-home .input-person {
    right: 92px;
  }

  .studio-home .tabs {
    width: 100%;
    justify-content: space-between;
  }

  .studio-home .tabs button {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    font-size: 12px;
  }

  .uploads {
    grid-template-columns: 1fr;
  }

  /* Sticky mobile bottom CTA on Create & Result screens */
  body.has-mobile-sticky main {
    padding-bottom: 96px;
  }

  .mobile-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(250, 247, 242, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -16px rgba(22, 56, 38, 0.22);
  }

  .mobile-sticky-cta .primary {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 13px;
    width: auto;
    margin: 0;
  }

  .mobile-sticky-cta .sticky-meta {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
  }

  .mobile-sticky-cta .sticky-meta strong {
    display: block;
    color: var(--forest);
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .darkroom-veil,
  .result-frame img {
    animation: none !important;
  }
}

/* In-app browser (TikTok / Instagram / WeChat) compatibility banner & inline hints */
.inapp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding: 10px 18px;
  background: #fff7e6;
  border-bottom: 1px solid #e6cfa3;
  color: #3d2e14;
  font-size: 13px;
  line-height: 1.5;
  flex-wrap: wrap;
}

.inapp-banner-text {
  margin: 0;
  flex: 1 1 240px;
}

.inapp-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.inapp-copy-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inapp-copy-btn {
  min-inline-size: 24px;
  min-block-size: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #b58c42;
  background: #fff;
  color: #3d2e14;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.inapp-copy-tip {
  font-size: 12px;
  color: var(--forest, #1f5e3b);
  min-height: 1em;
  opacity: 0;
  transition: opacity 0.15s;
}

.inapp-copy-btn[data-copied] + .inapp-copy-tip,
.inapp-copy-btn[data-failed] + .inapp-copy-tip {
  opacity: 1;
}

.inapp-copy-btn[data-failed] + .inapp-copy-tip {
  color: #a71d30;
}

.inapp-dismiss-btn {
  min-inline-size: 32px;
  min-block-size: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.inapp-inline-note {
  margin: 10px 0 14px;
  padding: 11px 14px;
  border-left: 3px solid #b58c42;
  background: #fff7e6;
  color: #3d2e14;
  font-size: 13px;
  line-height: 1.55;
  border-radius: 0 8px 8px 0;
  text-align: left;
}
