/* DestinyAI — Page 1 Gallery */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b051d;
  --bg2: #12082a;
  --purple: #a855f7;
  --purple-deep: #7c3aed;
  --purple-glow: rgba(168, 85, 247, 0.55);
  --gold: #e9c46a;
  --text: #f5e6ff;
  --muted: rgba(245, 230, 255, 0.62);
  --card-border: rgba(192, 132, 252, 0.45);
  --font-serif: "Playfair Display", Georgia, serif;
  --font-magazine: "Libre Bodoni", "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --max-w: 430px;
  --header-h: 48px;
  --bottom-bar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

/* ── Cosmic background ── */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(168, 85, 247, 0.12), transparent 50%),
    linear-gradient(180deg, #0b051d 0%, #12082a 40%, #0a0618 100%);
}

.cosmos-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 45% 8%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 60% 42%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 75% 22%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 88% 55%, rgba(233,196,106,0.5), transparent),
    radial-gradient(1px 1px at 15% 72%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 92% 88%, rgba(255,255,255,0.45), transparent);
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.cosmos-nebula {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ccircle cx='30' cy='40' r='1' fill='%23fff' opacity='.3'/%3E%3Ccircle cx='120' cy='80' r='.8' fill='%23fff' opacity='.2'/%3E%3C/svg%3E") repeat;
}

.cosmos-cloud {
  position: absolute;
  width: 120px;
  height: 80px;
  opacity: 0.08;
  background: radial-gradient(ellipse, #c084fc, transparent 70%);
  filter: blur(20px);
}

.cosmos-cloud--l { left: -20px; top: 55%; }
.cosmos-cloud--r { right: -20px; top: 62%; }

/* ── Page shell ── */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px 16px;
  min-height: 100dvh;
}

.page--home {
  display: block;
  height: 100dvh;
  height: 100svh;
  min-height: 100dvh;
  max-height: 100dvh;
  max-height: 100svh;
  padding: 0;
  overflow: hidden;
}

.home-main {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  padding: calc(4px + var(--safe-top)) 16px calc(8px + var(--safe-bottom));
  overflow: hidden;
}

.page--home .site-header--home {
  flex-shrink: 0;
  min-height: 34px;
  padding: 4px 0 2px;
  justify-content: center;
}

.page--home .hero {
  flex-shrink: 0;
  padding: 8px 0 6px;
}

.page--home .hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: var(--font-magazine);
  font-size: clamp(1.42rem, 5.6vw, 1.88rem);
  margin-bottom: 5px;
  color: #fff;
  -webkit-text-stroke: 0.35px #9333ea;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #7c3aed,
    1px -1px 0 #7c3aed,
    -1px 1px 0 #db2777,
    1px 1px 0 #db2777;
}

.hero-title-top {
  display: block;
  font-size: 0.62em;
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  margin-bottom: 8px;
}

.hero-title-bottom {
  display: block;
  font-size: 1.05em;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.page--home .hero-sub-row {
  max-width: 320px;
  gap: 8px;
}

.hero-gem {
  flex-shrink: 0;
  font-size: 0.5rem;
  color: #f472b6;
  line-height: 1;
  opacity: 0.9;
}

.page--home .hero-sub {
  font-size: 0.72rem;
  max-width: none;
  flex: 1;
  line-height: 1.4;
  color: #fbcfe8;
  font-style: italic;
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: 0 0 18px rgba(244, 114, 182, 0.35);
}

.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin: 0 auto;
}

.home-brand-name {
  font-family: var(--font-magazine);
  font-size: 1.18rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.08em;
  color: #fff;
  -webkit-text-stroke: 0.55px #9333ea;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #7c3aed,
    1px -1px 0 #7c3aed,
    -1px 1px 0 #db2777,
    1px 1px 0 #db2777;
}

.home-brand-pill {
  display: inline-block;
  padding: 0;
  font-family: var(--font-magazine);
  font-size: 0.78rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: none;
  border: none;
  box-shadow: none;
  -webkit-text-stroke: 0.45px #db2777;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #9333ea,
    1px 1px 0 #e11d48;
}

body.lang-zh .home-brand-name {
  font-family: "Noto Serif SC", var(--font-serif);
  letter-spacing: 0.12em;
}

body.lang-zh .home-brand-pill {
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 0.6rem;
}

.page--home .gallery {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
  gap: 4px;
  margin-bottom: 2px;
  width: 100%;
}

.page--home .match-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: unset;
  justify-self: stretch;
  align-self: stretch;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(192, 132, 252, 0.55),
    0 0 18px rgba(168, 85, 247, 0.22);
}

.page--home .card-label,
.page--home .card-user-name,
.page--home .card-role {
  position: static;
}

.page--home .card-overlay--bottom {
  padding: 16px 9px 8px;
}

.page--home .card-label,
.page--home .card-role {
  font-size: 0.74rem;
  letter-spacing: 0.03em;
}

.page--home .card-user-name {
  font-size: 0.68rem;
  margin-top: 5px;
}

.page--home .card-nickname {
  display: none;
}

.home-bottom {
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-height: 0;
  padding-top: 0;
  margin-top: 0;
}

.page--home .wisdom {
  flex-shrink: 0;
  padding: 4px 8px 4px;
}

.page--home .wisdom-yin {
  margin-bottom: 4px;
}

.page--home .wisdom-yin svg {
  width: 44px;
  height: 44px;
}

.page--home .wisdom-title {
  font-size: 0.92rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.page--home .wisdom-desc {
  font-size: 0.68rem;
  line-height: 1.45;
  max-width: 300px;
}

.page--home .process {
  flex-shrink: 0;
  padding: 4px 0 6px;
}

.page--home .process-icon {
  width: 42px;
  height: 42px;
  font-size: 1.05rem;
}

.page--home .process-step {
  position: relative;
  gap: 4px;
}

.process-num {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(calc(-50% + 15px));
  z-index: 2;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.52rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(245, 230, 255, 0.95);
  background: rgba(124, 58, 237, 0.55);
  border: 1px solid rgba(192, 132, 252, 0.45);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.35);
}

.page--home .process-step span:not(.process-num) {
  font-size: 0.58rem;
}

.page--home .process-arrow {
  padding-top: 12px;
  font-size: 0.85rem;
}

.page--home .home-cta-wrap {
  flex-shrink: 0;
  padding: 2px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.page--home .cta-glow {
  padding: 13px 18px;
  font-size: 0.82rem;
  width: 100%;
}

.cta-arrow {
  font-size: 1rem;
  opacity: 0.9;
  margin-left: 2px;
}

.home-privacy {
  font-size: 0.58rem;
  color: rgba(245, 230, 255, 0.38);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── Mobile H5: short screens keep CTA visible ── */
@media (max-width: 639px) {
  .page--home {
    height: 100svh;
    max-height: 100svh;
  }

  .page--home .gallery {
    gap: 2px;
    margin-bottom: 0;
  }

  .home-bottom {
    gap: 4px;
  }

  .page--home .wisdom-title {
    font-size: 0.82rem;
  }

  .page--home .wisdom-yin svg {
    width: 40px;
    height: 40px;
  }

  .page--home .process-icon {
    width: 38px;
    height: 38px;
  }

  .page--home .cta-glow {
    padding: 11px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 639px) and (max-height: 740px) {
  .page--home .hero {
    padding: 0 0 4px;
  }

  .page--home .hero-title {
    font-size: 1.15rem;
    margin-bottom: 3px;
  }

  .page--home .hero-sub {
    font-size: 0.58rem;
  }

  .page--home .wisdom-desc {
    display: none;
  }

  .page--home .wisdom-yin svg {
    width: 28px;
    height: 28px;
  }

  .page--home .wisdom {
    padding: 2px 8px;
  }

  .page--home .wisdom-title {
    font-size: 0.76rem;
    margin-bottom: 2px;
  }

  .page--home .process {
    padding: 2px 0 4px;
  }

  .page--home .process-icon {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }

  .page--home .process-step span:not(.process-num) {
    font-size: 0.46rem;
  }

  .page--home .process-arrow {
    padding-top: 8px;
  }

  .home-privacy {
    display: none;
  }

  .page--home .cta-glow {
    padding: 10px 14px;
    font-size: 0.78rem;
  }
}

.page--flow {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100svh;
  padding: 0;
  overflow: hidden;
}

.page--active { display: flex; }
.page--home.page--active {
  display: flex;
  flex-direction: column;
}

.page--home.page--active .home-main {
  flex: 1;
  min-height: 0;
  height: auto;
}
.page:not(.page--active):not(.hidden) { display: none; }

.flow-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px 12px;
  padding-top: calc(var(--safe-top) + 4px);
}

/* Fit-to-viewport flow pages: no page scroll on mobile, centered on desktop */
.flow-body--fit {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  padding-top: 2px;
  padding-bottom: calc(6px + var(--safe-bottom));
}

.flow-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.flow-screen-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.flow-body--fit .flow-actions {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 10px;
}

.page--flow-center .flow-body--center {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px calc(12px + var(--safe-bottom));
  min-height: 0;
}

.page--flow-center .flow-body--fit {
  overflow: hidden;
  padding: 0 16px calc(6px + var(--safe-bottom));
  padding-top: 2px;
}

.page--flow-center .flow-body--center > section {
  width: 100%;
  margin: auto 0;
  flex-shrink: 0;
}

.flow-bottom-bar {
  flex-shrink: 0;
  padding: 8px 16px calc(8px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent 0%, rgba(11, 5, 29, 0.92) 24%, var(--bg) 100%);
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.flow-actions {
  margin-top: 18px;
}

.flow-actions .cta-glow--bar {
  max-width: none;
  width: 100%;
}

.page--flow-no-header > .flow-body--fit {
  padding-top: calc(8px + var(--safe-top));
}

.flow-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 0 4px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.flow-back-btn:hover,
.flow-back-btn:active {
  color: rgba(244, 114, 182, 0.92);
}

.flow-back-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.page--flow > .site-header {
  flex-shrink: 0;
  padding-left: 16px;
  padding-right: 16px;
  padding-top: calc(var(--safe-top) + 4px);
}

.page--flow .flow-body--fit {
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: calc(6px + var(--safe-bottom));
}

.page--flow .flow-body:not(.flow-body--fit) {
  padding-bottom: calc(12px + var(--safe-bottom));
}

.site-header--home {
  padding: 6px 0 4px;
  min-height: 40px;
  justify-content: center;
}

.site-header--home .home-brand {
  position: static;
  transform: none;
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 4px;
  min-height: var(--header-h);
  position: relative;
  flex-shrink: 0;
}

.site-header--compact {
  padding: 4px 0;
  min-height: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.logo-icon { width: 30px; height: 30px; }

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-ai {
  color: var(--purple);
  font-style: italic;
}

.menu-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  z-index: 2;
}

.menu-btn span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px 0;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 10px 0 12px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 5.8vw, 1.85rem);
  font-weight: 600;
  line-height: 1.22;
  background: linear-gradient(180deg, #fff 0%, #e9d5ff 45%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 24px rgba(168, 85, 247, 0.25));
}

.hero-sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.hero-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192, 132, 252, 0.45), transparent);
  min-width: 24px;
}

.hero-sub {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
  flex-shrink: 0;
  max-width: 200px;
}

/* ── Gallery grid ── */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.match-card {
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: linear-gradient(145deg, #3d1535 0%, #1a0f2e 100%);
  box-shadow:
    0 0 0 1px rgba(225, 29, 72, 0.35),
    0 0 0 3px rgba(124, 58, 237, 0.22),
    0 0 24px rgba(168, 85, 247, 0.18),
    inset 0 0 30px rgba(124, 58, 237, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.match-card .portrait.img-fallback {
  opacity: 0.85;
}

.match-card:hover,
.match-card:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(192, 132, 252, 0.7),
    0 8px 32px rgba(168, 85, 247, 0.35);
  outline: none;
}

.match-card:active {
  transform: scale(0.98);
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.15), transparent 70%);
}

.match-card:hover::before,
.match-card:focus-visible::before {
  opacity: 1;
}

.match-card img.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}

.match-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 55%,
    rgba(11, 5, 29, 0.18) 75%,
    rgba(11, 5, 29, 0.62) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
  text-align: center;
}

.card-overlay--top {
  top: 0;
  padding: 8px 8px 14px;
  background: linear-gradient(to bottom, rgba(11, 5, 29, 0.92) 0%, rgba(11, 5, 29, 0.55) 48%, transparent 100%);
}

.card-overlay--bottom {
  bottom: 0;
  padding: 14px 10px 8px;
  background: linear-gradient(to top, rgba(26, 8, 24, 0.94) 0%, rgba(74, 16, 56, 0.55) 52%, transparent 100%);
}

.card-wanted-banner {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 0 6px 12px;
  pointer-events: none;
  background: none;
  border: none;
  box-shadow: none;
}

.card-wanted-title {
  display: block;
  padding: 0 4px 4px;
  font-family: var(--font-magazine);
  font-weight: 700;
  font-style: italic;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.15;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 0.65px #9333ea;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #7c3aed,
    1px -1px 0 #7c3aed,
    -1px 1px 0 #db2777,
    1px 1px 0 #db2777;
}

.card-wanted-sub {
  display: block;
  padding: 0 4px 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 0.5px #db2777;
  paint-order: stroke fill;
  text-shadow: -1px 0 0 #9333ea, 1px 0 0 #e11d48;
}

body.lang-zh .card-wanted-title {
  font-family: "Noto Serif SC", var(--font-serif);
  letter-spacing: 0.1em;
  text-transform: none;
  font-size: 0.74rem;
}

.page--home .card-wanted-title {
  font-size: 0.88rem;
}

.page--home .card-wanted-sub {
  font-size: 0.76rem;
}

.card-label,
.card-role {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  font-family: var(--font-magazine);
  font-style: italic;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.25;
  -webkit-text-stroke: 0.85px #000;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000,
    1px 0 0 #000,
    -1px 0 0 #000;
  z-index: 2;
}

.card-label {
  display: block;
  color: #ffebc8;
}

.card-role {
  bottom: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 0;
  color: #fff;
}

.card-user-name {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #fff;
  -webkit-text-stroke: 0.45px #000;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
  margin-top: 4px;
}

.card-role-icon { color: var(--gold); font-size: 0.52rem; }

.card-nickname {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(11, 5, 29, 0.72);
  border: 1px solid rgba(192, 132, 252, 0.45);
  z-index: 2;
  text-shadow: none;
}

/* ── Wisdom section ── */
.wisdom {
  text-align: center;
  padding: 10px 8px 12px;
  position: relative;
}

.wisdom-yin {
  margin-bottom: 8px;
  filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
}

.wisdom-title {
  font-family: var(--font-magazine);
  font-size: clamp(0.98rem, 3.9vw, 1.15rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 6px;
}

.wisdom-desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto;
}

/* ── Process flow ── */
.process {
  padding: 6px 0 14px;
  overflow: hidden;
}

.process-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
  max-width: 100%;
}

.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.process-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.process-step span {
  font-size: 0.58rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  padding: 0 2px;
}

.process-arrow {
  color: rgba(192, 132, 252, 0.45);
  font-size: 0.95rem;
  padding-top: 14px;
  flex-shrink: 0;
  width: 10px;
  text-align: center;
}

/* ── CTA ── */
.home-cta-wrap {
  padding: 4px 4px 8px;
  display: flex;
  justify-content: center;
}

.cta-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 50%, #6d28d9 100%);
  box-shadow:
    0 0 24px var(--purple-glow),
    0 0 48px rgba(124, 58, 237, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.cta-glow--bar {
  max-width: none;
  width: 100%;
  padding: 15px 20px;
  font-size: 0.92rem;
}

.cta-glow--sheet {
  margin-top: 4px;
}

.cta-glow:hover {
  transform: scale(1.02);
  box-shadow:
    0 0 40px rgba(168, 85, 247, 0.65),
    0 0 80px rgba(124, 58, 237, 0.35);
}

.cta-glow:active { transform: scale(0.98); }

.cta-glow--full { max-width: none; width: 100%; margin-top: 8px; }

.cta-star {
  font-size: 0.75rem;
  opacity: 0.9;
  color: var(--gold);
}

/* ── Popup (mobile bottom sheet) ── */
.popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 15, 0.75);
  backdrop-filter: blur(6px);
}

.popup-sheet {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  max-height: min(92dvh, 92svh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #252530 0%, #1a1a24 100%);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(12px + var(--safe-bottom));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
  animation: sheetUp 0.32s ease;
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: none; }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 4px auto 8px;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  touch-action: manipulation;
}

.popup-header {
  text-align: center;
  margin-bottom: 10px;
  padding-top: 0;
  padding-right: 32px;
}

.popup-header--compact .popup-title {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.popup-title {
  font-family: var(--font-magazine);
  font-size: 1.32rem;
  font-weight: 700;
  font-style: italic;
  text-align: center;
  margin-bottom: 4px;
  color: #fff;
  text-shadow: 0 0 20px rgba(244, 114, 182, 0.3);
}

.popup-sub {
  font-size: 0.78rem;
  color: #f9a8d4;
  font-style: italic;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.popup-carousel--compact {
  margin: 0 0 4px;
}

.popup-carousel--compact .carousel-slide {
  flex: 0 0 38%;
  min-width: 38%;
  aspect-ratio: 3 / 4;
  max-height: 28vh;
}

.popup-carousel--compact .carousel-slide.is-center {
  flex: 0 0 42%;
  min-width: 42%;
}

.carousel-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 32%;
  min-width: 32%;
  scroll-snap-align: center;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0.75;
  transform: scale(0.92);
  transition: opacity 0.25s, transform 0.25s;
}

.carousel-slide.is-center {
  opacity: 1;
  transform: scale(1);
  flex: 0 0 36%;
  min-width: 36%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  pointer-events: none;
}

.carousel-photo-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: inherit;
  overflow: hidden;
}

.carousel-photo-btn:focus-visible {
  outline: 2px solid rgba(244, 114, 182, 0.85);
  outline-offset: 2px;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(48px + var(--safe-top)) 10px 16px;
  box-sizing: border-box;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(4, 2, 12, 0.96);
  cursor: zoom-out;
}

.photo-lightbox-close {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.photo-lightbox-img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(94vw, 720px);
  max-width: 94vw;
  max-height: min(84dvh, 960px);
  min-width: 88vw;
  min-height: min(76vw, 640px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(192, 132, 252, 0.4),
    0 28px 72px rgba(0, 0, 0, 0.72);
  animation: photo-lightbox-in 0.22s ease;
}

@media (min-width: 640px) {
  .photo-lightbox {
    padding: 24px;
  }

  .photo-lightbox-img {
    width: min(480px, 72vw);
    min-width: 400px;
    min-height: 560px;
  }
}

@keyframes photo-lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.popup-body-grid {
  display: block;
  margin-bottom: 10px;
}

.attr-list--compact {
  gap: 8px;
}

.attr-list--compact .attr-row {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.attr-row--personality .attr-value {
  font-size: 0.74rem;
  line-height: 1.55;
  font-weight: 400;
  color: rgba(245, 230, 255, 0.82);
}

.attr-row--personality {
  align-items: flex-start;
}

.attr-row--personality .attr-icon {
  margin-top: 3px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--purple);
  width: 16px;
  border-radius: 3px;
}

.matched-card--inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 12px;
  text-align: left;
}

.matched-card--inline .matched-card-title {
  margin-bottom: 0;
}

.matched-card--inline .matched-card-name {
  margin-bottom: 0;
}

.matched-card--inline .matched-card-private {
  margin-left: auto;
  font-size: 0.62rem;
}

.attr-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attr-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.attr-icon {
  font-size: 0.85rem;
  opacity: 0.55;
  width: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.attr-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.attr-label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.4);
}

.attr-value {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
}

.matched-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.matched-card-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 8px;
}

.matched-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.matched-card-private {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.lock-icon { font-size: 0.6rem; }

.popup-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 16px;
}

.info-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
}

.popup-info p {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.45;
}

/* ── Mobile menu ── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 5, 29, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.mobile-menu a {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  text-decoration: none;
}

.menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
}

/* ── Stub pages ── */
.stub-page {
  padding: 48px 16px;
  text-align: center;
}

.stub-page h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.stub-note { color: var(--muted); font-size: 0.9rem; }

/* ── Generate form ── */
.form-page {
  padding: 4px 0 0;
}

.form-title {
  font-family: var(--font-magazine);
  font-size: 1.42rem;
  font-weight: 700;
  font-style: italic;
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.25;
}

.form-sub {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.4;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.birth-seg-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow: visible;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(0, 0, 0, 0.25);
}

.birth-seg {
  width: 2.75rem;
  min-height: 44px;
  flex-shrink: 0;
  padding: 8px 4px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.birth-seg::-webkit-outer-spin-button,
.birth-seg::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.birth-seg-year {
  width: 4.2rem;
}

.birth-seg-min {
  width: 2.75rem;
}

.birth-seg::placeholder {
  color: rgba(245, 230, 255, 0.28);
  font-weight: 400;
}

.birth-seg:focus {
  outline: none;
  color: #fff8ef;
  background: rgba(168, 85, 247, 0.12);
}

.birth-seg-wrap:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.birth-seg-sep {
  flex-shrink: 0;
  color: rgba(245, 230, 255, 0.45);
  font-size: 0.85rem;
  user-select: none;
}

.birth-seg-sep--break {
  flex-basis: 100%;
  width: 0;
  height: 0;
  overflow: hidden;
}

.birth-datetime-preview {
  margin: 6px 2px 0;
  min-height: 1.2em;
  font-size: 0.78rem;
  color: rgba(245, 230, 255, 0.55);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.birth-datetime-preview:not(:empty) {
  color: rgba(233, 196, 106, 0.85);
}

@media (min-width: 420px) {
  .birth-seg-sep--break {
    flex-basis: auto;
    width: 6px;
    height: auto;
    overflow: visible;
  }
}

.geo-field-wrap {
  position: relative;
}

.geo-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(18, 8, 42, 0.98);
  border: 1px solid rgba(192, 132, 252, 0.45);
  border-radius: 10px;
  z-index: 120;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.geo-suggest.show {
  display: block;
}

.geo-suggest-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.geo-suggest-item:last-child {
  border-bottom: none;
}

.geo-suggest-item:hover,
.geo-suggest-item.active {
  background: rgba(168, 85, 247, 0.18);
}

.geo-suggest-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.field-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(245, 230, 255, 0.55);
  margin-bottom: 5px;
  margin-top: 10px;
}

.field-hint {
  font-size: 0.58rem;
  color: rgba(245, 230, 255, 0.38);
  margin: -2px 0 6px;
  line-height: 1.35;
}

.field-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
}

.field-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.field-input--invalid {
  border-color: rgba(248, 113, 113, 0.75);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.18);
}

.field-hint--error {
  color: rgba(252, 165, 165, 0.92);
}

.gender-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-opt {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.gender-opt.active {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.25);
  color: var(--text);
}

.gender-opt {
  padding: 11px;
  border-radius: 10px;
  font-size: 0.88rem;
  touch-action: manipulation;
}

/* ── Prose body (About You + Reading) ── */
.prose-body {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(245, 230, 255, 0.94);
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}

.prose-body--direction {
  color: rgba(233, 196, 106, 0.92);
  margin-bottom: 0;
}

.prose-body--caption {
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
  margin-top: 6px;
}

.direction-map-block {
  width: 100%;
  max-width: min(640px, 100%);
  margin: 0 auto 10px;
}

.direction-map-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(233, 196, 106, 0.9);
}

.direction-map-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.direction-map-wrap.direction-map--empty {
  display: none;
}

.direction-map-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 240px;
  max-height: 320px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.direction-map-canvas--dragging {
  cursor: grabbing;
}

.direction-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.direction-map-label text {
  font-family: "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  font-weight: 600;
  fill: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.direction-map-label--major text {
  font-weight: 500;
  fill: rgba(255, 255, 255, 0.62);
}

.direction-map-label--answer text {
  fill: #f4d06f;
}

.direction-map-label {
  transition: opacity 0.15s ease;
}

.direction-map-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 6, 24, 0.72);
  border: 1px solid rgba(192, 132, 252, 0.35);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s ease;
  z-index: 2;
}

.direction-map-hint--hide {
  opacity: 0;
}

.direction-map-reset {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: rgba(10, 6, 24, 0.78);
  color: rgba(233, 196, 106, 0.95);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.direction-map-reset:hover {
  background: rgba(30, 18, 69, 0.9);
  border-color: rgba(244, 208, 111, 0.5);
}

.direction-map-legend {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(192, 132, 252, 0.2);
}

.direction-map-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.direction-map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.direction-map-legend-item--you .direction-map-legend-dot {
  background: #a855f7;
  color: #a855f7;
}

.direction-map-legend-item--match .direction-map-legend-dot {
  background: #f4d06f;
  color: #f4d06f;
}

.direction-map-legend-item--axis .direction-map-legend-dot {
  background: transparent;
  border: 2px dashed rgba(192, 132, 252, 0.8);
  color: rgba(192, 132, 252, 0.8);
}

.direction-map-legend-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.direction-map-legend-text strong {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 230, 255, 0.55);
}

.direction-map-legend-text span {
  color: rgba(245, 230, 255, 0.95);
  font-weight: 500;
}

.direction-map-legend-text em {
  font-style: normal;
  font-size: 0.72rem;
  color: rgba(233, 196, 106, 0.85);
}

/* Mobile: one-screen flow pages, top-aligned, compact */
@media (max-width: 767px) {
  .flow-body--fit .flow-screen-main {
    justify-content: flex-start;
  }

  .flow-body--fit .about-head-name,
  .flow-body--fit .reading-head-name,
  .flow-body--fit .form-title {
    font-size: 1.18rem;
    margin-bottom: 8px;
  }

  .flow-body--fit .about-head-sub,
  .flow-body--fit .reading-head-sub {
    font-size: 1.02rem;
    margin-bottom: 8px;
  }

  .flow-body--fit .result-head {
    font-size: 1.1rem;
    margin-bottom: 2px;
  }

  .flow-body--fit .prose-body {
    font-size: clamp(0.8rem, 3.4vw, 0.92rem);
    line-height: 1.46;
    margin-bottom: 8px;
  }

  .flow-body--fit .prose-body--direction {
    font-size: clamp(0.78rem, 3.2vw, 0.88rem);
    line-height: 1.44;
  }

  .flow-body--fit .prose-body--caption {
    display: none;
  }

  .flow-body--fit .direction-map-block {
    margin-bottom: 6px;
  }

  .flow-body--fit .direction-map-canvas {
    min-height: 210px;
    max-height: 260px;
  }

  .flow-body--fit .direction-map-legend {
    padding: 8px 10px 10px;
    gap: 6px;
  }

  .flow-body--fit .direction-map-legend-item {
    font-size: 0.72rem;
  }

  .flow-body--fit .reading-page .prose-body:first-of-type {
    font-size: clamp(0.76rem, 3.2vw, 0.88rem);
    line-height: 1.42;
    margin-bottom: 6px;
    max-height: 4.2em;
    overflow: hidden;
  }

  .flow-body--fit .form-sub {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }

  .flow-body--fit .field-label {
    margin-top: 6px;
    margin-bottom: 3px;
    font-size: 0.72rem;
  }

  .flow-body--fit .field-hint {
    margin-bottom: 4px;
    font-size: 0.65rem;
  }

  .flow-body--fit .birth-seg {
    min-height: 38px;
    padding: 6px 4px;
  }

  .flow-body--fit .birth-seg-wrap {
    padding: 6px 8px;
    gap: 4px;
  }

  .flow-body--fit .field-input {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .flow-body--fit .gender-row {
    gap: 8px;
  }

  .flow-body--fit .flow-actions {
    padding-top: 6px;
  }

  .flow-body--fit .flow-actions .cta-glow--bar {
    padding: 12px 14px;
    font-size: 0.82rem;
  }

  .flow-body--fit .result-portrait-box {
    max-width: 180px;
    max-height: 24vh;
    margin-left: auto;
    margin-right: auto;
  }

  .flow-body--fit .result-archetype {
    margin-bottom: 4px;
    font-size: 0.72rem;
  }

  .flow-body--fit .result-lock {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .flow-body--fit .result-vibe {
    margin-bottom: 0;
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .flow-body--fit .tag-list--result {
    display: none;
  }
}

@media (max-height: 680px) and (max-width: 767px) {
  .flow-body--fit .prose-body {
    font-size: 0.76rem;
    line-height: 1.42;
  }

  .flow-body--fit .about-head-name,
  .flow-body--fit .reading-head-name,
  .flow-body--fit .form-title {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }

  .flow-body--fit .about-head-sub,
  .flow-body--fit .reading-head-sub {
    font-size: 0.92rem;
    margin-bottom: 6px;
  }

  .flow-body--fit .result-portrait-box {
    max-height: 20vh;
    max-width: 150px;
  }
}

/* ── About You page ── */
.about-page {
  padding: 4px 0 8px;
}

.about-head-block,
.reading-head-block {
  text-align: center;
  margin-bottom: 12px;
}

.about-head-name,
.reading-head-name {
  font-family: var(--font-magazine);
  font-size: clamp(1.48rem, 5.8vw, 1.78rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.2;
  margin: 0 0 6px;
  color: #fff;
}

.about-head-sub,
.reading-head-sub {
  font-family: var(--font-magazine);
  font-size: clamp(1.02rem, 4.1vw, 1.26rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.35;
  margin: 0;
  color: rgba(245, 230, 255, 0.92);
}

.about-bazi-chart {
  margin: 0 auto 16px;
  max-width: 100%;
  width: 100%;
}

.about-bazi-chart .bazi-chart {
  padding: 16px 10px 14px;
  border-radius: 16px;
}

.about-bazi-chart .bazi-chart-title {
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.about-bazi-chart .bazi-chart-row {
  gap: 8px;
}

.about-bazi-chart .bazi-pillar {
  padding: 10px 3px 12px;
  gap: 6px;
  border-radius: 12px;
}

.about-bazi-chart .bazi-pillar-en {
  font-size: 0.58rem;
}

.about-bazi-chart .bazi-pillar-zh {
  font-size: 0.7rem;
}

.about-bazi-chart .bazi-cell-en {
  font-size: 0.52rem;
}

.about-bazi-chart .bazi-cell-en--bottom {
  font-size: 0.56rem;
  min-height: 1.65em;
}

.about-bazi-chart .bazi-char {
  font-size: clamp(1.5rem, 6.5vw, 2rem);
}

.about-bazi-chart .bazi-chart-meta {
  margin-top: 12px;
  padding-top: 10px;
  font-size: 0.7rem;
}

/* ── Reading page ── */
.reading-page {
  padding: 4px 0 8px;
}

.bazi-chart {
  padding: 12px 10px 10px;
  border-radius: 14px;
  background: rgba(76, 29, 149, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.35);
  box-shadow: inset 0 0 24px rgba(124, 58, 237, 0.08);
}

.bazi-chart-title {
  font-family: var(--font-magazine);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(244, 114, 182, 0.95);
  margin-bottom: 10px;
}

.bazi-chart-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.bazi-pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px 8px;
  border-radius: 10px;
  background: rgba(11, 5, 29, 0.35);
}

.bazi-pillar--day {
  background: rgba(157, 23, 77, 0.18);
  box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.35);
}

.bazi-pillar-en {
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 230, 255, 0.55);
  line-height: 1.2;
  text-align: center;
}

.bazi-pillar-zh {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(251, 207, 232, 0.9);
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.bazi-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.bazi-cell-en {
  font-size: 0.46rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(245, 230, 255, 0.42);
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  word-break: break-word;
}

.bazi-cell-en--bottom {
  font-size: 0.48rem;
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(196, 181, 253, 0.75);
  min-height: 1.5em;
}

.bazi-char {
  font-family: "Noto Serif SC", "Songti SC", "KaiTi", serif;
  font-size: clamp(1.15rem, 4.6vw, 1.38rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
}

.bazi-pillar--day .bazi-char {
  color: #fce7f3;
  text-shadow: 0 0 18px rgba(244, 114, 182, 0.45);
}

.bazi-chart-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(192, 132, 252, 0.22);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.62rem;
  line-height: 1.4;
  text-align: center;
  color: rgba(245, 230, 255, 0.72);
}

.bazi-chart-day {
  color: rgba(251, 207, 232, 0.88);
}

body.lang-zh .bazi-chart-title {
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: none;
}

body.lang-zh .bazi-pillar-en--top {
  font-size: 0.5rem;
}

.reading-short {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.45;
}

.reading-block {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(192, 132, 252, 0.25);
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
}

.reading-text,
.reading-hint {
  font-size: 0.8rem;
  line-height: 1.5;
}

.reading-direction {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.tag-list--compact {
  margin: 10px 0 8px;
  gap: 6px;
}

.tag-list--compact li {
  padding: 5px 10px;
  font-size: 0.68rem;
}

/* ── Result page ── */
.result-page {
  padding: 4px 0 8px;
  text-align: center;
}

.result-head {
  font-family: var(--font-magazine);
  font-size: 1.28rem;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 2px;
}

.result-archetype {
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.result-portrait-box {
  max-width: 260px;
  max-height: 42vh;
  aspect-ratio: 3 / 4;
}

.result-lock {
  margin-bottom: 12px;
  font-size: 0.72rem;
}

.result-unlock-panel {
  margin: 0 auto 12px;
  max-width: 320px;
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.result-unlock-hint {
  font-size: 0.72rem;
  color: rgba(245, 230, 255, 0.82);
  margin-bottom: 10px;
  line-height: 1.4;
}

.result-password-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.result-password-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: rgba(11, 5, 29, 0.72);
  color: #fff;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.result-password-input:focus {
  outline: none;
  border-color: rgba(233, 196, 106, 0.75);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.result-password-error {
  margin-top: 8px;
  font-size: 0.68rem;
  color: #ffb4b4;
}

.result-download {
  margin: 0 auto 14px;
  max-width: 340px;
  padding: 12px 10px 10px;
  border-radius: 14px;
  background: rgba(233, 196, 106, 0.08);
  border: 1px solid rgba(233, 196, 106, 0.28);
}

.result-poster-brief {
  font-family: var(--font-magazine);
  font-size: 0.96rem;
  font-weight: 700;
  font-style: italic;
  color: #ffebc8;
  margin-bottom: 6px;
  text-shadow: -1px -1px 0 #000, 1px 1px 0 #000;
}

body.lang-zh .result-poster-brief {
  font-family: "Noto Serif SC", var(--font-serif);
}

.result-poster-tagline {
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 6px;
}

.result-download-hint {
  font-size: 0.64rem;
  color: rgba(245, 230, 255, 0.55);
  margin-bottom: 10px;
}

.result-download-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-glow--compact {
  padding: 11px 14px;
  font-size: 0.76rem;
  width: 100%;
}

.cta-glow--poster {
  background: linear-gradient(135deg, rgba(233, 196, 106, 0.22), rgba(168, 85, 247, 0.35));
}

.result-vibe {
  font-size: 0.75rem;
  margin-bottom: 8px;
}

/* ── Loading ── */
.flow-loading {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 5, 29, 0.88);
  backdrop-filter: blur(6px);
}

.flow-loading-inner {
  text-align: center;
}

.flow-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border: 3px solid rgba(192, 132, 252, 0.25);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.flow-loading-inner p {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Toast ── */
.toast-msg {
  position: fixed;
  bottom: calc(72px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 400;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(30, 15, 45, 0.95);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: var(--text);
  font-size: 0.82rem;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.reading-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.reading-text,
.reading-hint {
  color: rgba(245, 230, 255, 0.88);
}

.reading-direction {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--gold);
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: rgba(245, 230, 255, 0.9);
}

.tag-list--result {
  justify-content: center;
}

.result-portraits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto 10px;
  max-width: 340px;
}

.result-portraits--duo {
  max-width: 100%;
}

.result-portrait-box--duo {
  max-width: 280px;
  margin: 0 auto;
}

.dream-lover-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 0 10px;
}

.dream-lover-switch.hidden {
  display: none !important;
}

.dream-lover-tab {
  flex: 1;
  max-width: 160px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(192, 132, 252, 0.45);
  background: rgba(11, 5, 29, 0.45);
  color: rgba(245, 230, 255, 0.72);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.dream-lover-tab.active {
  color: #fff;
  border-color: rgba(244, 114, 182, 0.85);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(219, 39, 119, 0.45));
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.28);
}

.result-portrait-box {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin: 0 auto 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.result-wanted-banner {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  padding: 0 8px 14px;
  background: none;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.result-wanted-title {
  display: block;
  padding: 0 6px 5px;
  font-family: var(--font-magazine);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(0.92rem, 3.8vw, 1.12rem);
  letter-spacing: 0.04em;
  text-transform: none;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 0.65px #9333ea;
  paint-order: stroke fill;
  text-shadow:
    -1px -1px 0 #7c3aed,
    1px -1px 0 #7c3aed,
    -1px 1px 0 #db2777,
    1px 1px 0 #db2777;
}

.result-wanted-sub {
  display: block;
  padding: 0 6px 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(0.72rem, 3.2vw, 0.88rem);
  line-height: 1.25;
  text-align: center;
  color: #fff;
  -webkit-text-stroke: 0.5px #db2777;
  paint-order: stroke fill;
  text-shadow: -1px 0 0 #9333ea, 1px 0 0 #e11d48;
}

body.lang-zh .result-wanted-title {
  font-family: "Noto Serif SC", var(--font-serif);
  text-transform: none;
  letter-spacing: 0.08em;
}

.result-portrait-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: blur(5px) saturate(0.92);
  transform: scale(1.02);
  transition: filter 0.45s ease, transform 0.45s ease;
}

.result-portrait-canvas.is-unlocked,
.result-portrait-box.is-unlocked .result-portrait-canvas {
  filter: none;
  transform: none;
}

.result-portrait-lock.hidden {
  display: none;
}

.result-portrait-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 5, 29, 0.18);
  pointer-events: none;
}

.result-portrait-lock-icon {
  font-size: clamp(2rem, 10vw, 2.75rem);
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
  opacity: 0.95;
}

.popup-carousel {
  position: relative;
  margin: 0 -4px 6px;
}

@media (min-width: 480px) {
  .popup {
    align-items: center;
    padding: 20px;
  }

  .popup-sheet {
    border-radius: 20px;
    max-width: 440px;
    max-height: 90dvh;
    padding: 20px 22px 24px;
  }

  .sheet-handle { display: none; }

  .popup-title,
  .popup-sub { text-align: center; }

  .popup-header { padding-right: 0; }

  .popup-carousel--compact .carousel-slide {
    max-height: 320px;
  }
}

/* ── Tablet ── */
@media (min-width: 640px) {
  :root {
    --max-w: 620px;
  }

  .home-main,
  .flow-body {
    padding-left: 24px;
    padding-right: 24px;
  }

  .gallery {
    gap: 14px;
  }

  .match-card {
    border-radius: 16px;
  }

  .hero-title {
    font-size: 1.95rem;
  }

  .page--home .hero-title {
    font-size: clamp(1.35rem, 4vw, 1.65rem);
  }

  .hero-sub {
    font-size: 0.75rem;
    max-width: 280px;
  }

  .page--home .hero-sub {
    font-size: 0.65rem;
    max-width: 220px;
  }

  .process-icon {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
  }

  .page--home .process-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .process-step span {
    font-size: 0.65rem;
  }

  .cta-glow {
    max-width: 420px;
  }
}

/* ── Desktop ── */
@media (min-width: 900px) {
  :root {
    --max-w: 960px;
  }

  .home-main {
    padding: calc(16px + var(--safe-top)) 32px calc(32px + var(--safe-bottom));
  }

  .page--home .home-main {
    height: 100%;
    padding: calc(8px + var(--safe-top)) 32px calc(10px + var(--safe-bottom));
    overflow: hidden;
  }

  .site-header--home {
    min-height: 52px;
    padding: 8px 0 12px;
  }

  .page--home .site-header--home {
    min-height: 44px;
    padding: 4px 0 6px;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

  .logo-text {
    font-size: 1.35rem;
  }

  .hero {
    padding: 16px 0 20px;
  }

  .page--home .hero {
    padding: 6px 0 10px;
  }

  .hero-title {
    font-size: clamp(2rem, 3.2vw, 2.5rem);
    margin-bottom: 14px;
  }

  .page--home .hero-title {
    font-size: clamp(1.5rem, 2.4vw, 1.85rem);
    margin-bottom: 8px;
  }

  .hero-sub-row {
    max-width: 480px;
  }

  .hero-sub {
    font-size: 0.82rem;
    max-width: 320px;
  }

  .page--home .hero-sub {
    font-size: 0.68rem;
    max-width: 260px;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
  }

  .page--home .gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 2px;
  }

  .page--home .match-card {
    border-radius: 14px;
    max-height: none;
    aspect-ratio: unset;
  }

  .home-bottom {
    gap: 6px;
    padding-top: 0;
  }

  .match-card {
    border-radius: 18px;
    max-height: 340px;
    aspect-ratio: 3 / 4;
  }

  .card-label,
  .card-role {
    font-size: 0.72rem;
  }

  .page--home .card-label,
  .page--home .card-role {
    font-size: 0.82rem;
  }

  .page--home .card-user-name {
    font-size: 0.74rem;
  }

  .wisdom {
    padding: 16px 24px 18px;
  }

  .page--home .wisdom {
    padding: 10px 24px 8px;
  }

  .page--home .wisdom-yin {
    margin-bottom: 10px;
  }

  .page--home .wisdom-yin svg {
    width: 56px;
    height: 56px;
  }

  .wisdom-title {
    font-size: 1.25rem;
  }

  .page--home .wisdom-title {
    font-size: 1.15rem;
    margin-bottom: 8px;
  }

  .wisdom-desc {
    font-size: 0.82rem;
    max-width: 520px;
  }

  .page--home .wisdom-desc {
    font-size: 0.78rem;
    max-width: 480px;
  }

  .process {
    padding: 12px 0 24px;
  }

  .page--home .process {
    padding: 8px 0 10px;
  }

  .process-track {
    max-width: 720px;
    margin: 0 auto;
    gap: 8px;
  }

  .process-icon {
    width: 58px;
    height: 58px;
    font-size: 1.4rem;
  }

  .page--home .process-icon {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
  }

  .process-step span {
    font-size: 0.72rem;
  }

  .page--home .process-step span:not(.process-num) {
    font-size: 0.68rem;
  }

  .home-cta-wrap {
    padding: 8px 0 16px;
  }

  .page--home .home-cta-wrap {
    padding: 8px 0 0;
  }

  .cta-glow {
    max-width: 480px;
    padding: 16px 32px;
    font-size: 1rem;
  }

  .page--home .cta-glow {
    max-width: 520px;
    padding: 15px 36px;
    font-size: 0.95rem;
  }

  /* Flow pages: vertically centered on desktop, fixed viewport */
  .page--flow {
    height: 100dvh;
    height: 100svh;
    max-width: var(--max-w);
    margin: 0 auto;
    overflow: hidden;
  }

  .page--flow .flow-body,
  .page--flow .flow-body--fit {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-bottom: calc(20px + var(--safe-bottom));
  }

  .page--flow .flow-screen {
    flex: 0 1 auto;
    max-height: calc(100dvh - 52px - var(--safe-top) - var(--safe-bottom));
    justify-content: center;
  }

  .page--flow .flow-screen-main {
    flex: 0 1 auto;
    overflow: visible;
  }

  .page--flow-center .flow-body--fit > .flow-screen,
  .page--flow .flow-body--fit > .flow-screen {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .page--flow-center .flow-body--center > section {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .about-head-name,
  .reading-head-name {
    font-size: 1.65rem;
    margin-bottom: 8px;
  }

  .about-head-sub,
  .reading-head-sub {
    font-size: 1.22rem;
  }

  .about-bazi-chart .bazi-char {
    font-size: 2.05rem;
  }

  .about-bazi-chart .bazi-chart {
    padding: 18px 14px 16px;
  }

  .prose-body {
    font-size: 1.12rem;
    line-height: 1.72;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  .prose-body--direction {
    font-size: 1.08rem;
  }

  .prose-body--caption {
    font-size: 0.92rem;
  }

  .direction-map-canvas {
    min-height: 320px;
    max-height: 420px;
  }

  .direction-map-legend-item {
    font-size: 0.88rem;
  }

  .result-portrait-box {
    max-width: 320px;
    max-height: none;
  }

  .cosmos-cloud--l {
    left: 8%;
    top: 45%;
    width: 200px;
    height: 140px;
    opacity: 0.12;
  }

  .cosmos-cloud--r {
    right: 8%;
    top: 50%;
    width: 200px;
    height: 140px;
    opacity: 0.12;
  }
}

/* ── Short viewport: keep CTA visible (desktop/tablet) ── */
@media (max-height: 820px) and (min-width: 640px) {
  .page--home .hero {
    padding: 2px 0 4px;
  }

  .page--home .hero-title {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .page--home .wisdom-desc {
    display: none;
  }

  .page--home .wisdom-yin svg {
    width: 32px;
    height: 32px;
  }

  .page--home .wisdom-title {
    font-size: 0.82rem;
  }

  .page--home .process-icon {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .page--home .process-step span:not(.process-num) {
    font-size: 0.52rem;
  }

  .home-privacy {
    display: none;
  }
}

/* ── Large desktop ── */
@media (min-width: 1200px) {
  :root {
    --max-w: 1080px;
  }

  .page--home .gallery {
    gap: 6px;
  }

  .gallery {
    gap: 20px;
  }

  .match-card {
    max-height: 360px;
  }
}
