/* ============================================================
   RESET & BASE
   ============================================================ */
/* ==========================================================================
   1. CORE VARIABLES & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Default Dark Mode Colors */
  --bg-deep:     #060810;
  --bg-card:     #0C0F1A;
  --bg-surface:  #111420;
  --bg-glass:    rgba(255, 255, 255, 0.03);
  --bg-glass2:   rgba(255, 255, 255, 0.06);
  --border:      rgba(255, 255, 255, 0.07);
  --border2:     rgba(255, 255, 255, 0.13);

  --green:       #22C55E;
  --green-lt:    #4ADE80;
  --green-dk:    #16A34A;
  --green-glow:  rgba(34, 197, 94, 0.25);
  --teal:        #2ECFB0;
  --teal-lt:     #5EECD2;
  --violet:      #7B5CF5;
  --violet-lt:   #A88EFF;
  --rose:        #E85D7A;
  --sky:         #38B6FF;
  --amber:       #F59E0B;

  --gold:        #D4A843;
  --gold-lt:     #F0C96A;
  --gold-dk:     #9A7420;
  --glow-gold:   0 0 40px rgba(212, 168, 67, 0.3);
  --glow-green:  0 0 40px rgba(34, 197, 94, 0.25);
  --glow-vio:    0 0 40px rgba(123, 92, 245, 0.25);
  --glow-teal:   0 0 40px rgba(46, 207, 176, 0.25);

  --text-hi:     #F2EEE8;
  --text-md:     #9A9390;
  --text-lo:     #52504E;

  --font-disp:   'Syne', sans-serif;
  --font-body:   'DM Sans', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;

  /* Grid Texture opacity */
  --grid-line:   rgba(255, 255, 255, 0.012);
  --nav-bg:      rgba(12, 15, 26, 0.85);
  --bg-base:     var(--bg-deep);
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.32);
}

/* ==========================================================================
   2. LIGHT THEME OVERRIDES
   ========================================================================== */
[data-theme="light"] {
  --bg-deep:     #E8EEF4;
  --bg-card:     #FFFFFF;
  --bg-surface:  #F3F6FA;
  --bg-glass:    rgba(15, 23, 42, 0.04);
  --bg-glass2:   rgba(15, 23, 42, 0.08);
  --border:      rgba(15, 23, 42, 0.11);
  --border2:     rgba(15, 23, 42, 0.18);

  --text-hi:     #0F172A;
  --text-md:     #334155;
  --text-lo:     #64748B;

  --grid-line:   rgba(15, 23, 42, 0.05);
  --nav-bg:      rgba(255, 255, 255, 0.94);
  --bg-base:     var(--bg-deep);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 32px rgba(15, 23, 42, 0.08);

  /* Adjusted glows for light background contrast */
  --glow-gold:   0 10px 30px rgba(212, 168, 67, 0.15);
  --glow-green:  0 10px 30px rgba(34, 197, 94, 0.15);
  --glow-vio:    0 10px 30px rgba(123, 92, 245, 0.15);
  --glow-teal:   0 10px 30px rgba(46, 207, 176, 0.15);
}

html { 
  scroll-behavior: smooth; 
}

body {
  background: var(--bg-deep);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Texture Effects */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(34,197,94,0.045) 0%, transparent 58%),
    radial-gradient(ellipse 50% 40% at 92% 100%, rgba(46,207,176,0.03) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   3. NAVBAR STYLES
   ========================================================================== */
/* ==========================================
   FORCE NAVBAR MOBILE VISIBILITY OVERRIDE
   ========================================== */

/* Fix Navbar Flex Layout */
/* ==========================================================================
   RESET & MOBILE-PROOF NAVIGATION LAYOUT
   ========================================================================== */

/* Top Navbar Container */
.top-navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 60px !important;
  background: var(--nav-bg, rgba(12, 15, 26, 0.95)) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08)) !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 0 20px !important;
  z-index: 99999 !important;
}

.nav-logo {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  font-family: var(--font-disp, sans-serif) !important;
  font-weight: 750 !important;
  font-size: 1.28rem !important;
  letter-spacing: -0.02em !important;
  line-height: 1 !important;
  color: var(--text-hi, #fff) !important;
  white-space: nowrap !important;
  min-width: 0 !important;
  padding: 4px 2px !important;
  margin: 0 -2px !important;
  border-radius: 10px !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
  -webkit-tap-highlight-color: transparent;
}

.nav-logo:hover {
  opacity: 0.92 !important;
}

.nav-logo:active {
  transform: scale(0.98) !important;
}

.nav-logo-text span {
  color: var(--green, #22C55E) !important;
}

.nav-logo-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  color: var(--text-hi, #fff) !important;
  flex-shrink: 0 !important;
}

.nav-logo-icon svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.theme-toggle-btn svg {
  width: 16px !important;
  height: 16px !important;
}

.theme-toggle-btn .theme-icon-sun {
  display: none !important;
}

[data-theme="light"] .theme-toggle-btn .theme-icon-moon {
  display: none !important;
}

[data-theme="light"] .theme-toggle-btn .theme-icon-sun {
  display: block !important;
}

.profile-avatar-guest {
  background: var(--bg-glass2, rgba(255,255,255,0.06)) !important;
  color: var(--text-md, #9A9390) !important;
}

.profile-avatar-guest svg,
.profile-avatar svg {
  width: 13px !important;
  height: 13px !important;
  display: block !important;
}

.profile-avatar-img {
  object-fit: cover !important;
  background: none !important;
}

.nav-top-right {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-right: 0 !important;
  min-width: 0 !important;
}

/* Scan balance — same control height/icon size as theme toggle */
.coin-nav-balance {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  background: var(--bg-surface, #111420) !important;
  border: 1px solid var(--border, rgba(255,255,255,0.1)) !important;
  border-radius: 999px !important;
  font-family: var(--font-body, sans-serif) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-hi, #fff) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

.coin-nav-balance:hover {
  background: var(--bg-glass2, rgba(255,255,255,0.06)) !important;
  border-color: var(--border2, rgba(255,255,255,0.13)) !important;
}

.coin-nav-balance .coin-nav-icon {
  font-size: 0.9rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--green, #22C55E) !important;
}

.coin-nav-balance .coin-balance-value {
  color: var(--text-hi, #fff) !important;
  font-variant-numeric: tabular-nums !important;
}

.theme-toggle-btn {
  background: var(--bg-surface, #111420) !important;
  border: 1px solid var(--border, rgba(255,255,255,0.1)) !important;
  color: var(--text-hi, #fff) !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  padding: 0 !important;
  transition: background 0.2s ease, border-color 0.2s ease !important;
}

.theme-toggle-btn:hover {
  background: var(--bg-glass2, rgba(255,255,255,0.06)) !important;
  border-color: var(--border2, rgba(255,255,255,0.13)) !important;
}

.desktop-nav-links {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  min-width: 0 !important;
}

.desktop-nav-links::-webkit-scrollbar {
  display: none !important;
}

.mobile-bottom-nav {
  display: none !important;
}

/* ==========================================================================
   DESKTOP vs MOBILE BREAKPOINTS
   ========================================================================== */

@media (max-width: 768px) {
  /* Hide heavy desktop navigation buttons from top header */
  .desktop-nav-links {
    display: none !important;
  }

  .top-navbar {
    grid-template-columns: 1fr auto !important;
    gap: 10px !important;
    padding: 0 12px !important;
  }

  .profile-chip-name {
    display: none !important;
  }

  .profile-chip {
    padding: 0 !important;
    width: 34px !important;
    justify-content: center !important;
  }

  /* Show native-feel mobile bottom bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
    min-height: 64px !important;
    padding: 6px 2px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--nav-bg, rgba(12, 15, 26, 0.92)) !important;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08)) !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 0 !important;
    z-index: 99999 !important;
    backdrop-filter: blur(20px) saturate(1.35) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.35) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
  }

  .mobile-bottom-nav::-webkit-scrollbar {
    display: none !important;
  }

  .mobile-nav-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-md, #9A9390) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    cursor: pointer !important;
    padding: 4px 2px 2px !important;
    flex: 1 1 0 !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
  }

  .mobile-nav-btn .nav-ico {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    max-width: 100% !important;
    height: 24px !important;
    border-radius: 12px !important;
    flex-shrink: 0 !important;
  }

  .mobile-nav-btn .nav-ico svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
  }

  .mobile-nav-btn .lbl {
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.1 !important;
    font-family: var(--font-body, sans-serif) !important;
    white-space: normal !important;
    text-align: center !important;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .mobile-nav-btn.active {
    color: var(--green, #22C55E) !important;
  }

  .mobile-nav-btn.active .nav-ico {
    background: rgba(34, 197, 94, 0.16) !important;
  }

  @media (hover: hover) and (pointer: fine) {
    .mobile-nav-btn:hover {
      color: var(--text-hi, #F2EEE8) !important;
    }
    .mobile-nav-btn.active:hover {
      color: var(--green, #22C55E) !important;
    }
  }

  /* Prevent bottom section content from being overlapped by bottom bar */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
/* PC Navbar Buttons Styling */
.desktop-nav-links .nav-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--text-md, #9A9390) !important;
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-family: var(--font-body, sans-serif) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  cursor: pointer !important;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease !important;
  outline: none !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.desktop-nav-links .nav-btn-ico {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 auto !important;
  color: inherit !important;
}

.desktop-nav-links .nav-btn-ico svg {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
}

/* Soft-hidden upcoming tools (kept in DOM for future launch) */
.feature-nav-hidden,
button.feature-nav-hidden,
.nav-btn.feature-nav-hidden,
.mobile-nav-btn.feature-nav-hidden {
  display: none !important;
}

/* Hover & Active State */
.desktop-nav-links .nav-btn:hover,
.desktop-nav-links .nav-btn.active {
  color: var(--text-hi, #F2EEE8) !important;
  background: var(--bg-glass2, rgba(255, 255, 255, 0.06)) !important;
  border-color: var(--border2, rgba(255, 255, 255, 0.13)) !important;
}
.demo-photo-wrapper {
  width: 100%;
  /* Fill the whole 3:4 photo frame (a fixed 220px height left a bare gap
     above the image). The frame owns the radius + overflow clipping. */
  flex: 1;
  align-self: stretch;
  min-height: 0;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
/* ============================================================
   GLOBE INTRO ANIMATION — styles
   Drop this file in and link it after your main stylesheet:
   <link rel="stylesheet" href="globe-animation.css">
   ============================================================ */

.globe-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(ellipse at 50% 40%, #0d1220 0%, #05060b 65%, #020204 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  overflow: hidden;
  font-family: var(--font-body, 'DM Sans', sans-serif);
}

.globe-intro-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.globe-intro-overlay.gi-exiting {
  opacity: 0;
  transition: opacity 0.9s ease;
}

/* -------- starfield + globe canvases -------- */
.gi-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.gi-globe {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  transition: top 0.7s ease, transform 0.7s ease;
}

/* After the meteor opener, drop the globe so match reveals have more air above the card */
.globe-intro-overlay.gi-globe-lowered .gi-globe {
  top: 58%;
  transform: translate(-50%, -42%);
}

.gi-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(2,3,6,0.55) 78%, rgba(2,3,6,0.92) 100%);
}

/* -------- top bar: progress + skip -------- */
.gi-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  z-index: 3;
}

.gi-progress {
  display: flex;
  gap: 10px;
}

.gi-progress-dot {
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.14);
  overflow: hidden;
  position: relative;
}

.gi-progress-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg,#38B6FF,#2ECFB0);
  transition: transform 0.3s linear;
}

.gi-progress-dot.gi-done::after { transform: scaleX(1); transition: none; }
.gi-progress-dot.gi-active::after { transform: scaleX(1); }

.gi-skip-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #cfd6e6;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.gi-skip-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}

/* -------- caption (top, during "flight") -------- */
.gi-caption {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7f8bab;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 3;
  white-space: nowrap;
}
.gi-caption.gi-show { opacity: 1; }

/* -------- reveal block (bottom third) -------- */
.gi-reveal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 3;
  pointer-events: none;
}

.gi-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #D4A843;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-bottom: 6px;
}

.gi-flag {
  font-size: 46px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.2,1.4,.4,1);
  margin-bottom: 6px;
  filter: drop-shadow(0 0 18px rgba(46,207,176,0.35));
}

.gi-pct-wrap {
  display: flex;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gi-pct-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 84px;
  line-height: 1;
  background: linear-gradient(135deg,#F4F0E8,#38B6FF 55%,#2ECFB0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.gi-pct-sign {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: #2ECFB0;
  margin-top: 12px;
  margin-left: 2px;
}

.gi-eth-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: #F4F0E8;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease 0.05s, transform 0.5s ease 0.05s;
}

.gi-eth-sub {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 13px;
  color: #8c9ab0;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
  max-width: 420px;
}

.gi-reveal.gi-show .gi-rank,
.gi-reveal.gi-show .gi-flag,
.gi-reveal.gi-show .gi-pct-wrap,
.gi-reveal.gi-show .gi-eth-name,
.gi-reveal.gi-show .gi-eth-sub {
  opacity: 1;
  transform: none;
}

/* -------- mute button -------- */
.gi-mute-btn {
  position: absolute;
  bottom: 22px;
  right: 26px;
  z-index: 3;
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #cfd6e6;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body, sans-serif);
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.gi-mute-btn:hover { background: rgba(255,255,255,0.12); }

/* -------- responsive -------- */
@media (max-width: 640px) {
  .gi-pct-num { font-size: 58px; }
  .gi-pct-sign { font-size: 22px; margin-top: 8px; }
  .gi-flag { font-size: 36px; }
  .gi-eth-name { font-size: 20px; }
  .gi-caption { font-size: 10px; top: 70px; }
  .gi-reveal { bottom: 12%; }
}

@media (prefers-reduced-motion: reduce) {
  .globe-intro-overlay,
  .gi-caption,
  .gi-reveal .gi-rank,
  .gi-reveal .gi-flag,
  .gi-reveal .gi-pct-wrap,
  .gi-reveal .gi-eth-name,
  .gi-reveal .gi-eth-sub {
    transition-duration: 0.01ms !important;
  }
}

.demo-user-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Source is watermark-cropped + left-padded so the face sits on
     center; a light zoom pushes the padded black strip (and his
     left shoulder) past the frame edge so he doesn't float. */
  object-position: center;
  border-radius: inherit;
  transform: scale(1.22);
  transform-origin: 50% 40%;
}
/* ============================================================
   PAGE SECTIONS
   ============================================================ */
.page { position: relative; z-index: 1; }
.section { display: none; }
/* ID-level layout (e.g. analyzer step 3) must not keep a page visible after nav. */
section.section.page:not(.active) { display: none !important; }
body.viewing-sample #analyzer { display: none !important; }
.section.active { display: block; animation: sectionFade 0.2s ease; }
.section.active.section-instant { animation: none; }
@keyframes sectionFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Clear the fixed 60px navbar on every page section */
section.section.page {
  scroll-margin-top: 60px;
  box-sizing: border-box;
}
#coinstore,
#familytree {
  min-height: calc(100vh - 60px);
  padding: 100px 24px 80px;
}

/* ============================================================
   NAVBAR
   ============================================================ */

/* ============================================================
   HOME / HERO
   ============================================================ */
#home {
  min-height: 100vh;
  padding: 62px 24px 0;
}
#home.section.active {
  display: flex;
  flex-direction: column;
}

/* ── Top half: split layout ── */
.hero-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 62px);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
  padding: 60px 40px;
}

.hero-left {
  padding-right: 64px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--green);
  margin-bottom: 28px;
  text-transform: uppercase;
}

.hero-eyebrow-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: var(--font-disp);
  font-size: clamp(42px, 5.5vw, 72px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.hero-title .t-white {
  color: var(--text-hi);
  display: block;
}

.hero-title .t-green {
  color: var(--green);
  display: block;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 12px;
}

.hero-sub {
  color: var(--text-md);
  font-size: 16px;
  line-height: 1.7;
  max-width: 420px;
  margin-bottom: 36px;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #050805;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--green-lt);
  transform: translateY(-2px);
  box-shadow: var(--glow-green), 0 12px 32px rgba(0,0,0,0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass2);
  color: var(--text-hi);
  border: 1px solid var(--border2);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 13px 24px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: var(--border2);
  background: var(--bg-glass2);
  transform: translateY(-1px);
}

.hero-trust-line {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-lo);
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-lo);
  font-weight: 500;
}

.trust-item svg {
  width: 14px;
  height: 14px;
  color: var(--green);
  flex-shrink: 0;
}

.trust-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

/* ── Hero right: demo card ── */
.hero-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  transform: translateZ(0);
}

.demo-shell {
  background: var(--bg-card);
  background-color: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
  z-index: 2;
  isolation: isolate;
}

/* Step indicator */
.demo-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.demo-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.step-node {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1.5px solid var(--border2);
  color: var(--text-lo);
  background: var(--bg-card);
  position: relative;
  z-index: 1;
}

.step-node.done {
  background: var(--green);
  border-color: var(--green);
  color: #050805;
}

.step-node.active {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}

.step-label {
  font-size: 10px;
  color: var(--text-lo);
  text-align: center;
  line-height: 1.2;
}
.step-label .sl-main {
  display: block;
  font-weight: 600;
  color: var(--text-md);
  font-size: 11px;
}
.step-label .sl-sub {
  display: block;
  font-size: 10px;
  color: var(--text-lo);
}

.step-connector {
  flex: 0.5;
  height: 1.5px;
  background: var(--border);
  margin-bottom: 20px;
  position: relative;
}
.step-connector.done {
  background: var(--green);
}

/* Demo body */
.demo-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 320px;
}

.demo-left {
  border-right: 1px solid var(--border);
  padding: 16px;
}

.demo-left-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.demo-photo-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  aspect-ratio: 3/4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}

/* Stylized silhouette face for the demo */
.demo-face-svg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-face-svg svg {
  width: 80%;
  height: 80%;
  opacity: 0.18;
}

.demo-face-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

.demo-face-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 1.8s ease-in-out infinite;
}

.demo-right {
  padding: 16px;
}

.demo-right-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
}

.demo-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-md);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-globe-icon {
  font-size: 12px;
  color: var(--text-lo);
}

.demo-eth-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.demo-bar-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.demo-bar-name {
  font-size: 11px;
  color: var(--text-md);
  min-width: 72px;
  font-weight: 500;
}

.demo-bar-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.demo-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--green);
  transition: width 1s ease;
}

.demo-bar-fill.b2 { background: #3B82F6; }
.demo-bar-fill.b3 { background: var(--violet); }
.demo-bar-fill.b4 { background: var(--amber); }
.demo-bar-fill.b5 { background: var(--rose); }

.demo-bar-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-md);
  min-width: 24px;
  text-align: right;
  font-weight: 500;
}

.demo-pheno-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-md);
  margin-bottom: 8px;
}

.demo-pheno-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.demo-pheno-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.demo-pheno-key {
  color: var(--text-lo);
  display: flex;
  align-items: center;
  gap: 5px;
}

.demo-pheno-key svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

.demo-pheno-val {
  color: var(--text-md);
  font-weight: 500;
}

/* Skin swatches in demo */
.demo-skin-swatches {
  display: flex;
  gap: 3px;
}

.demo-swatch {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid transparent;
}

.demo-swatch.active {
  border-color: rgba(255,255,255,0.4);
}

/* Demo footer */
.demo-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--bg-surface);
}

.demo-cta-bar {
  background: var(--green);
  color: #050805;
  border: none;
  width: 100%;
  padding: 11px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.demo-cta-bar:hover {
  background: var(--green-lt);
}

.demo-cta-bar--static {
  background: transparent;
  color: var(--text-lo);
  font-weight: 500;
  cursor: default;
  border: 1px dashed var(--border);
}

.demo-cta-bar--static:hover {
  background: transparent;
}

/* ── Stats strip ── */
.home-stats {
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  padding: 0;
}

.home-stats-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0;
}

.home-stat-item {
  padding: 28px 40px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-stat-item:last-child {
  border-right: none;
}

.home-stat-num {
  font-family: var(--font-disp);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-hi);
  letter-spacing: -0.04em;
  line-height: 1;
}

.home-stat-num span {
  color: var(--green);
}

.home-stat-lbl {
  font-size: 12px;
  color: var(--text-lo);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Feature section ── */
.home-features {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-features-header {
  max-width: 560px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-disp);
  font-size: clamp(22px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.split-letter {
  display: inline;
}

.fx-fade-in {
  animation: fxFadeIn 0.4s ease both;
}

@keyframes fxFadeIn {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-fade-in { animation: none; }
}

.section-sub {
  color: var(--text-md);
  font-size: 15px;
  line-height: 1.7;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.feat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.feat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Top accent bar — color matched to each card */
.feat-card:nth-child(1)::after { background: linear-gradient(90deg, #EF4444, transparent); }
.feat-card:nth-child(2)::after { background: linear-gradient(90deg, var(--teal), transparent); }
.feat-card:nth-child(3)::after { background: linear-gradient(90deg, #38BDF8, transparent); }
.feat-card:nth-child(4)::after { background: linear-gradient(90deg, var(--amber), transparent); }
.feat-card:nth-child(5)::after { background: linear-gradient(90deg, var(--green), transparent); }
.feat-card:nth-child(6)::after { background: linear-gradient(90deg, var(--violet), transparent); }

.feat-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.feat-card:hover::after { opacity: 1; }

.feat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--bg-glass2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin: 0 auto 16px;
}

.feat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.feat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: 7px;
  font-family: var(--font-disp);
  letter-spacing: -0.02em;
}

.feat-desc {
  font-size: 13px;
  color: var(--text-lo);
  line-height: 1.55;
}

.home-trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 60px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 960px;
}

.home-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-lo);
}

/* Stats strip at bottom of home */
.stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
  position: relative;
  z-index: 1;
}

.stat-item { text-align: center; }

.stat-num {
  font-family: var(--font-disp);
  font-size: 34px;
  font-weight: 800;
  color: var(--text-hi);
  display: block;
  letter-spacing: -0.04em;
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.stat-div {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ============================================================
   ANALYZER SECTION
   ============================================================ */
#analyzer {
  min-height: 100vh;
  padding: 100px 24px 80px;
}

.analyzer-header {
  text-align: center;
  margin-bottom: 48px;
}

.analyzer-header .section-eyebrow { color: var(--green); }

.analyzer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

#analyzer[data-analyzer-step="1"] .analyzer-grid,
#analyzer[data-analyzer-step="2"] .analyzer-grid {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

#analyzer[data-analyzer-step="1"] .traits-panel,
#analyzer[data-analyzer-step="2"] .traits-panel {
  display: none;
}

#analyzer[data-analyzer-step="1"] .status-bar {
  display: none;
}

#analyzer[data-analyzer-step="2"] .analyzer-grid {
  grid-template-columns: minmax(0, 640px);
}

/* Step 3: photo + traits as a two-pane workspace.
   Must include .active — ID+attribute beats .section { display:none },
   which left this page visible after the globe intro switched to Results. */
#analyzer.active[data-analyzer-step="3"] {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 72px 24px 16px;
  box-sizing: border-box;
  overflow: hidden;
}

#analyzer[data-analyzer-step="3"] .analyzer-header {
  flex-shrink: 0;
  margin-bottom: 16px;
}

#analyzer[data-analyzer-step="3"] .analyzer-header .section-title {
  font-size: 28px;
}

#analyzer[data-analyzer-step="3"] .analyzer-header .section-sub {
  display: none;
}

#analyzer[data-analyzer-step="3"] .panel-privacy-note {
  display: none;
}

#analyzer[data-analyzer-step="3"] .analyzer-steps {
  margin-top: 10px;
}

#analyzer[data-analyzer-step="3"] .analyzer-grid {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

#analyzer[data-analyzer-step="3"] .camera-panel,
#analyzer[data-analyzer-step="3"] .traits-panel {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.camera-title-confirm {
  display: none;
}

#analyzer[data-analyzer-step="3"] .camera-title-upload {
  display: none;
}

#analyzer[data-analyzer-step="3"] .camera-title-confirm {
  display: inline;
}

#analyzer[data-analyzer-step="3"] #uploadPreviewWrap {
  flex: 1 1 auto;
  min-height: 140px;
  overflow: hidden;
}

#analyzer[data-analyzer-step="3"] .video-wrap {
  height: 100%;
  aspect-ratio: auto;
  max-height: min(42vh, 340px);
}

#analyzer[data-analyzer-step="3"] .camera-controls {
  padding: 10px 14px;
}

#analyzer[data-analyzer-step="3"] .ctrl-btn-capture {
  flex: 1;
  font-size: 13px;
  padding: 10px 12px;
  background: var(--bg-surface);
  color: var(--text-md);
  box-shadow: none;
  animation: none;
  border: 1px solid var(--border);
}

#analyzer[data-analyzer-step="3"] .ctrl-btn-capture:hover {
  background: var(--bg-glass2);
  color: var(--text-hi);
  box-shadow: none;
}

#analyzer[data-analyzer-step="3"] .ctrl-btn-clear {
  flex: 1;
}

#analyzer[data-analyzer-step="3"] .landmark-info {
  padding: 8px 12px;
  gap: 6px;
}

#analyzer[data-analyzer-step="3"] .lm-chip {
  padding: 6px 8px;
}

#analyzer[data-analyzer-step="3"] .status-bar {
  padding: 8px 14px;
}

#analyzer[data-analyzer-step="3"] .traits-scroll {
  min-height: 0;
}

#analyzer[data-analyzer-step="3"] .analyze-footer {
  flex-shrink: 0;
}

#analyzer[data-analyzer-step="3"] .detect-cta {
  display: none;
}

/* Upload Panel */
.camera-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  gap: 10px;
}

.panel-privacy-note {
  font-size: 11px;
  color: var(--text-lo);
  line-height: 1.4;
  max-width: 240px;
  text-align: right;
}

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

.trait-autofill-btn {
  background: linear-gradient(90deg, var(--violet), var(--teal));
  border: none;
  color: #0a0d16;
  font-weight: 600;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 5px;
}

.trait-autofill-btn span {
  opacity: 0.75;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trait-reset-btn {
  background: none;
  border: none;
  color: var(--text-lo);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-body);
}

.trait-reset-btn:hover {
  color: var(--text-hi);
  background: rgba(255,255,255,0.04);
}

.traits-intro {
  margin: 0;
  padding: 10px 18px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-md);
  border-bottom: 1px solid var(--border);
  background: rgba(123, 92, 245, 0.06);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.panel-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: blink 2s infinite;
}

.panel-dot.idle { background: var(--text-lo); animation: none; }
.panel-dot.active { background: var(--green); }
.panel-dot.error { background: var(--rose); animation: none; }

/* Upload Zone */
.upload-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--r-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  margin: 18px;
  background: var(--bg-surface);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--green);
  background: rgba(34,197,94,0.04);
}

#analyzer[data-analyzer-step="1"] .upload-zone {
  min-height: 220px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#analyzer[data-analyzer-step="2"] .photo-tips,
#analyzer[data-analyzer-step="3"] .photo-tips {
  display: none;
}

.photo-tips {
  margin: 0 18px 16px;
  padding: 14px 16px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.photo-tips-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 4px;
}

.photo-tips-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-md);
}

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

.photo-tips-list li {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hi);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  pointer-events: none;
}

.upload-zone input[type=file]:not(.file-input-hidden) {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  width: 52px; height: 52px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--green, #22C55E);
}

.upload-text {
  font-size: 15px;
  color: var(--text-md);
  font-weight: 500;
  margin-bottom: 6px;
}

.upload-text span {
  color: var(--green);
  font-weight: 600;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-lo);
}

/* Preview wrap */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  overflow: hidden;
}

#uploadCanvas {
  width: 100%; height: 100%;
  object-fit: contain;
  display: none;
}

#uploadOverlay {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}

.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.scan-overlay.scanning { opacity: 1; }

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  animation: scanLine 1.5s linear infinite;
  box-shadow: 0 0 16px var(--green);
}

@keyframes scanLine {
  0% { top: 0; }
  100% { top: 100%; }
}

.scan-corners { position: absolute; inset: 20px; }

.corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--green);
  border-style: solid;
}

.corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; border-radius: 3px 0 0 0; }
.corner-tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 3px 0 0; }
.corner-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 3px; }
.corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-radius: 0 0 3px 0; }

/* Landmark chips */
.landmark-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.lm-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  text-align: center;
}

.lm-chip-label {
  font-size: 10px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.lm-chip-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

/* Skin bar */
.skin-bar {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.skin-label {
  font-size: 11px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.skin-swatch {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  flex-shrink: 0;
  transition: background 0.5s;
}

.skin-hex {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-md);
}

.skin-ita {
  font-size: 12px;
  color: var(--text-lo);
  margin-left: auto;
}

/* Camera controls */
.camera-controls {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.ctrl-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px;
  border-radius: var(--r-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
}

.ctrl-btn-capture {
  flex: 2;
  background: var(--green);
  color: #050805;
  font-size: 15px;
  padding: 16px 14px;
}

.ctrl-btn-capture:hover {
  background: var(--green-lt);
}

.ctrl-btn-capture.is-busy {
  opacity: 0.85;
  cursor: wait;
}

.detect-label-busy {
  display: none;
}

.ctrl-btn-capture.is-busy .detect-label-busy {
  display: inline;
}

.ctrl-btn-capture.is-busy .detect-label-redo {
  display: none;
}

.detect-label-redo {
  display: inline;
}

.detect-label-default {
  display: none;
}

#analyzer[data-analyzer-step="3"] .detect-label-default {
  display: none;
}

#analyzer[data-analyzer-step="3"] .detect-label-redo {
  display: inline;
}

.detect-cta {
  margin: 0;
  padding: 14px 18px 4px;
  background: rgba(34, 197, 94, 0.1);
  border-top: 1px solid rgba(34, 197, 94, 0.28);
}

.detect-cta-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 4px;
}

.detect-cta-copy {
  font-size: 13px;
  color: var(--text-md);
  line-height: 1.5;
  margin: 0;
}

.analyzer-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  justify-content: center;
  color: var(--text-md);
  font-size: 13px;
}

.analyzer-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.45;
}

.analyzer-steps .step-label {
  white-space: nowrap;
}

.analyzer-steps li.is-current,
.analyzer-steps li.is-done {
  opacity: 1;
}

.analyzer-steps li.is-current {
  color: var(--text-hi);
  font-weight: 600;
}

.analyzer-steps li::before {
  content: attr(data-step);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border2);
  color: var(--text-hi);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.analyzer-steps li.is-current::before,
.analyzer-steps li.is-done::before {
  background: var(--green);
  color: #050805;
}

.analyzer-steps li.is-current::before {
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

.analyzer-steps li.is-done::before {
  content: "✓";
}

.run-analysis-hint {
  font-size: 12px;
  color: var(--text-md);
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.4;
}

.run-analysis-hint[hidden] {
  display: none;
}

.btn-analyze.awaiting-landmarks {
  opacity: 0.45;
}

.ctrl-btn-clear {
  flex: 1;
  background: var(--bg-surface);
  color: var(--text-md);
  border: 1px solid var(--border);
}

.ctrl-btn-clear:hover {
  background: var(--bg-glass2);
  color: var(--text-hi);
}

.ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 12px;
  color: var(--text-lo);
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

/* ============================================================
   TRAITS PANEL
   ============================================================ */
.traits-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.traits-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.traits-scroll::-webkit-scrollbar { width: 3px; }
.traits-scroll::-webkit-scrollbar-track { background: transparent; }
.traits-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.trait-group {
  margin-bottom: 12px;
  padding: 12px 12px 10px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.trait-group:last-child {
  margin-bottom: 0;
}

.trait-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-disp);
}

.trait-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.trait-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 12px;
}

.trait-name {
  font-size: 13px;
  color: var(--text-md);
  min-width: 100px;
  font-weight: 500;
}

.trait-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trait-select {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2352504E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
  background-color: var(--bg-surface);
}

.trait-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}

.color-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.color-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.color-dot:hover { transform: scale(1.2); }

.color-dot.selected {
  border-color: rgba(255,255,255,0.7);
  box-shadow: 0 0 6px rgba(255,255,255,0.3);
}

.trait-range { flex: 1; }

.trait-range input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
}

.trait-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(34,197,94,0.5);
  transition: box-shadow 0.2s;
}

.trait-range input[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(34,197,94,0.8);
}

.trait-range-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  min-width: 30px;
  text-align: right;
}

.trait-row:last-child,
.trait-row:has(+ .trait-guide) {
  border-bottom: none;
}

/* Trait example charts — quiet row that opens into a paper well */
.trait-guide {
  margin-top: 2px;
  border-radius: 10px;
  background: transparent;
}

.trait-guide[open] {
  margin-top: 8px;
  border: 1px solid var(--border);
  background: var(--bg-deep);
}

.trait-guide summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-body);
}

.trait-guide[open] summary {
  padding: 8px 10px;
}

.trait-guide summary::-webkit-details-marker,
.trait-guide summary::marker {
  display: none;
  content: "";
}

.trait-guide-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-lo);
  display: flex;
  align-items: center;
  gap: 7px;
}

.trait-guide-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-lo);
  border-bottom: 1.5px solid var(--text-lo);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.trait-guide[open] .trait-guide-label {
  color: var(--text-md);
}

.trait-guide[open] .trait-guide-label::before {
  transform: rotate(45deg);
  margin-top: -2px;
  border-color: var(--text-md);
}

.trait-guide-hint {
  font-size: 11px;
  color: var(--text-lo);
}

.trait-guide[open] .trait-guide-hint {
  visibility: hidden;
}

.trait-guide-frame {
  margin: 0 10px 10px;
  padding: 7px;
  background: #14131c;
  border-radius: 8px;
  overflow: auto;
  max-height: min(48vh, 380px);
}

.trait-guide-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #E8DFD0;
  border-radius: 5px;
}

[data-theme="light"] .trait-guide[open] {
  background: var(--bg-surface);
}

[data-theme="light"] .trait-guide-frame {
  background: var(--bg-surface);
}

[data-theme="light"] .trait-guide-frame img {
  background: #F4EFE6;
}

.analyze-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.btn-analyze {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--green);
  color: #050805;
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  letter-spacing: -0.01em;
}

.btn-analyze:hover {
  background: var(--green-lt);
}

.btn-analyze:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   RESULTS SECTION — compact, viewport-aware spacing
   ============================================================ */
#results {
  min-height: calc(100vh - 60px);
  padding: clamp(88px, 10vh, 108px) clamp(14px, 3vw, 24px) clamp(36px, 6vh, 56px);
}

.results-header {
  text-align: center;
  margin-bottom: clamp(12px, 2.2vh, 22px);
}

.results-header .section-eyebrow { color: var(--gold); }

.results-header .section-title,
#resultsTitle {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.results-header .section-sub {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(12px, 1.5vw, 14px);
}

.pr-skip-btn {
  margin-top: 14px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-md);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pr-skip-btn:hover {
  color: var(--text-hi);
  border-color: var(--border2);
  background: var(--bg-glass2);
}

.pr-skip-btn[hidden] {
  display: none !important;
}

/* Insights row */
.insights-row {
  max-width: 1100px;
  margin: 0 auto clamp(10px, 1.8vh, 16px);
  display: grid;
  /* 3 columns at wide widths so 6 cards split evenly (3+3, not 4+2) */
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vw, 12px);
}

@media (max-width: 900px) {
  .insights-row {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: clamp(12px, 1.6vh, 16px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.insight-card:hover {
  border-color: var(--border2);
}

.insight-icon {
  display: none;
}

.insight-label {
  font-size: 10px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  font-weight: 600;
}

.insight-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  font-family: var(--font-disp);
  letter-spacing: -0.02em;
}

.insight-sub {
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 3px;
}

/* Reveal card */
.reveal-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
}

.reveal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border2);
}

.reveal-top {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 0;
}

/* Podium */
.podium-wrap {
  padding: clamp(14px, 2.2vh, 24px) clamp(14px, 2vw, 22px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: linear-gradient(180deg, rgba(34,197,94,0.03) 0%, transparent 100%);
}

.podium-title {
  font-size: 10px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  font-weight: 700;
}

.podium-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.podium-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: all 0.3s;
}

.podium-item.rank-1 {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.22);
}

.podium-item.rank-2,
.podium-item.rank-3 {
  background: var(--bg-surface);
  border-color: var(--border);
}

.podium-rank {
  font-family: var(--font-disp);
  font-size: 18px;
  font-weight: 800;
  width: 26px;
  text-align: center;
}

.rank-1 .podium-rank { color: var(--green); }
.rank-2 .podium-rank,
.rank-3 .podium-rank { color: var(--text-md); }

.podium-flag { font-size: 24px; }

.podium-info { flex: 1; }

.podium-eth {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: -0.01em;
}

.podium-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.rank-1 .podium-pct { color: var(--green); }
.rank-2 .podium-pct,
.rank-3 .podium-pct { color: var(--text-md); }

/* Confidence ring */
.confidence-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.confidence-ring {
  position: relative;
  width: 80px; height: 80px;
}

.confidence-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.confidence-ring .ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 5;
}

.confidence-ring .ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-pct {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}

.ring-lbl {
  font-size: 8px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Result main */
.result-main {
  padding: clamp(14px, 2.2vh, 26px) clamp(16px, 2.5vw, 32px);
}

.result-subject-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border2);
}
.result-subject-photo[hidden] { display: none !important; }
.result-subject-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-primary-flag {
  font-size: clamp(36px, 5vh, 52px);
  margin-bottom: 6px;
  display: block;
  line-height: 1;
}

.result-primary-name {
  font-family: var(--font-body);
  font-size: clamp(22px, 3.2vh, 32px);
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-hi);
  letter-spacing: -0.025em;
}

.result-desc {
  color: var(--text-md);
  font-size: 14px;
  line-height: 1.7;
  max-width: 460px;
  margin-bottom: 24px;
}

.breakdown-title {
  font-size: 10px;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  font-weight: 700;
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-flag { font-size: 14px; width: 22px; text-align: center; }

.bar-label {
  font-size: 12px;
  color: var(--text-md);
  min-width: 120px;
  font-weight: 500;
}

.bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--green);
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

.bar-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-md);
  min-width: 36px;
  text-align: right;
}

/* Sub-ethnicity card */
.sub-ethnicity-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}

/* Map card */
.map-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}

.map-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.map-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

#worldMapSvg {
  width: 100%;
  height: auto;
  display: block;
}

/* Map country paths */
.map-country {
  fill: rgba(255,255,255,0.04);
  stroke: rgba(255,255,255,0.07);
  stroke-width: 0.5;
  transition: fill 0.6s ease;
}

/* Light theme: white-tinted continents are invisible on a white card */
[data-theme="light"] .map-country {
  fill: rgba(15, 23, 42, 0.08);
  stroke: rgba(15, 23, 42, 0.16);
}

/* Sub-ethnicity map clone background (was a hardcoded dark inline style) */
.sub-map-svg {
  background: rgba(8, 10, 18, 0.5);
}

[data-theme="light"] .sub-map-svg {
  background: rgba(15, 23, 42, 0.04);
}

.map-country.highlight-1 {
  fill: rgba(34,197,94,0.85);
  stroke: var(--green);
}

.map-country.highlight-2 {
  fill: rgba(46,207,176,0.7);
  stroke: var(--teal);
}

.map-country.highlight-3 {
  fill: rgba(123,92,245,0.6);
  stroke: var(--violet);
}

.map-country.highlight-4 {
  fill: rgba(245,158,11,0.45);
}

.map-country.highlight-5 {
  fill: rgba(56,182,255,0.35);
}

.map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-md);
}

.map-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Charts row */
.charts-row {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.5vw, 16px);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
}

.chart-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.chart-card-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.chart-wrap {
  position: relative;
  height: clamp(200px, 28vh, 260px);
}

/* Full grid card */
.full-grid-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}

.full-grid-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.full-grid-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.eth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 9px;
}

.eth-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all 0.2s;
}

.eth-cell:hover {
  border-color: var(--border2);
  background: var(--bg-glass2);
}

.eth-cell-flag { font-size: 18px; }

.eth-cell-info { flex: 1; min-width: 0; }

.eth-cell-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-hi);
}

.eth-cell-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

.eth-cell-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--green);
  transition: width 1s ease;
}

.eth-cell-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-lo);
  white-space: nowrap;
}

/* Trait summary */
.trait-summary-card {
  max-width: 1100px;
  margin: 0 auto 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
}

.trait-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.trait-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border2);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
}

.trait-chip-label {
  color: var(--text-lo);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trait-chip-val {
  color: var(--text-hi);
  font-weight: 600;
}

/* Measurements */
.measure-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}

.measure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.measure-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.measure-item:hover {
  border-color: var(--border2);
}

.measure-icon { display: none; }
.measure-name { font-size: 10px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 3px; }
.measure-val { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--green); }
.measure-unit { font-size: 9px; color: var(--text-lo); }

/* DNA breakdown */
.dna-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}

.dna-regions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.dna-region {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.dna-region::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.dna-region.r-east-asia::before { background: var(--rose); }
.dna-region.r-europe::before { background: var(--sky); }
.dna-region.r-africa::before { background: var(--gold); }
.dna-region.r-south-asia::before { background: var(--violet); }
.dna-region.r-middle-east::before { background: var(--teal); }
.dna-region.r-americas::before { background: var(--gold-lt); }
.dna-region.r-oceania::before { background: var(--teal-lt); }

.dna-region-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-md);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dna-region-pct {
  font-family: var(--font-disp);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-hi);
  letter-spacing: -0.04em;
}

.dna-region-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.dna-region-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--green);
}

/* Facts card */
.facts-card {
  max-width: 1100px;
  margin: 0 auto 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
}

.facts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.fact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color 0.2s;
}

.fact-item:hover { border-color: var(--border2); }

.fact-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }

.fact-text {
  font-size: 13px;
  color: var(--text-md);
  line-height: 1.6;
}

.fact-text strong { color: var(--text-hi); }

/* Ancient civs */
.ancient-civs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  margin-top: 24px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.ancient-civs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.civ-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.civ-card:hover {
  border-color: rgba(34,197,94,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.civ-badge {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(34,197,94,0.1);
  color: var(--green-lt);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid rgba(34,197,94,0.18);
}

.civ-name {
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: 3px;
  padding-right: 66px;
  letter-spacing: -0.02em;
}

.civ-era {
  font-size: 10px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  font-weight: 600;
}

.civ-desc {
  font-size: 12.5px;
  color: var(--text-md);
  line-height: 1.5;
  margin-bottom: 12px;
  flex-grow: 1;
}

.civ-combo {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.combo-chip {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-md);
  padding: 2px 7px;
  border-radius: 4px;
}

.civ-progress { height: 4px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; }

.civ-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dk), var(--green), var(--green-lt));
  border-radius: 3px;
  width: 0%;
  transition: width 1.4s cubic-bezier(.4,0,.2,1);
}

/* Three pillars */
.three-pillars-card-wrap {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.three-pillars-header { margin-bottom: 14px; }

.three-pillars-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-disp);
  letter-spacing: -0.02em;
}

.three-pillars-sub {
  font-size: 12px;
  color: var(--text-lo);
  margin-top: 3px;
}

.three-pillars-visual { margin-bottom: 18px; }

.three-pillars-bar-row {
  display: flex;
  width: 100%;
  height: 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 7px;
  overflow: hidden;
}

.pillar-segment { height: 100%; transition: width 1s ease-in-out; }

.three-pillars-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pillar-icon { font-size: 18px; margin-bottom: 5px; }

.pillar-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hi);
  font-family: var(--font-disp);
}

.pillar-pct {
  font-size: 20px;
  font-weight: 800;
  margin: 3px 0;
  font-family: var(--font-mono);
}

.pillar-desc {
  font-size: 10px;
  color: var(--text-lo);
  line-height: 1.4;
  margin-bottom: 8px;
  flex-grow: 1;
}

.pillar-mini-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}

.pillar-mini-fill {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width 1s ease-out;
}

.three-pillars-note {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 9px;
  color: var(--text-lo);
  font-size: 11px;
  line-height: 1.4;
}

/* Sub-ethnicity styles */
.sub-eth-group {
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--r-sm);
  padding: 14px;
  margin-bottom: 12px;
}

.sub-eth-group-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 10px;
}

.sub-eth-group-flag { font-size: 16px; }

.sub-eth-group-name {
  font-weight: 600;
  color: var(--text-hi);
  font-size: 14px;
}

.sub-eth-group-pct {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-md);
  background: rgba(255,255,255,0.04);
  padding: 2px 7px;
  border-radius: 20px;
}

.sub-eth-group-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-eth-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10,14,24,0.2);
  padding: 7px 10px;
  border-radius: var(--r-xs);
}

.sub-eth-flag { font-size: 14px; width: 22px; text-align: center; }

.sub-eth-info { flex-grow: 1; }

.sub-eth-name { font-size: 12px; color: var(--text-hi); font-weight: 500; }
.sub-eth-region { font-size: 10px; color: var(--text-md); margin-bottom: 3px; }

.sub-eth-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.sub-eth-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

.sub-eth-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hi);
  min-width: 40px;
  text-align: right;
  font-family: var(--font-mono);
}

/* Share card */
#shareCardContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  margin: 36px auto 0;
  padding: 0 16px;
  box-sizing: border-box;
}

.share-card {
  width: 100%;
  max-width: 380px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.03) 0%, transparent 42%),
    var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow:
    0 24px 48px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.share-card-bg {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 50% 20%, rgba(212,168,67,0.08) 0%, transparent 55%);
  pointer-events: none;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.share-card-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
  font-family: var(--font-disp);
  letter-spacing: -0.02em;
}

.share-conf-badge {
  font-size: 10px;
  font-weight: 700;
  color: #1a1408;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #D4A843, #9A7420);
}

.share-card-body { position: relative; z-index: 1; }

.share-card-top-match {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.share-top-flag { font-size: 34px; line-height: 1; }

.share-top-info { display: flex; flex-direction: column; min-width: 0; }

.share-top-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-top-pct {
  font-size: 24px;
  font-weight: 800;
  color: var(--green);
  line-height: 1.1;
  margin: 3px 0;
  font-family: var(--font-mono);
}

.share-top-region { font-size: 10px; color: var(--text-lo); letter-spacing: 0.02em; }

.share-card-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.share-bar-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.share-bar-flag { font-size: 12px; width: 16px; flex-shrink: 0; }
.share-bar-name { color: var(--text-md); width: 76px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-bar-track { flex-grow: 1; height: 5px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.share-bar-fill { height: 100%; border-radius: 999px; }
.share-bar-pct { color: var(--text-hi); font-weight: 600; width: 36px; text-align: right; font-family: var(--font-mono); font-size: 10px; flex-shrink: 0; }

.share-card-dna-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.share-dna-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  letter-spacing: 0.02em;
}

.share-card-skin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.18);
  padding: 8px 11px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 14px;
}

.share-skin-swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.25); flex-shrink: 0; }
.share-skin-label { font-size: 10px; color: var(--text-lo); }
.share-skin-hex { margin-left: auto; font-size: 10px; font-family: var(--font-mono); color: var(--text-lo); }

.share-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
  font-size: 10px;
  color: var(--text-lo);
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

.share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  width: 100%;
  max-width: 380px;
}

.share-actions .btn-primary,
.share-actions .btn-secondary {
  min-width: 148px;
  justify-content: center;
  padding: 12px 22px;
  font-size: 14px;
}

/* Results actions */
.results-actions {
  text-align: center;
  margin: 28px auto 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 420px;
}

.results-actions .btn-primary,
.results-actions .btn-secondary {
  min-width: 160px;
  justify-content: center;
  border-radius: var(--r-md, 12px);
}

.results-actions .results-action-quiet {
  background: transparent;
  border-color: var(--border);
  color: var(--text-md);
  font-weight: 550;
}
.results-actions .results-action-quiet:hover {
  color: var(--text-hi);
  border-color: var(--border2);
  background: var(--bg-glass2, rgba(255,255,255,0.04));
}
/* ===== FAMILY TREE PAGE ===== */
/* ===== PEDIGREE CANVAS & TOOLBAR ===== */

/* TOOLBAR & MAIN CONTAINERS */
.ft-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 0 16px;
}

.ft-count {
  font-size: 13px;
  color: var(--text-lo, #8a8f9d);
  margin-left: 0;
  order: 3;
  width: 100%;
  text-align: center;
}

@media (min-width: 720px) {
  .ft-toolbar { justify-content: flex-start; }
  .ft-count {
    margin-left: auto;
    width: auto;
    order: 0;
    text-align: left;
  }
}

/* TREE CANVAS CONTAINER */
.ft-tree-canvas {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  position: relative;
  min-height: 400px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
}

/* ABSOLUTE OVERLAY FOR CONNECTOR PATHS */
#ftConnectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* GENERATION LAYOUT */
.ft-gen-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 50px;
  position: relative;
}

.ft-gen-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-lo, #717684);
  margin-bottom: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 10px;
  border-radius: 10px;
}

.ft-gen-members {
  display: flex;
  justify-content: center;
  gap: 16px;
  position: relative;
  z-index: 2;
  flex-wrap: nowrap;
}

/* MEMBER CARD DESIGN */
.ft-member-card {
  width: 120px;
  background: var(--bg-card, #131722);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ft-member-card:hover {
  transform: translateY(-3px);
  border-color: #2ECFB0;
}

.ft-member-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.ft-member-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-hi, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ft-member-relation {
  font-size: 10px;
  color: var(--text-lo, #8a8f9d);
  text-transform: capitalize;
  margin: 2px 0;
}

.ft-member-top {
  font-size: 10px;
  color: #2ECFB0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MODAL STYLING */
.ft-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.ft-modal-backdrop.open {
  display: flex;
}

.ft-modal {
  background: var(--bg-card, #111522);
  border: 1px solid var(--border, #2a2f42);
  border-radius: 16px;
  padding: 24px;
  width: 92%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.ft-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #2a2f42);
  border-radius: 8px;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}
.ft-tree-canvas {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  min-height: 500px;
  overflow-x: auto;
  background: var(--bg-body, #0a0c14);
}

.ft-empty {
  text-align: center;
  color: var(--text-lo, #8a8f9d);
  padding: 80px 20px;
  font-size: 14px;
}

/* ===== GENERATION LAYOUT ENGINE ===== */
.ft-gen-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 56px; /* Space between generation levels for connector lines */
  position: relative;
}

.ft-gen-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-lo, #717684);
  margin-bottom: 16px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  border-radius: 12px;
}

.ft-gen-members {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 2;
}

/* ===== PEDIGREE NODE CARD STYLE ===== */
.ft-member-card {
  width: 110px;
  min-height: 125px;
  background: var(--bg-card, #131722);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  padding: 10px 8px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ft-member-card:hover {
  transform: translateY(-3px);
  border-color: #2ECFB0;
  box-shadow: 0 8px 20px rgba(46, 207, 176, 0.15);
}

/* Node top expansion handle indicator matching pedigree charts */
.ft-member-card::before {
  content: '+';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--bg-card, #131722);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.2));
  border-radius: 50%;
  font-size: 10px;
  line-height: 12px;
  color: var(--text-lo, #aaa);
}

.ft-member-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  display: block;
  border: 2px solid var(--border, rgba(255, 255, 255, 0.2));
  background: #1e2330;
}

.ft-member-name {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-hi, #f4f0e8);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ft-member-relation {
  font-size: 10px;
  color: var(--text-lo, #8a8f9d);
  text-transform: capitalize;
  margin: 2px 0 4px;
}

.ft-member-top {
  font-size: 10px;
  font-weight: 600;
  color: #2ECFB0;
}

/* SVG Overlay wrapper for dynamic pedigree branches */
#ftConnectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
/* Container for tree and vectors */
.ft-tree-canvas {
  max-width: 1200px;
  margin: 0 auto 30px;
  padding: 20px;
  position: relative;
  min-height: 350px;
  overflow-x: auto;
}

/* SVG background layer */
#ftConnectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Alignment of generations */
.ft-gen-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 60px;
  position: relative;
}

.ft-gen-members {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}

/* Bottom Inline Form Layout */
.ft-add-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  background: var(--bg-card, #111522);
  border: 1px solid var(--border, #2a2f42);
  border-radius: 12px;
}

.ft-inline-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ft-dropzone {
  border: 2px dashed var(--border, #2a2f42);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ft-dropzone:hover {
  border-color: var(--green, #2ECFB0);
}
/* Family Insights Modal Styling */
.family-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.family-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 550px;
  color: var(--text-hi);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.family-modal-header {
  padding: 20px;
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.family-modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--green);
  font-family: var(--font-disp);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-lo);
  cursor: pointer;
}

.family-modal-body {
  padding: 20px;
}

.fam-ethnicity-list {
  margin: 20px 0;
  max-height: 300px;
  overflow-y: auto;
}

.fam-item {
  margin-bottom: 15px;
}

.fam-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.fam-bar-bg {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.fam-bar-fill {
  background: linear-gradient(90deg, #2ECFB0, #7B5CF5);
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.family-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.family-actions .btn-primary {
  justify-content: center;
  min-width: 220px;
}
/* ============================================================
   ETHNICITIES DATABASE
   ============================================================ */
#ethnicities {
  min-height: 100vh;
  padding: 100px 24px 80px;
}

.eth-search-wrap {
  max-width: 1100px;
  margin: 0 auto 22px;
  padding: 0 0;
}

.eth-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.eth-search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.12);
}

.eth-db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 40px auto 0;
}

.eth-db-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.eth-db-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.28);
}

.eth-db-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--teal));
  opacity: 0;
  transition: opacity 0.3s;
}

.eth-db-card:hover::after { opacity: 1; }

.eth-db-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.eth-db-flag { font-size: 36px; }

.eth-db-info { flex: 1; }
.eth-db-name { font-size: 17px; font-weight: 700; margin-bottom: 3px; font-family: var(--font-disp); letter-spacing: -0.02em; }
.eth-db-region { font-size: 11px; color: var(--text-lo); }

.eth-db-ratios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.eth-ratio-key { font-size: 9px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; font-weight: 600; }
.eth-ratio-val { font-family: var(--font-mono); font-size: 12px; color: var(--green); font-weight: 500; }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
#about {
  min-height: calc(100dvh - 60px);
  padding: 88px 24px 48px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}
#about.section.active {
  display: flex;
}

#about .analyzer-header {
  margin-bottom: 20px;
  width: 100%;
  max-width: 680px;
}

#about .section-title {
  margin-bottom: 0;
}

.about-content {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  color: var(--text-hi);
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 14px;
}

.about-content p:last-of-type {
  margin-bottom: 0;
}

.about-content .about-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.about-disclaimer-label {
  color: var(--amber);
  font-weight: 700;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  visibility: hidden;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 10px 14px 10px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-hi);
  z-index: 100002;
  max-width: min(420px, calc(100vw - 24px));
  box-sizing: border-box;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#toastMsg {
  min-width: 0;
  flex: 1 1 auto;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.toast.success { border-color: rgba(34,197,94,0.32); }
.toast.success .toast-icon {
  background: rgba(34,197,94,0.16);
  color: var(--green);
}

.toast.error { border-color: rgba(232,93,122,0.28); }
.toast.error .toast-icon {
  background: rgba(232,93,122,0.14);
  color: #E85D7A;
}

.toast.info { border-color: rgba(56,182,255,0.28); }
.toast.info .toast-icon {
  background: rgba(56,182,255,0.14);
  color: var(--sky, #38B6FF);
}

.ft-gate {
  display: flex;
  justify-content: center;
  padding: 12px 8px 40px;
}

.ft-gate[hidden] {
  display: none !important;
}

.ft-gate-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 28px 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}

.ft-gate-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.28);
}

.ft-gate-icon svg {
  width: 24px;
  height: 24px;
}

.ft-gate-card h3 {
  font-family: var(--font-disp);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-hi);
  margin-bottom: 8px;
}

.ft-gate-card p {
  color: var(--text-md);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 20px;
}

.ft-gate-actions .btn-primary {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

#familytree.ft-gated .ft-toolbar,
#familytree.ft-gated .ft-tree-canvas,
#familytree.ft-gated .ft-insights-panel,
#familytree.ft-gated .family-modal-overlay {
  display: none !important;
}

#familytree.ft-gated .section-sub {
  display: none;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,16,0.92);
  backdrop-filter: blur(20px);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.loading-overlay.show { opacity: 1; pointer-events: all; }

.loading-spinner { width: 56px; height: 56px; position: relative; }

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(1) { border-top-color: var(--green); animation-duration: 1s; }
.spinner-ring:nth-child(2) { border-right-color: var(--teal); animation-duration: 1.4s; inset: 7px; }
.spinner-ring:nth-child(3) { border-bottom-color: var(--violet); animation-duration: 1.8s; inset: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { font-size: 15px; color: var(--text-md); text-align: center; font-weight: 500; }
.loading-sub { font-size: 12px; color: var(--text-lo); text-align: center; }

/* ============================================================
   CROWD CARD
   ============================================================ */
.crowd-card {
  max-width: 1100px;
  margin: 28px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 28px 24px;
}

.crowd-card .full-grid-title {
  text-align: left;
}

.crowd-card > p,
.card-lead {
  color: var(--text-lo);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.55;
}

.card-lead-tight {
  margin-top: -6px;
  margin-bottom: 14px;
}

.sub-ethnicity-card .full-grid-title {
  margin-bottom: 4px;
}

#crowdSelectWrap {
  display: none;
  margin-top: 4px;
}

#crowdSelectWrap .trait-select {
  width: 100%;
  margin-bottom: 10px;
}

#crowdSelectWrap .btn-primary {
  display: flex;
  width: 100%;
  max-width: 280px;
  margin: 6px auto 0;
  justify-content: center;
}

#crowdThanksMsg {
  text-align: center;
  margin-top: 8px;
}

/* ============================================================
   SELECT DROPDOWN STYLING
   ============================================================ */
select {
  background-color: var(--bg-surface) !important;
  color: var(--text-hi) !important;
  border: 1px solid var(--border) !important;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

select:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.12);
}

select option {
  background-color: #0A0C14 !important;
  color: var(--text-hi) !important;
  padding: 10px;
}

select option:hover,
select option:focus,
select option:active {
  background-color: #1A1F2E !important;
  color: var(--green) !important;
}

/* ============================================================
   MAP HIGHLIGHTS
   ============================================================ */
.highlight-1 { fill: rgba(34,197,94,0.85) !important; }
.highlight-2 { fill: rgba(46,207,176,0.7) !important; }
.highlight-3 { fill: rgba(123,92,245,0.6) !important; }
.highlight-4 { fill: rgba(245,158,11,0.5) !important; }
.highlight-5 { fill: rgba(56,182,255,0.4) !important; }

/* ============================================================
   ANIMATIONS & UTILITIES
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-1-5 { animation-delay: 0.15s; }

.progress-animated {
  animation: progressGrow 0.55s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes progressGrow {
  from { width: 0%; }
}

/* ============================================================
   PROGRESSIVE RESULTS REVEAL (staged post-scan reveal)
   Only transforms/opacity/filter are animated — no layout work.
   ============================================================ */
/* Podium slots, breakdown bar rows, primary name/flag/desc */
.pr-item {
  transition: opacity 0.6s cubic-bezier(.22,1,.36,1), transform 0.6s cubic-bezier(.22,1,.36,1);
}
span.pr-item { display: inline-block; } /* transforms need a box on inline spans */
.pr-hide {
  opacity: 0;
  transform: translateY(18px);
}

/* Below-the-fold cards — revealed by IntersectionObserver.
   Must fully override .fade-up's opacity:0 + animation, otherwise
   killing the animation leaves cards permanently invisible. */
#results .pr-card,
#results .pr-card.fade-up {
  animation: none !important;
  transition: opacity 0.55s cubic-bezier(.22,1,.36,1), transform 0.55s cubic-bezier(.22,1,.36,1);
}
#results .pr-card.pr-card-hide {
  opacity: 0 !important;
  transform: translateY(18px);
  pointer-events: none;
}
#results .pr-card:not(.pr-card-hide) {
  opacity: 1 !important;
  transform: none;
  pointer-events: auto;
}

/* Bar fills: width is set inline to the final value; the reveal
   animates scaleX instead of width to avoid layout thrash. */
.pr-bar {
  animation: none !important;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.25s cubic-bezier(.22,1,.36,1);
}
.pr-bar.pr-bar-go { transform: scaleX(1); }

/* Suspense beat: the #1 podium slot shows up blurred + pulsing,
   then snaps into focus with a golden glow when revealed last. */
.pr-item .podium-item {
  transition: all 0.3s, filter 0.8s ease, opacity 0.8s ease;
}
.pr-mystery .podium-item {
  filter: blur(9px) saturate(0.7);
  opacity: 0.55;
  pointer-events: none;
  animation: prMysteryPulse 1.3s ease-in-out infinite;
}
@keyframes prMysteryPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.75; }
}
.pr-top-glow .podium-item {
  animation: prTopGlow 1.6s ease-out 1;
}
@keyframes prTopGlow {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  100% { box-shadow: 0 0 0 20px rgba(34,197,94,0); }
}

/* Reduced motion: the JS skips the reveal entirely; this is a
   belt-and-braces guard so staged classes can never hide content. */
@media (prefers-reduced-motion: reduce) {
  .pr-hide, #results .pr-card.pr-card-hide { opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
  .pr-bar { transform: none !important; }
  .pr-mystery .podium-item { filter: none !important; opacity: 1 !important; animation: none !important; pointer-events: auto !important; }
  .pr-top-glow .podium-item { animation: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .hero-split { grid-template-columns: 1fr; gap: 48px; padding: 48px 24px; }
  .hero-left { padding-right: 0; }
  .hero-right { justify-content: flex-start; }
  .demo-shell { max-width: 100%; }
  .home-stats-inner { grid-template-columns: repeat(2, 1fr); }
  .home-stat-item:nth-child(2) { border-right: none; }
  .home-stat-item:nth-child(3) { border-top: 1px solid var(--border); }
  .home-stat-item:nth-child(4) { border-right: none; border-top: 1px solid var(--border); }
}

@media (max-width: 1000px) {
  .analyzer-grid { grid-template-columns: 1fr; }
  .reveal-top { grid-template-columns: 1fr; }
  .podium-wrap { border-right: none; border-bottom: 1px solid var(--border); }
  .charts-row { grid-template-columns: 1fr; }

  #analyzer.active[data-analyzer-step="3"] {
    display: block;
    height: auto;
    overflow: visible;
    padding: 84px 16px 28px;
  }

  #analyzer[data-analyzer-step="3"] .analyzer-header {
    margin-bottom: 18px;
  }

  #analyzer[data-analyzer-step="3"] .analyzer-grid {
    height: auto;
    min-height: 0;
    flex: none;
    gap: 14px;
    grid-template-columns: 1fr;
  }

  #analyzer[data-analyzer-step="3"] .camera-panel,
  #analyzer[data-analyzer-step="3"] .traits-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  #analyzer[data-analyzer-step="3"] #uploadPreviewWrap {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  #analyzer[data-analyzer-step="3"] .video-wrap {
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 280px;
  }

  #analyzer[data-analyzer-step="3"] .traits-scroll {
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .navbar { padding: 0 18px; }
  .stats-strip { gap: 22px; }
  .feature-strip { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 38px; }
  .home-stats-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  #home { padding: 62px 16px 0; }
  #analyzer, #results, #ethnicities, #about { padding-left: 16px; padding-right: 16px; }
  .hero-split { padding: 36px 0; }
  .home-features { padding: 56px 0; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 14px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-secondary { justify-content: center; }
  .stats-strip { flex-wrap: wrap; gap: 14px; }
  .stat-div { display: none; }
  .feature-strip { grid-template-columns: 1fr; }
  .home-stats-inner { grid-template-columns: 1fr 1fr; }
  .home-stat-item { padding: 18px 20px; }
  .demo-body { grid-template-columns: 1fr; }
  .demo-left { border-right: none; border-bottom: 1px solid var(--border); }
}
  
.coin-nav-balance .coin-balance-value{color:var(--text-hi,#fff);}
 
/* Lock wrapper / overlay — soft paywall for pack-tier features */
.lock-wrap {
  position: relative;
  margin-bottom: 14px;
}
.lock-wrap.is-locked {
  min-height: 168px;
}
.lock-wrap.is-locked > :not(.lock-overlay) {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
  opacity: 0.55;
}
.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px 16px 18px;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: inherit;
  z-index: 20;
  border: 1px solid var(--border);
  animation: lockFadeIn 0.3s ease;
  box-sizing: border-box;
}
.lock-overlay.unlocked {
  display: none;
}
@keyframes lockFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lock-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  color: var(--text-md);
  background: var(--bg-surface, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
}
.lock-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.lock-title {
  color: var(--text-hi, #F4F0E8);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
}
.lock-sub {
  color: var(--text-lo, #A8A09A);
  font-size: 12px;
  max-width: 280px;
  line-height: 1.45;
  margin: 0;
}
.lock-sub strong {
  color: var(--green);
}
.lock-cost-badge {
  font-size: 10px;
  font-weight: 650;
  color: var(--text-lo);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 2px 0 0;
}
/* Gate CTAs: quiet outline — green reserved for primary actions / full-report unlock */
.lock-overlay .btn-unlock {
  background: transparent;
  color: var(--text-hi);
  border: 1px solid var(--border2);
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: var(--r-md, 12px);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  margin-top: 4px;
  min-height: 42px;
}
.lock-overlay .btn-unlock:hover {
  background: var(--bg-glass2, rgba(255,255,255,0.06));
  border-color: var(--border2);
  color: var(--text-hi);
}

.btn-unlock {
  background: var(--green);
  color: #050805;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: var(--r-md, 12px);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-unlock:hover {
  background: var(--green-lt);
}

.results-nav button.is-gated {
  opacity: 0.45;
}

[data-theme="light"] .lock-overlay {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--border2);
}
[data-theme="light"] .lock-icon {
  background: var(--bg-surface);
  color: var(--text-md);
}
 
/* Sample report banner — demo / marketing preview */
.sample-report-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto 18px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}
.sample-report-banner[hidden] {
  display: none !important;
}
.sample-report-banner-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-md, #c7c7c2);
}
.sample-report-banner-text strong {
  color: var(--green, #22C55E);
}
.sample-report-face {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(34, 197, 94, 0.45);
}
.sample-report-cta {
  flex-shrink: 0;
  padding: 10px 18px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .sample-report-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .sample-report-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Free-tier visible primary % */
.result-primary-pct{
  font-size:34px;font-weight:800;color:#D4A843;margin:4px 0 10px;
  font-family:var(--font-body,inherit);
}
.free-tier-note{
  color:#A8A09A;font-size:12px;margin-top:2px;margin-bottom:14px;
}
 
/* ================= Coin Store Section ================= */
.coinstore-hero{
  max-width:900px;margin:0 auto 30px;text-align:center;padding:0 24px;
}
.coin-balance-hero{
  display:inline-flex;align-items:center;gap:14px;
  background:rgba(212,168,67,0.08);border:1px solid rgba(212,168,67,0.3);
  padding:18px 30px;border-radius:18px;margin-top:18px;
}
.coin-balance-hero .big-coin-icon{font-size:34px;}
.coin-balance-hero .coin-balance-value{font-size:30px;font-weight:800;color:#F0C96A;}
.coin-balance-hero .coin-balance-lbl{font-size:12px;color:#A8A09A;letter-spacing:0.5px;text-transform:uppercase;}
 
.free-coins-banner{
  max-width:700px;margin:20px auto;padding:14px 20px;
  background:rgba(46,207,176,0.1);border:1px solid rgba(46,207,176,0.35);
  border-radius:12px;color:#2ECFB0;font-size:13px;text-align:center;
}
 
.coinstore-grid{
  max-width:1200px;margin:0 auto;padding:0 24px 40px;
  display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:18px;
}
.coin-package-card{
  position:relative;background:var(--bg-card,#12141c);
  border:1px solid var(--border,rgba(255,255,255,0.08));
  border-radius:16px;padding:24px 18px;text-align:center;
  display:flex;flex-direction:column;gap:8px;align-items:center;
  transition:transform .2s ease, border-color .2s ease;
}
.coin-package-card:hover{transform:translateY(-4px);border-color:rgba(212,168,67,0.4);}
.coin-package-badge{
  position:absolute;top:-10px;left:50%;transform:translateX(-50%);
  background:linear-gradient(135deg,#E85D7A,#A83050);
  color:#fff;font-size:10px;font-weight:700;letter-spacing:0.5px;
  padding:4px 12px;border-radius:20px;text-transform:uppercase;
}
.coin-package-amount{font-size:22px;font-weight:800;color:#F0C96A;margin-top:8px;}
.coin-package-name{color:#F4F0E8;font-size:13px;font-weight:600;}
.coin-package-price{font-size:20px;font-weight:800;color:#38B6FF;margin:4px 0;}
.coin-buy-btn{width:100%;margin-top:6px;font-size:13px;padding:10px;}
 
.payment-methods-row{
  max-width:700px;margin:24px auto 0;display:flex;align-items:center;justify-content:center;
  gap:18px;flex-wrap:wrap;color:#A8A09A;font-size:12px;
}
.payment-method-chip{
  display:flex;align-items:center;gap:6px;
  border:1px solid rgba(255,255,255,0.08);padding:6px 12px;border-radius:20px;
}
 
.unlock-all-banner{
  max-width:700px;margin:34px auto;padding:20px;text-align:center;
  background:linear-gradient(135deg,rgba(123,92,245,0.12),rgba(46,207,176,0.1));
  border:1px solid rgba(123,92,245,0.35);border-radius:16px;
}
.unlock-all-banner h3{color:#F4F0E8;margin:0 0 6px;font-size:17px;}
.unlock-all-banner p{color:#A8A09A;font-size:13px;margin:0 0 14px;}
.profile-chip{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  height:34px !important;
  background:var(--bg-surface, #111420) !important;
  border:1px solid var(--border, rgba(255,255,255,0.1)) !important;
  color:var(--text-hi) !important;
  font-size:13px !important;
  font-weight:600 !important;
  padding:0 12px 0 6px !important;
  border-radius:999px !important;
  cursor:pointer !important;
  margin:0 !important;
  line-height:1 !important;
  transition: background 0.2s ease, border-color 0.2s ease !important;
}
.profile-chip:hover {
  background: var(--bg-glass2, rgba(255,255,255,0.06)) !important;
  border-color: var(--border2, rgba(255,255,255,0.13)) !important;
}
.profile-avatar{
  width:22px !important;
  height:22px !important;
  border-radius:50% !important;
  background:rgba(34,197,94,0.14) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:11px !important;
  color:var(--green, #22C55E) !important;
  flex-shrink:0 !important;
}
.profile-chip-name {
  font-size: 13px !important;
  font-weight: 500 !important;
}
.profile-panel{
  display:none;
  position:fixed;
  top:70px;
  right:24px;
  width:300px;
  max-height:70vh;
  overflow:hidden;
  background:var(--bg-card);
  border:1px solid var(--border2);
  border-radius:var(--r-lg);
  padding:0;
  z-index:100000;
  box-shadow:0 20px 50px rgba(0,0,0,0.5);
  flex-direction:column;
}
.profile-panel.open{display:flex;}
.profile-panel-head{
  flex-shrink:0;
  border-bottom:1px solid var(--border);
  padding:18px 18px 12px;
}
.profile-name{color:var(--text-hi);font-weight:700;}
.profile-email{color:var(--text-md);font-size:12px;}

.profile-history{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  padding:0 18px;
}
.profile-history-toggle{
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  margin:10px 0 4px;
  padding:8px 0;
  background:none;
  border:none;
  color:var(--text-md);
  font-family:var(--font-body);
  font-size:12px;
  font-weight:600;
  letter-spacing:0.04em;
  text-transform:uppercase;
  cursor:pointer;
  text-align:left;
}
.profile-history-toggle:hover{color:var(--text-hi);}
.profile-history-count{
  color:var(--text-lo);
  font-weight:500;
  letter-spacing:0;
  text-transform:none;
}
.profile-history-chevron{
  margin-left:auto;
  width:8px;
  height:8px;
  border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor;
  transform:rotate(45deg);
  transition:transform 0.2s ease;
  opacity:0.7;
}
.profile-panel:not(.is-collapsed) .profile-history-chevron{
  transform:rotate(-135deg);
  margin-top:4px;
}
.profile-history-list{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  padding-bottom:4px;
}
.profile-panel.is-collapsed .profile-history-list{
  display:none;
}
.profile-history-item{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);}
.profile-history-name{color:var(--text-hi);font-size:13px;}
.profile-history-date{color:var(--text-lo);font-size:11px;}
.profile-history-pct{margin-left:auto;color:var(--gold-lt);font-weight:700;font-size:13px;}
.profile-history-empty{color:var(--text-lo);font-size:12px;text-align:center;padding:16px 0;}

.profile-panel-foot{
  flex-shrink:0;
  padding:12px 18px 18px;
  border-top:1px solid var(--border);
  background:var(--bg-card);
}
.profile-panel-foot .auth-logout-btn{
  width:100%;
  justify-content:center;
}

/* ---- Auth modal (MyGeneRoots) ---- */
.auth-modal-backdrop{
  display:none;
  position:fixed;
  inset:0;
  z-index:100001;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(34,197,94,0.12), transparent 55%),
    rgba(6, 8, 16, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.auth-modal-backdrop.open{ display:flex; animation: authBackdropIn 0.2s ease; }
@keyframes authBackdropIn { from { opacity: 0; } to { opacity: 1; } }

.auth-modal{
  position:relative;
  width:min(100%, 392px);
  padding:28px 28px 22px;
  border-radius:20px;
  border:1px solid var(--border2);
  background:
    linear-gradient(165deg, rgba(255,255,255,0.04) 0%, transparent 42%),
    var(--bg-card);
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.06),
    0 28px 64px rgba(0,0,0,0.55);
  animation: authModalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes authModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="light"] .auth-modal-backdrop{
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(34,197,94,0.1), transparent 55%),
    rgba(15, 23, 42, 0.4);
}
[data-theme="light"] .auth-modal{
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
}

.auth-close-btn{
  position:absolute;
  top:14px;
  right:14px;
  width:32px;
  height:32px;
  border:none;
  border-radius:10px;
  background:transparent;
  color:var(--text-lo);
  font-size:22px;
  line-height:1;
  cursor:pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-close-btn:hover{
  color:var(--text-hi);
  background:var(--bg-glass2);
}

.auth-modal-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin:2px 0 18px;
}
.auth-modal-mark{
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:11px;
  background:rgba(34,197,94,0.1);
  border:1px solid rgba(34,197,94,0.22);
  flex-shrink:0;
}
.auth-modal-brand-name{
  font-family: var(--font-disp, 'Syne', sans-serif);
  font-size:17px;
  font-weight:700;
  letter-spacing:-0.02em;
  color:var(--text-hi);
}

.auth-title{
  margin:0 0 6px;
  font-family: var(--font-disp, 'Syne', sans-serif);
  font-size:26px;
  font-weight:700;
  letter-spacing:-0.03em;
  color:var(--text-hi);
  line-height:1.15;
  text-align:center;
}
.auth-subtitle{
  margin:0 0 20px;
  font-size:13.5px;
  line-height:1.45;
  color:var(--text-md);
  text-align:center;
}

.auth-google-btn{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  min-height:46px;
  padding:0 16px;
  border-radius:12px;
  border:1px solid var(--border2);
  background:var(--bg-surface);
  color:var(--text-hi);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.auth-google-btn:hover{
  background:var(--bg-glass2);
  border-color:rgba(255,255,255,0.2);
}
.auth-google-btn:active{ transform: scale(0.99); }
.auth-google-btn:disabled{ opacity:0.65; cursor:wait; }
.auth-google-btn .google-icon{ flex-shrink:0; }
.auth-google-btn .google-btn-spinner{
  display:none;
  width:16px;
  height:16px;
  border:2px solid var(--border2);
  border-top-color:var(--green);
  border-radius:50%;
  animation: authSpin 0.7s linear infinite;
}
.auth-google-btn.is-loading .auth-google-btn-label,
.auth-google-btn.is-loading .google-icon{ opacity:0.35; }
.auth-google-btn.is-loading .google-btn-spinner{ display:block; position:absolute; right:16px; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-divider{
  display:flex;
  align-items:center;
  gap:12px;
  margin:18px 0 14px;
  color:var(--text-lo);
  font-size:11px;
  font-weight:600;
  letter-spacing:0.06em;
  text-transform:uppercase;
}
.auth-divider::before,
.auth-divider::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--border);
}
.auth-divider span{ white-space:nowrap; }

.auth-field-group{ display:flex; flex-direction:column; gap:12px; }
.auth-field{ display:flex; flex-direction:column; gap:6px; }
.auth-label{
  font-size:12px;
  font-weight:600;
  letter-spacing:0.02em;
  color:var(--text-md);
  text-align:center;
}
.auth-modal input,
.auth-modal .auth-username,
.auth-modal .auth-email,
.auth-modal .auth-password{
  width:100%;
  margin:0;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--bg-surface);
  color:var(--text-hi);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size:14px;
  outline:none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-modal input::placeholder{ color:var(--text-lo); }
.auth-modal input:focus{
  border-color: rgba(34,197,94,0.55);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.16);
}

.auth-error{
  display:none;
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(232,93,122,0.28);
  background:rgba(232,93,122,0.08);
  color:#F5A3B4;
  font-size:12.5px;
  line-height:1.45;
  min-height:0;
}
.auth-error:not([hidden]):not(:empty){ display:block; }
[data-theme="light"] .auth-error{
  color:#B42348;
  background:rgba(232,93,122,0.1);
}

.auth-success{
  display:none;
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(34,197,94,0.28);
  background:rgba(34,197,94,0.1);
  color:var(--green-lt);
  font-size:12.5px;
  line-height:1.45;
}
.auth-success:not([hidden]):not(:empty){ display:block; }
[data-theme="light"] .auth-success{
  color:var(--green-dk);
  background:rgba(34,197,94,0.12);
}

.auth-forgot-btn{
  align-self:center;
  margin-top:2px;
  padding:0;
  border:none;
  background:none;
  color:var(--text-md);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
}
.auth-forgot-btn:hover{
  color:var(--green-lt);
  text-decoration:underline;
  text-underline-offset:2px;
}
.auth-forgot-btn:disabled{
  opacity:0.55;
  cursor:wait;
}
.auth-modal-backdrop[data-mode="signup"] .auth-forgot-btn{ display:none; }
[data-theme="light"] .auth-forgot-btn:hover{ color:var(--green-dk); }

.reset-modal-backdrop{
  display:none;
  position:fixed;
  inset:0;
  z-index:100002;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(34,197,94,0.12), transparent 55%),
    rgba(6, 8, 16, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.reset-modal-backdrop.open{
  display:flex;
  animation: authBackdropIn 0.2s ease;
}
[data-theme="light"] .reset-modal-backdrop{
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(34,197,94,0.1), transparent 55%),
    rgba(15, 23, 42, 0.4);
}
.reset-modal .reset-submit-btn{
  width:100%;
  margin-top:14px;
  min-height:48px;
  border-radius:999px;
  justify-content:center;
  font-size:15px;
  font-weight:700;
  background: var(--green) !important;
  color:#04140A !important;
  border:none !important;
  box-shadow: 0 8px 24px rgba(34,197,94,0.28);
}
.reset-modal .reset-submit-btn:disabled{
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.25);
}
.reset-modal .reset-submit-btn.is-busy:disabled{
  opacity: 0.7;
  cursor: wait;
  filter: none;
}
.reset-modal .reset-submit-btn.is-ready:not(:disabled){
  opacity: 1;
  filter: none;
}

.auth-field-hint{
  margin:0;
  font-size:11.5px;
  line-height:1.35;
  color:var(--text-lo);
}
.auth-field-hint.is-error{ color:#F5A3B4; }
.auth-field-hint:not([hidden]){ display:block; }
[data-theme="light"] .auth-field-hint.is-error{ color:#B42348; }

.auth-modal input.is-invalid{
  border-color: rgba(232,93,122,0.55);
  box-shadow: 0 0 0 3px rgba(232,93,122,0.14);
}
.auth-modal input.is-valid:focus{
  border-color: rgba(34,197,94,0.55);
}

.auth-modal .auth-submit-btn{
  width:100%;
  margin-top:14px;
  min-height:48px;
  border-radius:999px;
  justify-content:center;
  font-size:15px;
  font-weight:700;
  background: var(--green) !important;
  color:#04140A !important;
  border:none !important;
  box-shadow: 0 8px 24px rgba(34,197,94,0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}
.auth-modal .auth-submit-btn:hover:not(:disabled){
  filter: brightness(1.05);
  box-shadow: 0 10px 28px rgba(34,197,94,0.36);
}
.auth-modal .auth-submit-btn:active:not(:disabled){ transform: scale(0.99); }
.auth-modal .auth-submit-btn:disabled{
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.25);
}
.auth-modal .auth-submit-btn.is-busy:disabled{
  opacity: 0.7;
  cursor: wait;
  filter: none;
}
.auth-modal .auth-submit-btn.is-ready:not(:disabled){
  opacity: 1;
  filter: none;
}

.auth-trust-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  margin:14px 0 4px;
  color:var(--text-lo);
  font-size:11.5px;
  line-height:1.35;
  text-align:center;
}
.auth-trust-row svg{ flex-shrink:0; opacity:0.8; }

.auth-switch-mode{
  display:block;
  width:100%;
  margin-top:6px;
  padding:10px 8px;
  border:none;
  background:none;
  color:var(--green-lt);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  text-align:center;
}
.auth-switch-mode:hover{ color:var(--green); text-decoration:underline; text-underline-offset:3px; }
[data-theme="light"] .auth-switch-mode{ color:var(--green-dk); }

:root{
    /* -- palette, exposed as custom properties for easy re-theming -- */
    --digby-fur-hi:   #5c5650;
    --digby-fur-mid:  #332f2a;
    --digby-fur-lo:   #1c1916;
    --digby-belly:    #7d7166;
    --digby-snout-hi: #f0b8a8;
    --digby-snout-lo: #c97c68;
    --digby-tweed-a:  #8a6038;
    --digby-tweed-b:  #5c3d22;
    --digby-tweed-c:  #4c3018;
    --digby-brass-hi: #e8cf8a;
    --digby-brass-lo: #a9822f;
  }



  /* ---------------------------------------------------------------
     WIDGET CONTAINER — fixed, bottom-right, one size knob
     --------------------------------------------------------------- */
.digby-widget{
  --digby-size: clamp(110px, 28vw, 220px);
  position: fixed;
  right: clamp(10px, 4vw, 24px);
  bottom: clamp(8px, 3vw, 16px);
  width: var(--digby-size);
  height: var(--digby-size);
  font-size: calc(var(--digby-size) / 10);
  z-index: 9999;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

  .digby-stage{
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .digby-shadow{
    position: absolute;
    bottom: 0.35em;
    left: 50%;
    width: 4.6em;
    height: 0.7em;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0,0,0,.32) 0%, rgba(0,0,0,0) 72%);
    filter: blur(1px);
    animation: digby-shadow-pulse 3.4s ease-in-out infinite;
  }

  /* ---------------------------------------------------------------
     SPEECH BUBBLE — cheeky, ancestry-flavoured hover line
     --------------------------------------------------------------- */
  .digby-speech-bubble{
    position: absolute;
    bottom: 6.6em;
    left: 50%;
    transform: translate(-50%, 6px);
    background: #fbfaf7;
    color: #2b2620;
    font-size: 0.62em;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    padding: 0.55em 0.8em;
    border-radius: 0.7em;
    box-shadow: 0 0.3em 0.6em rgba(0,0,0,.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
  }
  .digby-speech-bubble::after{
    content:"";
    position:absolute;
    bottom:-0.35em;
    left:50%;
    transform: translateX(-50%);
    border: 0.4em solid transparent;
    border-top-color:#fbfaf7;
  }
  .digby-widget:hover .digby-speech-bubble{
    opacity: 1;
    transform: translate(-50%, 0);
  }

  /* ---------------------------------------------------------------
     DIGBY — the floating root wrapper (idle breathing)
     --------------------------------------------------------------- */
  .digby{
    position: relative;
    width: 6.4em;
    height: 7.4em;
    animation: digby-float 3.4s ease-in-out infinite;
    transform-origin: bottom center;
  }

  @keyframes digby-float{
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-0.32em); }
  }
  @keyframes digby-shadow-pulse{
    0%, 100% { transform: translateX(-50%) scale(1); opacity: .9; }
    50%      { transform: translateX(-50%) scale(.88); opacity: .6; }
  }

  /* ---------------------------------------------------------------
     BODY
     --------------------------------------------------------------- */
  .digby-body{
    position: absolute;
    left: 0.7em;
    bottom: 0;
    width: 5em;
    height: 4.3em;
    border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
    background: radial-gradient(circle at 34% 28%, var(--digby-fur-hi), var(--digby-fur-mid) 55%, var(--digby-fur-lo) 100%);
    box-shadow:
      inset -0.32em -0.3em 0.5em rgba(0,0,0,.5),
      inset  0.2em  0.2em 0.4em rgba(255,255,255,.07),
      0 0.3em 0.5em rgba(0,0,0,.3);
    transition: transform .35s ease;
  }
  .digby-widget:hover .digby-body{ transform: scale(1.025); }

  .digby-belly{
    position: absolute;
    left: 50%;
    bottom: 0.35em;
    width: 2.3em;
    height: 1.9em;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 30%, var(--digby-belly), #5b5148 100%);
    opacity: .85;
  }

  /* ---------------------------------------------------------------
     ARMS / PAWS
     --------------------------------------------------------------- */
  .digby-arm{
    position: absolute;
    width: 1.05em;
    height: 1.05em;
    border-radius: 50%;
    bottom: 0.95em;
    background: radial-gradient(circle at 35% 30%, var(--digby-fur-hi), var(--digby-fur-lo) 100%);
    box-shadow: inset -0.1em -0.1em 0.2em rgba(0,0,0,.45), 0 0.08em 0.12em rgba(0,0,0,.25);
  }
  .digby-arm.digby-arm-left{ left: 0.15em; }
  .digby-arm.digby-arm-right{
    left: 4.55em;
    animation: digby-search-arm 7s ease-in-out infinite;
    transform-origin: 30% 70%;
  }
  .digby-widget:hover .digby-arm.digby-arm-right{
    animation: digby-wave 0.75s ease-in-out infinite;
  }

  @keyframes digby-search-arm{
    0%, 58%   { transform: rotate(0deg) translate(0, 0); }
    66%       { transform: rotate(-10deg) translate(-0.16em, -0.08em); }
    72%       { transform: rotate(2deg) translate(0.14em, -0.2em); }
    78%       { transform: rotate(10deg) translate(0.16em, 0.08em); }
    84%       { transform: rotate(-2deg) translate(-0.1em, 0.16em); }
    90%, 100% { transform: rotate(0deg) translate(0, 0); }
  }
  @keyframes digby-wave{
    0%, 100% { transform: rotate(0deg) translate(0,0); }
    50%      { transform: rotate(-28deg) translate(-0.1em, -0.22em); }
  }

  /* ---- magnifying glass, held by the right paw ---- */
  .digby-magnifier{
    position: absolute;
    left: 0.62em;
    top: -1.55em;
    width: 1.9em;
    height: 2.7em;
    transform: rotate(18deg);
    transform-origin: 15% 92%;
  }
  .digby-magnifier-lens{
    position: absolute;
    top: 0;
    left: 0;
    width: 1.3em;
    height: 1.3em;
    border-radius: 50%;
    border: 0.13em solid var(--digby-brass-lo);
    background:
      linear-gradient(135deg, rgba(255,255,255,.65) 0%, rgba(255,255,255,0) 40%),
      radial-gradient(circle at 65% 70%, rgba(150,195,255,.28), rgba(255,255,255,.04) 65%);
    backdrop-filter: blur(1.5px) saturate(1.4);
    -webkit-backdrop-filter: blur(1.5px) saturate(1.4);
    box-shadow:
      0 0.05em 0.15em rgba(0,0,0,.35),
      inset 0 0 0.3em rgba(255,255,255,.45),
      inset 0 0 0 0.03em rgba(255,255,255,.5);
    overflow: hidden;
  }
  .digby-magnifier-lens::after{
    /* glassy diagonal reflection streak */
    content:"";
    position: absolute;
    top: -10%;
    left: 10%;
    width: 30%;
    height: 130%;
    background: linear-gradient(200deg, rgba(255,255,255,.85), rgba(255,255,255,0) 70%);
    transform: rotate(20deg);
  }
  .digby-magnifier-rim{
    position: absolute;
    top: -0.07em;
    left: -0.07em;
    width: 1.44em;
    height: 1.44em;
    border-radius: 50%;
    background: conic-gradient(var(--digby-brass-hi), var(--digby-brass-lo), var(--digby-brass-hi), var(--digby-brass-lo), var(--digby-brass-hi));
    z-index: -1;
    filter: brightness(1.05);
  }
  .digby-magnifier-handle{
    position: absolute;
    left: 0.95em;
    top: 1.15em;
    width: 0.32em;
    height: 1.35em;
    border-radius: 0.2em;
    background: linear-gradient(160deg, var(--digby-brass-hi), #7a5a25);
    transform: rotate(18deg);
    box-shadow: 0 0.05em 0.1em rgba(0,0,0,.3);
  }

  /* ---------------------------------------------------------------
     HEAD GROUP (tilts for the "clue hunt", lifts on hover)
     --------------------------------------------------------------- */
  .digby-head-group{
    position: absolute;
    left: 1.3em;
    top: 0.15em;
    width: 3.8em;
    height: 3.6em;
    animation: digby-search-head 7s ease-in-out infinite;
    transform-origin: 50% 85%;
    transition: transform .4s ease;
  }
  .digby-widget:hover .digby-head-group{
    animation: none;
    transform: rotate(0deg) translateY(-0.22em);
  }
  @keyframes digby-search-head{
    0%, 58%   { transform: rotate(0deg); }
    66%       { transform: rotate(-7deg); }
    72%       { transform: rotate(3deg); }
    78%       { transform: rotate(6deg); }
    84%       { transform: rotate(-2deg); }
    90%, 100% { transform: rotate(0deg); }
  }

  .digby-ear{
    position: absolute;
    top: 0.15em;
    width: 0.85em;
    height: 0.9em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--digby-fur-hi), var(--digby-fur-lo) 100%);
    box-shadow: inset -0.08em -0.08em 0.15em rgba(0,0,0,.4);
  }
  .digby-ear.digby-ear-left{ left: -0.2em; }
  .digby-ear.digby-ear-right{ left: 3.15em; }

  .digby-head{
    position: absolute;
    left: 0;
    top: 0;
    width: 3.8em;
    height: 3.6em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 25%, var(--digby-fur-hi), var(--digby-fur-mid) 55%, var(--digby-fur-lo) 100%);
    box-shadow:
      inset -0.3em -0.28em 0.45em rgba(0,0,0,.5),
      inset 0.18em 0.18em 0.3em rgba(255,255,255,.08);
  }

  .digby-snout{
    position: absolute;
    left: 50%;
    top: 2.05em;
    width: 1.5em;
    height: 1.2em;
    transform: translateX(-50%);
    border-radius: 50% 50% 55% 55% / 62% 62% 38% 38%;
    background: radial-gradient(circle at 38% 28%, var(--digby-snout-hi), var(--digby-snout-lo) 68%, #b56e5c 100%);
    box-shadow: inset -0.14em -0.14em 0.28em rgba(0,0,0,.22), 0 0.08em 0.12em rgba(0,0,0,.18);
  }
  .digby-nostril{
    position: absolute;
    top: 0.42em;
    width: 0.13em;
    height: 0.19em;
    border-radius: 50%;
    background: #5a2f22;
  }
  .digby-nostril.digby-nostril-left{ left: 0.42em; }
  .digby-nostril.digby-nostril-right{ left: 0.92em; }

  .digby-eye{
    position: absolute;
    top: 1.3em;
    width: 0.5em;
    height: 0.56em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #2b2420, #0a0807 72%);
    overflow: hidden;
    transition: transform .3s ease;
  }
  .digby-eye.digby-eye-left{ left: 0.88em; }
  .digby-eye.digby-eye-right{ left: 2.42em; }
  .digby-widget:hover .digby-eye{ transform: scale(1.28); }

  .digby-eye-shine{
    position: absolute;
    top: 0.07em;
    left: 0.08em;
    width: 0.14em;
    height: 0.14em;
    border-radius: 50%;
    background: #fff;
    opacity: .9;
  }
  .digby-eyelid{
    position: absolute;
    inset: 0;
    background: var(--digby-fur-mid);
    border-radius: 50%;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .085s ease-in;
  }
  .digby-head-group.is-blinking .digby-eyelid{
    transform: scaleY(1);
  }

  .digby-glasses{
    position: absolute;
    left: 0.62em;
    top: 1.58em;
    width: 2.6em;
    height: 0.85em;
    transform: rotate(-7deg);
  }
  .digby-lens{
    position: absolute;
    top: 0;
    width: 0.82em;
    height: 0.82em;
    border-radius: 50%;
    border: 0.075em solid;
    border-color: var(--digby-brass-hi);
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.4), rgba(255,255,255,0) 60%);
    box-shadow: 0 0 0.08em rgba(0,0,0,.3);
  }
  .digby-lens.digby-lens-left{ left: 0; }
  .digby-lens.digby-lens-right{ left: 1.76em; }
  .digby-bridge{
    position: absolute;
    top: 0.36em;
    left: 0.8em;
    width: 0.98em;
    height: 0.07em;
    background: var(--digby-brass-lo);
    border-radius: 0.1em;
  }

  /* ---------------------------------------------------------------
     HAT — deerstalker, sat askew, tips on hover
     --------------------------------------------------------------- */
  .digby-hat{
    position: absolute;
    left: -0.55em;
    top: -1.55em;
    width: 4.6em;
    height: 2.7em;
    transform: rotate(-9deg);
    transform-origin: 50% 92%;
    transition: transform .4s cubic-bezier(.34,1.56,.64,1);
  }
  .digby-widget:hover .digby-hat{
    transform: rotate(-24deg) translateY(-0.32em);
  }

  .digby-hat-brim-back{
    position: absolute;
    left: -0.25em;
    top: 0.55em;
    width: 1.6em;
    height: 0.7em;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--digby-tweed-a), var(--digby-tweed-c));
    opacity: .95;
    z-index: 0;
  }
  .digby-hat-flap{
    position: absolute;
    top: 0.9em;
    width: 0.9em;
    height: 1.55em;
    border-radius: 0 0 0.55em 0.55em / 0 0 0.65em 0.65em;
    background: linear-gradient(165deg, var(--digby-tweed-a), var(--digby-tweed-c));
    box-shadow: inset -0.06em -0.06em 0.1em rgba(0,0,0,.3);
    z-index: 1;
  }
  .digby-hat-flap.digby-hat-flap-left{ left: -0.08em; transform: rotate(-4deg); }
  .digby-hat-flap.digby-hat-flap-right{ left: 3.22em; transform: rotate(4deg); }

  .digby-hat-dome{
    position: absolute;
    left: 0.6em;
    top: 0;
    width: 3.4em;
    height: 1.95em;
    border-radius: 50% 50% 18% 18% / 72% 72% 18% 18%;
    background:
      repeating-linear-gradient(45deg, rgba(0,0,0,.14) 0 0.06em, transparent 0.06em 0.34em),
      repeating-linear-gradient(-45deg, rgba(255,255,255,.08) 0 0.05em, transparent 0.05em 0.34em),
      linear-gradient(165deg, var(--digby-tweed-a) 0%, var(--digby-tweed-b) 55%, var(--digby-tweed-c) 100%);
    box-shadow:
      inset 0 -0.16em 0.22em rgba(0,0,0,.32),
      inset 0 0.1em 0.15em rgba(255,255,255,.1),
      0 0.15em 0.2em rgba(0,0,0,.3);
    z-index: 2;
  }

  .digby-hat-brim-front{
    position: absolute;
    left: 1.35em;
    top: 1.4em;
    width: 2.05em;
    height: 0.95em;
    border-radius: 50%;
    background: linear-gradient(165deg, var(--digby-tweed-a), var(--digby-tweed-c));
    box-shadow: 0 0.1em 0.18em rgba(0,0,0,.35);
    z-index: 3;
  }

  .digby-hat-bow{
    position: absolute;
    left: 1.6em;
    top: -0.12em;
    width: 0.55em;
    height: 0.4em;
    background: radial-gradient(circle at 40% 35%, var(--digby-tweed-a), var(--digby-tweed-c));
    border-radius: 40%;
    z-index: 3;
    box-shadow: 0 0.05em 0.1em rgba(0,0,0,.3);
  }

  /* ---------------------------------------------------------------
     ACCESSIBILITY
     --------------------------------------------------------------- */
  @media (prefers-reduced-motion: reduce){
    .digby, .digby *{
      animation: none !important;
      transition: none !important;
    }
  }

  /* demo page chrome (not part of the widget) */
  .digby-demo-note{
    max-width: 520px;
    margin: 48px;
    color: #444;
    font-size: 14px;
    line-height: 1.5;
  }
  .digby-demo-note code{ background:#e4e4e0; padding: 2px 5px; border-radius: 4px; }
.abilities-grid,.sports-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-top:12px;}
.ability-card,.sport-card{background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);border-radius:12px;padding:14px;text-align:center;}
.ability-icon,.sport-icon{font-size:24px;margin-bottom:6px;}
.ability-name,.sport-name{font-weight:600;font-size:13px;margin-bottom:4px;}
.ability-desc{font-size:11px;color:#A8A09A;margin-bottom:8px;}
.ability-bar,.sport-bar{height:5px;background:rgba(255,255,255,0.06);border-radius:4px;overflow:hidden;}
.ability-bar-fill,.sport-bar-fill{height:100%;background:var(--gold);}
.explainer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:12px;}
.explainer-card{background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);border-radius:12px;padding:14px;}
.explainer-top{display:flex;justify-content:space-between;font-size:12px;color:#A8A09A;margin-bottom:6px;}
.explainer-val{color:#D4A843;font-weight:600;text-transform:capitalize;}
.explainer-text{font-size:12.5px;line-height:1.5;color:#F4F0E8;margin-bottom:8px;}
.explainer-meta{display:flex;justify-content:space-between;font-size:11px;color:#727e96;flex-wrap:wrap;gap:6px;}
.explainer-disclaimer{font-size:11px;color:#727e96;margin-top:4px;}

.rarity-meter-block{background:var(--bg-glass);border:1px solid rgba(212,168,67,0.22);border-radius:14px;padding:16px;margin:14px 0;text-align:center;}
.rarity-meter-value{font-size:26px;font-weight:700;color:#D4A843;}
.rarity-meter-sub{font-size:12px;color:var(--text-md);margin-bottom:8px;}
.rarity-meter-bar{height:6px;background:var(--bg-glass2);border-radius:4px;overflow:hidden;}
.rarity-meter-fill{height:100%;background:#D4A843;}

.health-disclaimer-banner{background:var(--bg-glass);border:1px solid var(--border);border-radius:10px;padding:12px 14px;font-size:12px;color:var(--text-md);margin-bottom:16px;line-height:1.5;}
.health-disclaimer-banner strong{color:var(--text-hi);}
.genetic-tendency-grid,.longevity-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-top:10px;}
.tendency-card,.longevity-card{background:var(--bg-glass);border:1px solid var(--border);border-radius:12px;padding:14px;text-align:center;}
.tendency-icon,.longevity-icon{font-size:22px;margin-bottom:6px;}
.tendency-name,.longevity-name{font-weight:600;font-size:13px;margin-bottom:4px;}
.tendency-desc,.longevity-desc{font-size:11px;color:var(--text-md);}
.longevity-overlap{margin-top:6px;font-size:11px;color:#2ECFB0;font-weight:600;}
.podium-item-wrap, .eth-cell-wrap { display: block; }
.podium-item-wrap { width: 100%; }

.podium-item, .eth-cell { cursor: pointer; transition: background 0.2s; }
.podium-item.expanded, .eth-cell.expanded { background: rgba(212,168,67,0.08); }

.expand-caret { display: inline-block; font-size: 10px; margin-left: 4px; transition: transform 0.25s; opacity: 0.6; }
.expanded .expand-caret { transform: rotate(180deg); }

.eth-expand-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  margin: 0;
}
.eth-expand-panel.open {
  max-height: 600px;
  opacity: 1;
  margin: 6px 0 14px 0;
}

.eth-expand-header {
  font-size: 12px;
  color: #A8A09A;
  padding: 10px 14px 4px;
}
.eth-expand-list {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 10px;
}
.sub-expand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sub-expand-row:last-child { border-bottom: none; }
.sub-expand-flag { font-size: 18px; width: 24px; text-align: center; }
.sub-expand-info { flex: 1; min-width: 0; }
.sub-expand-name { font-size: 13px; font-weight: 600; color: var(--text-hi); }
.sub-expand-region { font-size: 11px; color: #727e96; margin-bottom: 4px; }
.sub-expand-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.sub-expand-fill { height: 100%; border-radius: 4px; }
.sub-expand-pct { font-size: 12px; font-weight: 700; color: #D4A843; min-width: 40px; text-align: right; }
.eth-expand-empty { font-size: 12px; color: #727e96; padding: 10px 14px; }
/* Ensure scrolling is never permanently blocked on main wrapper */
html, body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh;
}

/* Ensure profile/login chip in header is never hidden by page toggles */
header .profile-chip,
header .auth-container {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ============================================================
   RESULTS SECTION — REDESIGN & CLEANUP
   ============================================================ */

/* Quick-jump navigation */
.results-nav {
  position: sticky;
  top: 70px;
  z-index: 40;
  max-width: 1100px;
  margin: 0 auto clamp(10px, 1.6vh, 14px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translateZ(0); /* own compositor layer: keeps sticky blur off the scroll repaint path */
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.results-nav button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-md);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.results-nav button:hover {
  color: var(--text-hi);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

/* Anchor offset so sticky nav + navbar never cover the target card */
#results .reveal-card,
#results .map-card,
#results .charts-row,
#results .results-panel,
#results .full-grid-card,
#results .sub-ethnicity-card,
#results .ancient-civs-card,
#shareCardContainer {
  scroll-margin-top: 110px;
}

/* Results panels (abilities / sports / traits / health) — previously unstyled */
.results-panel {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}

.results-panel:empty {
  display: none;
}

/* ============================================================
   RESULTS EMPTY STATE — #results gets .results-empty (script.js
   updateResultsEmptyState) when no analysis has been run yet.
   ============================================================ */
#results.results-empty.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 60px);
  padding-top: 88px;
  padding-bottom: 48px;
}

#results.results-empty > *:not(#resultsEmptyState) {
  display: none !important;
}

#results.results-empty #resultsEmptyState {
  display: block !important;
}

.results-empty-state {
  max-width: 560px;
  text-align: center;
  padding: 56px 32px;
}

.results-empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid rgba(34,197,94,0.28);
  background: rgba(34,197,94,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.results-empty-state .empty-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.results-empty-state h3 {
  font-family: var(--font-disp, sans-serif);
  font-size: 22px;
  color: var(--text-hi);
  margin-bottom: 10px;
}

.results-empty-state p {
  color: var(--text-md);
  font-size: 14px;
  line-height: 1.7;
}

.results-empty-state .empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* Shared panel header, matches .full-grid-title language */
.rp-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.rp-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.rp-sub {
  font-size: 12.5px;
  color: var(--text-lo);
  line-height: 1.55;
  margin: 8px 0 0;
}

.rp-head { margin-bottom: 18px; }

/* --- Abilities grid --- */
.abilities-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 0;
}

.ability-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s, transform 0.2s;
}

.ability-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.ability-card.top-three {
  border-color: rgba(212, 168, 67, 0.28);
  background: rgba(212, 168, 67, 0.03);
}

.ability-rank {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-lo);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}

.top-three .ability-rank {
  color: var(--gold);
  border-color: rgba(212, 168, 67, 0.4);
  background: rgba(212, 168, 67, 0.1);
}

.ability-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 38px;
}

.ability-icon {
  font-size: 17px;
  line-height: 1;
  margin: 0;
}

.ability-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.3;
  margin: 0;
}

.ability-desc {
  font-size: 12px;
  color: var(--text-md);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.ability-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ability-bar, .sport-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.ability-bar-fill, .sport-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
  transition: width 1s cubic-bezier(.4, 0, .2, 1);
}

.top-three .ability-bar-fill {
  background: var(--gold);
}

.ability-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-md);
  min-width: 26px;
  text-align: right;
}

/* --- Sports grid --- */
.sports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.sport-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  transition: border-color 0.2s, transform 0.2s;
}

.sport-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.sport-card.sport-best {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.03);
}

.sport-best-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.sport-rank {
  font-size: 20px;
  line-height: 1;
}

.sport-rank-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  display: inline-block;
}

.sport-icon {
  font-size: 22px;
  margin: 0;
  line-height: 1;
}

.sport-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-hi);
  margin: 0;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
  text-align: center;
}

/* --- Trait explainers --- */
.explainer-grid { gap: 14px; margin-top: 0; }

.explainer-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  transition: border-color 0.2s;
}

.explainer-card:hover { border-color: var(--border2); }

.explainer-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-lo);
}

.explainer-text { color: var(--text-md); }

.rarity-meter-block { margin: 0 0 18px; }

.rarity-meter-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-lo);
  margin-bottom: 4px;
}

/* --- Health / genetic tendencies --- */
.health-section { margin-top: 24px; }
.health-section:first-of-type { margin-top: 0; }

.health-section .genetic-tendency-grid,
.health-section .longevity-grid { margin-top: 16px; }

.tendency-card, .longevity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: left;
  transition: border-color 0.2s;
}

.tendency-card:hover, .longevity-card:hover { border-color: var(--border2); }

.tendency-desc, .longevity-desc { color: var(--text-md); line-height: 1.5; }

@media (max-width: 768px) {
  .results-nav {
    position: static;
    border-radius: var(--r-md);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .results-panel { padding: 20px 16px; }
}

/* --- Click ripple (animations.js appends .ripple-dot into clicked buttons).
   These rules were missing: without position:absolute the dot became a flex
   item and inflated the button to ~1.6x its size on every click. --- */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-dot {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  transform: scale(0);
  animation: ripple-expand 0.65s ease-out forwards;
}

@keyframes ripple-expand {
  to { transform: scale(1); opacity: 0; }
}
/* ============================================================
   CREDENTIALS / TRUST SECTION
   Link this after style.css:
   <link rel="stylesheet" href="credentials.css">
   ============================================================ */

.cred-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 40px 40px;
  position: relative;
  z-index: 1;
}

.cred-block {
  margin: 0 auto 90px;
  max-width: 1100px;
}
.cred-block:last-child { margin-bottom: 40px; }

.cred-header {
  max-width: 560px;
  margin: 0 auto 40px;
  text-align: center;
}

/* ---------- REVIEWS ---------- */
.cred-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.cred-review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.cred-review-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.cred-stars {
  color: var(--gold, #D4A843);
  font-size: 14px;
  letter-spacing: 2px;
}

.cred-review-text {
  font-size: 13px;
  color: var(--text-md);
  line-height: 1.6;
  flex: 1;
}

.cred-review-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cred-review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.cred-review-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-hi);
}

.cred-review-loc {
  font-size: 11px;
  color: var(--text-lo);
}

/* ---------- HOW IT WORKS / VIDEO ---------- */
.cred-video-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border2);
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}

.cred-video,
.cred-video-iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: none;
}

/* ---------- WHAT YOU GET ---------- */
.cred-whatyouget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.cred-wyg-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.cred-wyg-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.cred-wyg-item:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.cred-wyg-item:hover::after { opacity: 1; }

.cred-wyg-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg-glass2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 14px;
}

.cred-wyg-title {
  font-family: var(--font-disp);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cred-wyg-desc {
  font-size: 12.5px;
  color: var(--text-lo);
  line-height: 1.55;
}

/* ---------- QUOTES ---------- */
.cred-quotes-block {
  margin-bottom: 20px;
}

.cred-quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.cred-quote {
  background: linear-gradient(165deg, rgba(34,197,94,0.05), transparent 60%), var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin: 0;
}

.cred-quote p {
  font-family: var(--font-disp);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1.55;
  letter-spacing: -0.01em;
  font-style: italic;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .cred-section { padding: 10px 16px 20px; }
  .cred-block { margin-bottom: 60px; }
  .cred-reviews-grid,
  .cred-whatyouget-grid,
  .cred-quotes-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   CREDENTIALS / TRUST SECTION
   Link this after style.css:
   <link rel="stylesheet" href="credentials.css">
   ============================================================ */

.cred-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 40px 40px;
  position: relative;
  z-index: 1;
}

.cred-block {
  margin: 0 auto 90px;
  max-width: 1100px;
}
.cred-block:last-child { margin-bottom: 40px; }

.cred-header {
  max-width: 560px;
  margin: 0 auto 40px;
  text-align: center;
}

/* ---------- REVIEWS ---------- */
.cred-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.cred-review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.cred-review-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.cred-stars {
  color: var(--gold, #D4A843);
  font-size: 14px;
  letter-spacing: 2px;
}

.cred-review-text {
  font-size: 13px;
  color: var(--text-md);
  line-height: 1.6;
  flex: 1;
}

.cred-review-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cred-review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--sky));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.cred-review-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-hi);
}

.cred-review-loc {
  font-size: 11px;
  color: var(--text-lo);
}

/* ---------- HOW IT WORKS / VIDEO ---------- */
.cred-video-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border2);
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}

.cred-video,
.cred-video-iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: none;
}

/* ---------- WHAT YOU GET ---------- */
.cred-whatyouget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.cred-wyg-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.cred-wyg-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--green), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.cred-wyg-item:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.cred-wyg-item:hover::after { opacity: 1; }

.cred-wyg-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg-glass2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 14px;
}

.cred-wyg-title {
  font-family: var(--font-disp);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-hi);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cred-wyg-desc {
  font-size: 12.5px;
  color: var(--text-lo);
  line-height: 1.55;
}

/* ---------- QUOTES ---------- */
.cred-quotes-block {
  margin-bottom: 20px;
}

.cred-quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.cred-quote {
  background: linear-gradient(165deg, rgba(34,197,94,0.05), transparent 60%), var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--r-md);
  padding: 20px 22px;
  margin: 0;
}

.cred-quote p {
  font-family: var(--font-disp);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1.55;
  letter-spacing: -0.01em;
  font-style: italic;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .cred-section { padding: 10px 16px 20px; }
  .cred-block { margin-bottom: 60px; }
  .cred-reviews-grid,
  .cred-whatyouget-grid,
  .cred-quotes-grid { grid-template-columns: 1fr; }
}
.cred-wyg-icon {
  width: 32px;            /* Standard icon container size */
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;     /* Space between icon and title */
}

.cred-wyg-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;     /* Keeps aspect ratio intact */
  display: block;
}
/* Add margin below the grid container */
.cred-whatyouget-grid {
  margin-bottom: 3rem; /* Adjust space as needed */
}

/* OR add margin above the quotes container */
.quotes-section-container { /* Replace with your actual quote container class name */
  margin-top: 3rem;
  clear: both; /* Prevents layout collapse if floats were used */
}
/* ============================================================
   GLOBE INTRO ANIMATION — styles
   Drop this file in and link it after your main stylesheet:
   <link rel="stylesheet" href="globe-animation.css">
   ============================================================ */

.globe-intro-overlay {
  position: fixed;
  inset: 0;
  /* Explicit, redundant sizing so the box can't drift off "real" 100vh
     on mobile browsers (address-bar collapse/expand, etc). dvh wins
     where supported, vh is the fallback for older browsers. */
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  background: radial-gradient(ellipse at 50% 40%, #0d1220 0%, #05060b 65%, #020204 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  overflow: hidden;
  font-family: var(--font-body, 'DM Sans', sans-serif);
}

.globe-intro-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.globe-intro-overlay.gi-exiting {
  opacity: 0;
  transition: opacity 0.9s ease;
}

/* ------------------------------------------------------------
   SCROLL LOCK while the intro plays.
   style.css has a global, high-specificity rule:
     html, body { overflow-y: auto !important; height: auto !important; }
   which defeats any `document.body.style.overflow = 'hidden'` the JS
   sets. That's why the page behind the overlay stays scrollable and
   the whole thing visually drifts/settles toward the bottom over the
   ~90s the intro runs.

   Fix: toggle a `.gi-lock` class on <html> AND <body> from JS (see
   the two-line hook below). Two classed selectors + !important beats
   an element-selector + !important rule of equal !important-weight
   because it's later in the cascade AND (for browsers that tie-break
   on specificity too) has higher specificity. This reliably wins.
   ------------------------------------------------------------ */
html.gi-lock,
body.gi-lock {
  overflow: hidden !important;
  height: 100% !important;
  position: fixed !important;
  width: 100% !important;
  top: 0 !important;
  left: 0 !important;
}

/* -------- starfield + globe canvases -------- */
.gi-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.gi-globe {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  transition: top 0.7s ease, transform 0.7s ease;
}

/* After the meteor opener, drop the globe so match reveals have more air above the card */
.globe-intro-overlay.gi-globe-lowered .gi-globe {
  top: 58%;
  transform: translate(-50%, -42%);
}

.gi-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(2,3,6,0.55) 78%, rgba(2,3,6,0.92) 100%);
}

/* -------- top bar: progress + skip -------- */
.gi-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  z-index: 3;
}

.gi-progress {
  display: flex;
  gap: 10px;
}

.gi-progress-dot {
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.14);
  overflow: hidden;
  position: relative;
}

.gi-progress-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg,#38B6FF,#2ECFB0);
  transition: transform 0.3s linear;
}

.gi-progress-dot.gi-done::after { transform: scaleX(1); transition: none; }
.gi-progress-dot.gi-active::after { transform: scaleX(1); }

.gi-skip-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #cfd6e6;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 12px;
  letter-spacing: 0.03em;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.gi-skip-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}

/* -------- caption (top, during "flight") -------- */
.gi-caption {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7f8bab;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 3;
  white-space: nowrap;
}
.gi-caption.gi-show { opacity: 1; }

/* -------- reveal block (bottom third) -------- */
.gi-reveal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 3;
  pointer-events: none;
}

.gi-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #D4A843;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-bottom: 6px;
}

.gi-flag {
  font-size: 46px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.2,1.4,.4,1);
  margin-bottom: 6px;
  filter: drop-shadow(0 0 18px rgba(46,207,176,0.35));
}

.gi-pct-wrap {
  display: flex;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gi-pct-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 84px;
  line-height: 1;
  background: linear-gradient(135deg,#F4F0E8,#38B6FF 55%,#2ECFB0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.gi-pct-sign {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: #2ECFB0;
  margin-top: 12px;
  margin-left: 2px;
}

.gi-eth-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: #F4F0E8;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease 0.05s, transform 0.5s ease 0.05s;
}

.gi-eth-sub {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 13px;
  color: #8c9ab0;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
  max-width: 420px;
}

.gi-reveal.gi-show .gi-rank,
.gi-reveal.gi-show .gi-flag,
.gi-reveal.gi-show .gi-pct-wrap,
.gi-reveal.gi-show .gi-eth-name,
.gi-reveal.gi-show .gi-eth-sub {
  opacity: 1;
  transform: none;
}

/* -------- mute button -------- */
.gi-mute-btn {
  position: absolute;
  bottom: 22px;
  right: 26px;
  z-index: 3;
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #cfd6e6;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body, sans-serif);
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.gi-mute-btn:hover { background: rgba(255,255,255,0.12); }

/* -------- responsive -------- */
@media (max-width: 640px) {
  .gi-pct-num { font-size: 58px; }
  .gi-pct-sign { font-size: 22px; margin-top: 8px; }
  .gi-flag { font-size: 36px; }
  .gi-eth-name { font-size: 20px; }
  .gi-caption { font-size: 10px; top: 70px; }
  .gi-reveal { bottom: 12%; }
}

@media (prefers-reduced-motion: reduce) {
  .globe-intro-overlay,
  .gi-caption,
  .gi-reveal .gi-rank,
  .gi-reveal .gi-flag,
  .gi-reveal .gi-pct-wrap,
  .gi-reveal .gi-eth-name,
  .gi-reveal .gi-eth-sub {
    transition-duration: 0.01ms !important;
  }
}
.photo-share-modal {
  position: fixed; inset: 0; z-index: 999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  padding: 20px;
}
.photo-share-modal.open { display: flex; }
.photo-share-modal-inner {
  position: relative;
  background: var(--bg-card, #0c0f1a);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 16px; padding: 20px;
  max-width: 420px; width: 100%; max-height: 92vh;
  overflow-y: auto; text-align: center;
}
#photoShareCanvas {
  width: 100%; height: auto; border-radius: 12px; display: block;
  background: #05070d;
}
.photo-share-close {
  position: absolute; top: 8px; right: 12px; background: none; border: none;
  color: var(--text-hi, #F2EEE8); font-size: 26px; cursor: pointer; line-height: 1;
}
.photo-share-actions { display: flex; gap: 10px; margin-top: 16px; }
.photo-share-actions button { flex: 1; }
.genetic-comp-grid{
  display:grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap:16px; /* was 14px */
}
.genetic-comp-card{
  padding:16px; /* was 14px, gives text more breathing room */
}
.genetic-comp-bar-row{
  margin:16px 0 22px; /* was 14px 0 20px */
}
.genetic-comp-icon{ font-size:22px; margin-bottom:4px; }
.genetic-comp-name{ font-weight:600; font-size:14px; color:var(--text-hi,#F2EEE8); margin-bottom:4px; }
.genetic-comp-pct{ font-size:22px; font-weight:800; margin-bottom:6px; }
.genetic-comp-desc{ font-size:12px; color:var(--text-lo,#9A9390); line-height:1.4; margin-bottom:8px; }
.genetic-comp-mini-bar{ height:5px; border-radius:3px; background:rgba(255,255,255,0.06); overflow:hidden; }
.genetic-comp-mini-fill{ height:100%; }
.genetic-comp-note{ margin-top:16px; color:var(--text-lo,#5A5650); }
/* ============ FREE PREVIEW TEASER SYSTEM ============ */
.free-teaser-item { position: relative; transition: filter .25s ease; }
.free-teaser-item.is-blurred {
  filter: blur(7px) saturate(60%);
  user-select: none;
  pointer-events: none;
}
.free-teaser-cta {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg-surface);
  text-align: center;
}
.free-teaser-cta-text { font-size: 12.5px; color: var(--text-md); margin-bottom: 10px; }
.free-teaser-cta-text strong { color: var(--text-hi); }

.teaser-full-blur { position: relative; overflow: hidden; }
.teaser-full-blur > *:not(.free-teaser-cta-overlay) {
  filter: blur(7px) saturate(60%);
  user-select: none;
  pointer-events: none;
}
.free-teaser-cta-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 5; background: rgba(10,13,22,0.30); border-radius: inherit;
}
.free-teaser-cta-inner {
  text-align: center; background: var(--bg-card);
  border: 1px solid var(--border2); border-radius: 14px;
  padding: 18px 24px; max-width: 90%;
}
.free-teaser-cta-inner .lock-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: var(--green-lt, #4ADE80);
  font-size: 0;
}
.free-teaser-cta-inner .lock-icon-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.free-teaser-cta-inner .lock-title { font-size: 13px; font-weight: 600; color: #F2EEE8; margin-bottom: 10px; }

.btn-unlock {
  background: var(--green);
  color: #050805; border: none; font-weight: 700; font-size: 12.5px;
  padding: 10px 18px; border-radius: var(--r-md, 12px); cursor: pointer;
}
.btn-unlock:hover { background: var(--green-lt); }

.free-badge {
  position: absolute; top: 6px; right: 6px;
  background: var(--green);
  color: #0a0d16; font-size: 9px; font-weight: 800; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 20px; text-transform: uppercase; z-index: 3;
}
/* Ensure container allows overflow so the globe extends to the right */
.hero-right {
  position: relative;
  overflow: visible !important;
}

.home-globe-canvas {
  position: absolute;
  /* Push it significantly further right so half sits outside the card */
  right: -45%; 
  top: 50%;
  transform: translate3d(0, -50%, 0);
  width: clamp(380px, 46vw, 640px);
  height: clamp(380px, 46vw, 640px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  
  /* Remove canvas outlines or borders */
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.demo-shell {
  position: relative;
  z-index: 2; /* keeps card on top of left side of globe */
  isolation: isolate;
  background: var(--bg-card) !important;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border2) !important;
  box-shadow: 0 28px 64px rgba(0,0,0,0.38), 0 0 0 1px rgba(255,255,255,0.04) !important;
}
.demo-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg-card);
  pointer-events: none;
  border-radius: inherit;
}

[data-theme="light"] .demo-shell {
  background: #fff !important;
  background-color: #fff !important;
  box-shadow: var(--shadow-card, 0 20px 44px rgba(15, 23, 42, 0.12)) !important;
}

/* Hide on narrower widths */
@media (max-width: 1100px) {
  .home-globe-canvas { display: none; }
}
.community-globe-section {
  width: 100%;
  padding: 80px 20px;
  background: #080e1a;
  color: #fff;
  text-align: center;
}

.community-globe-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 480px;
  margin: 30px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.community-globe-canvas {
  width: 100%;
  height: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Floating Person Card */
.community-person-card {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(14, 22, 38, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(46, 207, 176, 0.25);
  padding: 12px 20px;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 5;
}

.community-person-card.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.person-avatar-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
}

.person-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2ECFB0;
}

.person-flag {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 14px;
}

.person-details {
  text-align: left;
}

.person-details h4 {
  margin: 0;
  font-size: 0.98rem;
  color: #fff;
}

.person-ethnicity {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: #2ECFB0;
}
.community-globe-section {
  position: relative;
  width: 100%;
  padding: 100px 20px 80px;
  background: #060a12;
  color: #fff;
  text-align: center;
  overflow: hidden;
  /* Cyber Grid Background Effect */
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Starfield canvas overlay */
.community-stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Ambient Radial Glow behind Globe */
.community-bg-glow {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 80vw);
  height: min(600px, 80vw);
  background: radial-gradient(circle, rgba(46, 207, 176, 0.15) 0%, rgba(16, 38, 70, 0.2) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* Ensure content sits above background layers */
.community-globe-header,
.community-globe-wrapper {
  position: relative;
  z-index: 1;
}
.heatmap-globe-card {
  max-width: 1100px;
  margin: 0 auto clamp(12px, 2vh, 18px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2.2vh, 24px);
}
.heatmap-globe-sub {
  font-size: 12.5px;
  color: var(--text-lo);
  line-height: 1.55;
  margin: -4px 0 16px;
}

.heatmap-globe-container {
  display: flex;
  justify-content: center;
  min-height: 300px;
}

.hmg-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hmg-canvas {
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
}
.hmg-canvas.is-grabbing { cursor: grabbing; }

.hmg-hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-lo);
  text-align: center;
}

.hmg-tooltip {
  position: absolute;
  transform: translate(-50%, -110%);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 160px;
  max-width: 220px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}
.hmg-tooltip.show { opacity: 1; pointer-events: auto; }
.hmg-tooltip-close {
  position: absolute;
  top: 4px; right: 8px;
  background: none; border: none;
  color: var(--text-lo);
  font-size: 16px;
  cursor: pointer;
}
.hmg-tooltip-flag { font-size: 22px; margin-bottom: 4px; }
.hmg-tooltip-name { font-weight: 700; font-size: 13px; color: var(--text-hi); }
.hmg-tooltip-pct { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 2px; }
.hmg-tooltip-region { font-size: 10.5px; color: var(--text-lo); margin-top: 2px; }
.hmg-tooltip-note { font-size: 9.5px; color: var(--text-lo); margin-top: 8px; line-height: 1.4; }

.heatmap-globe-legend { max-width: 320px; margin: 14px auto 0; text-align: center; }
.hmg-legend-title { font-size: 10.5px; color: var(--text-lo); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.hmg-legend-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #38B6FF, #2ECFB0, #D4A843, #E85D5A);
}
.hmg-legend-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-lo); margin-top: 4px; }

.hmg-error { color: var(--text-lo); font-size: 13px; padding: 30px; text-align: center; }
.genetic-comp-card-wrap {
  width: 100%;
  max-width: 1200px; /* Adjust this value to match your container width */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;  /* Keeps spacing clean on smaller screens */
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.history-panel-overlay {
  position: fixed; inset: 0; background: rgba(5,7,13,0.7);
  backdrop-filter: blur(4px); z-index: 9000;
  display: flex; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.history-panel-overlay.open { opacity: 1; pointer-events: auto; }
.history-panel {
  width: min(620px, 100%); height: 100vh; background: var(--bg-card, #0c0f1a);
  border-left: 1px solid var(--border, rgba(255,255,255,0.08));
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.history-panel-overlay.open .history-panel { transform: translateX(0); }
.history-panel-header {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.history-panel-header h2 { flex: 1; margin: 0; font-size: 18px; }
.history-panel-body { flex: 1; overflow-y: auto; padding: 20px; }

.history-card {
  display: flex; gap: 14px; align-items: center; padding: 14px;
  border: 1px solid var(--border, rgba(255,255,255,0.07)); border-radius: 12px;
  margin-bottom: 12px; cursor: pointer; transition: border-color .2s, background .2s;
}
.history-card:hover { border-color: #2ECFB0; background: rgba(46,207,176,0.05); }
.history-card img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #1a1f2e; }
.history-card-info { flex: 1; }
.history-card-date { font-size: 11px; color: var(--text-lo, #9A9390); }
.history-card-top { font-weight: 700; font-size: 15px; }
.history-card-sub { font-size: 12px; color: var(--text-md, #8E8A83); }

.history-detail-section { margin-bottom: 26px; }
.history-detail-section h3 { font-size: 15px; color: #2ECFB0; margin-bottom: 8px; }
.history-narrative { font-size: 14px; line-height: 1.65; color: var(--text-md, #B5B0A9); }
.history-migration-btn {
  margin-top: 10px; background: linear-gradient(90deg,#D4A843,#7B5CF5);
  color: #0a0d16; font-weight: 700; border: none; padding: 10px 18px;
  border-radius: 999px; cursor: pointer;
}
/* Marketing blocks sit outside #home — hide off Home.
   Live demo also shows on Store so shoppers can see analysis in action. */
body:not(:has(#home.active)) .cred-section,
body:not(:has(#home.active)) #what-you-get,
body:not(:has(#home.active)) #celebrity-samples {
  display: none !important;
}
body:not(:has(#home.active)):not(:has(#coinstore.active)) .home-live-demo,
body:not(:has(#home.active)):not(:has(#coinstore.active)) #liveDemoSection {
  display: none !important;
}

/* On Store, keep the demo under the pack table with breathing room */
#coinstore.active ~ .home-live-demo,
body:has(#coinstore.active) .home-live-demo {
  margin-top: 28px;
  margin-bottom: 48px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
  margin-top: 12px;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.site-footer-brand {
  font-size: 13px;
  color: var(--text-lo);
  margin: 0;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
}

.site-footer-nav a {
  color: var(--text-md);
  font-size: 13px;
  text-decoration: none;
}

.site-footer-nav a:hover {
  color: var(--green);
}

.site-footer-staging {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-lo);
}

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 100px 24px 64px;
}

.legal-page h2 {
  font-family: var(--font-disp);
  font-size: 18px;
  margin: 28px 0 8px;
}

.legal-page p,
.legal-page li {
  color: var(--text-md);
  font-size: 15px;
  line-height: 1.7;
}

.legal-page ul {
  padding-left: 20px;
  margin: 8px 0 16px;
}

.legal-updated {
  color: var(--text-lo) !important;
  font-size: 13px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 768px) {
  .hero-wrap {
    padding: 0 16px;
  }

  .hero-split {
    min-height: 0;
    gap: 28px;
    padding: 28px 0 20px;
  }

  .hero-left {
    padding-right: 0;
  }

  .hero-eyebrow {
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: 34px;
    line-height: 1.08;
    letter-spacing: -0.03em;
  }

  .hero-title .t-green {
    font-size: 0.5em;
    margin-top: 10px;
  }

  .hero-sub {
    font-size: 14px;
    margin-bottom: 22px;
    max-width: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 20px;
    gap: 10px;
  }

  .hero-actions .btn-primary,
  .hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .hero-trust-line {
    font-size: 13px;
  }

  .hero-trust {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .trust-divider {
    display: none;
  }

  .trust-item {
    font-size: 13px;
  }

  .demo-shell {
    max-width: 100%;
  }

  /* Home stepper repeats the Upload CTA — keep the example card, drop the chrome */
  .demo-steps {
    display: none;
  }

  #analyzer {
    padding: 84px 14px 28px;
  }

  .analyzer-header {
    margin-bottom: 18px;
  }

  .analyzer-header .section-title {
    font-size: clamp(22px, 6.4vw, 28px);
    line-height: 1.2;
    white-space: normal;
  }

  .analyzer-header .section-sub {
    font-size: 14px;
    line-height: 1.5;
  }

  .analyzer-steps {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    margin-top: 14px;
  }

  .analyzer-steps li {
    flex: 1;
    flex-direction: column;
    text-align: center;
    font-size: 11px;
    gap: 5px;
    line-height: 1.25;
  }

  .step-extra {
    display: none;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }

  .panel-privacy-note {
    max-width: none;
    text-align: left;
    font-size: 11px;
  }

  .upload-zone {
    margin: 12px;
    padding: 28px 16px;
  }

  #analyzer[data-analyzer-step="1"] .upload-zone {
    min-height: 200px;
    padding: 40px 16px;
  }

  .upload-text {
    font-size: 14px;
  }

  .upload-hint {
    font-size: 11px;
    line-height: 1.45;
    padding: 0 4px;
  }

  .photo-tips {
    margin: 0 12px 12px;
    padding: 12px 12px 10px;
  }

  .photo-tips-lead {
    font-size: 12px;
  }

  .camera-controls {
    flex-direction: column;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    position: sticky;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
  }

  #analyzer[data-analyzer-step="3"] .camera-controls {
    position: static;
    padding: 12px 14px;
  }

  .ctrl-btn-capture,
  .ctrl-btn-clear {
    width: 100%;
    flex: none;
    min-height: 48px;
  }

  .detect-cta {
    padding: 12px 14px 8px;
  }

  .landmark-info {
    grid-template-columns: repeat(2, 1fr);
    padding: 10px 12px;
  }

  .analyze-footer {
    position: sticky;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .traits-intro {
    padding: 10px 14px;
    font-size: 12px;
  }

  .trait-guide-frame {
    max-height: min(60vh, 360px);
  }

  .btn-analyze {
    min-height: 48px;
    font-size: 15px;
  }

  .trait-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .trait-name {
    min-width: 0;
  }

  .color-options {
    flex-wrap: wrap;
  }

  .site-footer {
    padding: 20px 16px 24px;
  }

  .legal-page {
    padding: 88px 16px 48px;
  }

  #about {
    padding: 88px 16px 40px;
  }

  #coinstore,
  #familytree {
    padding: 88px 16px 40px;
  }
}

@media (max-width: 560px) {
  .hero-title {
    font-size: 28px;
  }
}

/* ============================================================
   SLIDESHOW ANALYZER — staging flow, professional chrome
   ============================================================ */
#analyzer.slide-mode {
  position: fixed;
  inset: 60px 0 0 0;
  z-index: 40;
  padding: 0;
  background: var(--bg-deep);
  overflow: hidden;
}
#analyzer.slide-mode:not(.active) { display: none !important; }
#analyzer.slide-mode.active { display: block !important; }

.slide-deck {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide-progress-wrap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border, rgba(255,255,255,0.08));
  z-index: 20;
}
.slide-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--green, #22C55E);
  transition: width 0.35s ease;
}

.slide-back-btn,
.slide-close-btn {
  position: absolute;
  top: 16px;
  z-index: 30;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: var(--bg-surface, rgba(255,255,255,0.04));
  color: var(--text-md, #9A9390);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.slide-back-btn { left: 16px; opacity: 0; pointer-events: none; }
.slide-back-btn.visible { opacity: 1; pointer-events: auto; }
.slide-close-btn { right: 16px; }
.slide-back-btn:hover,
.slide-close-btn:hover {
  background: var(--bg-glass2, rgba(255,255,255,0.08));
  color: var(--text-hi, #F2EEE8);
  border-color: var(--border2, rgba(255,255,255,0.18));
}

/* Dock must live inside the active slide — never paint over slides from slide-deck */
.slide-deck > .scan-photo-dock {
  display: none !important;
}

.scan-photo-strip {
  position: sticky;
  top: 0;
  z-index: 6;
  width: 100%;
  margin: 0 0 16px;
  padding: 12px 16px 14px;
  background: var(--bg-deep, #060810);
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scan-photo-dock {
  position: static;
  width: auto;
  margin: 0;
  border-radius: 0;
  overflow: visible;
  border: none;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
}
.slide-inner > .scan-photo-dock:not([hidden]) {
  display: block;
}
.scan-photo-dock[hidden] { display: none !important; }
.scan-photo-dock img {
  display: block;
  width: auto;
  max-width: min(240px, 72vw);
  max-height: 160px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255,255,255,0.14));
  background: var(--bg-card, rgba(255,255,255,0.03));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.slide-deck.has-scan-photo .slide.active .slide-inner {
  max-width: 640px;
}

@media (max-width: 760px) {
  .scan-photo-strip {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    padding: 10px 16px 12px;
  }
  .scan-photo-dock img {
    max-width: min(220px, 78vw);
    max-height: 132px;
  }
  .slide-deck.has-scan-photo .slide.active .slide-inner {
    max-width: none;
  }
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 24px 48px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
  overflow-y: auto;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}
.slide.exit-left {
  opacity: 0;
  transform: translateX(-24px);
}

.slide-inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 32px;
}
.slide-inner-center { text-align: center; }

.slide-eyebrow {
  font-family: var(--font-body, inherit);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green, #22C55E);
  margin-bottom: 8px;
}
.slide-title {
  font-family: var(--font-disp, inherit);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  color: var(--text-hi, #F2EEE8);
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
.slide-sub {
  font-size: 15px;
  color: var(--text-md, #9A9390);
  margin: 0 0 28px;
  line-height: 1.45;
}

.upload-zone-big {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border: 1px dashed var(--border2, rgba(255,255,255,0.16));
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card, rgba(255,255,255,0.02));
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-zone-big:hover,
.upload-zone-big.dragover {
  border-color: var(--green, #22C55E);
  background: rgba(34, 197, 94, 0.06);
}
.file-input-hidden {
  /* Off-screen: covering the drop zone with opacity:0 leaks WebKit "No file chosen". */
  position: fixed !important;
  left: -100vw !important;
  top: 0 !important;
  inset: auto !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  pointer-events: none !important;
}
.upload-icon-big {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green, #22C55E);
}
.upload-text-big { font-size: 16px; color: var(--text-hi); font-weight: 600; }
.upload-text-big span { color: var(--green, #22C55E); }
.upload-hint-big { font-size: 13px; color: var(--text-lo, #5A5650); margin-top: 8px; }

.upload-privacy-note {
  margin: 14px 0 0;
  max-width: 34rem;
  margin-inline: auto;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-md, #9A9390);
}
.upload-privacy-note--compact {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-lo, #5A5650);
}

/* Photo privacy consent modal (upload gate) */
.photo-privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.photo-privacy-modal.open {
  display: flex;
}
.photo-privacy-modal-inner {
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 92dvh);
  overflow-y: auto;
  background: var(--bg-card, #0c0f1a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 28px 24px 22px;
  text-align: left;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.photo-privacy-title {
  margin: 0 0 12px;
  font-family: var(--font-display, inherit);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi, #F2EEE8);
  line-height: 1.25;
}
.photo-privacy-body {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-md, #9A9390);
}
.photo-privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-hi, #F2EEE8);
  cursor: pointer;
  user-select: none;
}
.photo-privacy-check input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--green, #22C55E);
  cursor: pointer;
}
.photo-privacy-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.photo-privacy-actions .btn-secondary {
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
}
.photo-privacy-actions .btn-next {
  margin-left: 0;
  min-width: 120px;
}
.photo-privacy-actions .btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
html.photo-privacy-open {
  overflow: hidden;
}

/* Scan pack / tier picker (Run Analysis) */
.tier-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 10055;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tier-picker-modal.open {
  display: flex;
}
.tier-picker-modal-inner {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card, #0c0f1a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  padding: 24px 22px 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.tier-picker-title {
  margin: 0 0 8px;
  font-family: var(--font-display, inherit);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi, #F2EEE8);
}
.tier-picker-body {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-md, #9A9390);
}
.tier-picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.tier-picker-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-hi, #F2EEE8);
  font-family: var(--font-body, inherit);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tier-picker-opt:hover {
  border-color: rgba(46, 207, 176, 0.45);
  background: rgba(46, 207, 176, 0.08);
}
.tier-picker-opt-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-md, #9A9390);
}
.tier-picker-cancel {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-md, #9A9390);
  font-size: 13px;
  padding: 10px;
  cursor: pointer;
}
.tier-picker-cancel:hover {
  color: var(--text-hi, #F2EEE8);
}
[data-theme="light"] .tier-picker-modal-inner {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .tier-picker-opt {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.1);
  color: #1a1a1a;
}

.detect-status-panel { margin-top: 24px; }
.detect-canvas-wrap {
  position: relative;
  max-width: 340px;
  margin: 0 auto 16px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.detect-canvas-wrap canvas { width: 100%; display: block; }
#analyzer.slide-mode #uploadOverlay { position: absolute; top: 0; left: 0; }
.detect-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.detect-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--green, #22C55E);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.detect-status-text { font-size: 14px; color: var(--text-md); }
.detect-status-text.success { color: var(--green, #22C55E); font-weight: 600; }
.detect-status-text.error { color: var(--text-md); }

.landmark-verify-note {
  display: none !important;
}

#landmarkVerifyModal .landmark-verify-actions {
  justify-content: stretch;
}
#landmarkVerifyModal .landmark-verify-actions .btn-next {
  width: 100%;
  margin-left: 0;
  justify-content: center;
}

.upload-remove-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: transparent;
  color: var(--text-md, #9A9390);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.upload-remove-btn:hover {
  color: var(--text-hi, #F2EEE8);
  border-color: var(--border2, rgba(255,255,255,0.18));
  background: var(--bg-glass2, rgba(255,255,255,0.04));
}
.upload-remove-btn[hidden] { display: none !important; }

.region-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) { .region-grid { grid-template-columns: repeat(3, 1fr); } }
.region-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.region-card:hover { border-color: var(--border2); background: var(--bg-glass2); }
.region-card.selected {
  border-color: var(--green, #22C55E);
  background: rgba(34, 197, 94, 0.1);
}
.region-card-flag { font-size: 22px; margin-bottom: 6px; }
.region-card-name { font-size: 13px; font-weight: 600; color: var(--text-hi); }

.trait-slide-group { margin-bottom: 24px; }
.trait-slide-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 10px;
}

.color-options-big { display: flex; flex-wrap: wrap; gap: 10px; }
.color-dot-big {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
  transition: border-color 0.15s ease;
}
.color-dot-big.selected { border-color: var(--green, #22C55E); }

.option-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 560px) { .option-card-grid { grid-template-columns: repeat(3, 1fr); } }
.option-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body, inherit);
  color: var(--text-md);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.option-card--with-example {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 8px 8px;
  min-width: 0;
}
.option-card-label {
  display: block;
  line-height: 1.25;
}
.option-card-example {
  display: block;
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-deep, #060810);
  pointer-events: none;
  user-select: none;
}
.option-card-example--eye,
.option-card-example--hair {
  position: relative;
  overflow: hidden;
  object-fit: cover;
}
.option-card-example--eye .eye-shape-canvas,
.option-card-example--hair .hair-texture-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
  user-select: none;
}
.option-card:hover { border-color: var(--border2); color: var(--text-hi); }
.option-card.selected {
  border-color: var(--green, #22C55E);
  background: rgba(34, 197, 94, 0.1);
  color: var(--text-hi);
}


/* Height comparison model (step 10) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.height-model {
  --hm-pad-top: 22px;
  --hm-pad-bottom: 10px;
  --hm-label-h: 30px;
  --hm-plot-inset-l: 44px;
  --hm-plot-inset-r: 16px;
  --hm-slider-inset: 11px;
  --hm-accent: color-mix(in srgb, var(--green, #22C55E) 62%, #a7f3d0);
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 4px;
}
.height-model-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.height-model-readout-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.height-model-cm {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  color: var(--text-hi);
  line-height: 1;
}
.height-model-cm-num {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: clamp(34px, 7.2vw, 44px);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1, "lnum" 1;
  line-height: 1;
}
.height-model-cm-unit {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: clamp(15px, 3.2vw, 18px);
  font-weight: 500;
  color: var(--text-md, var(--text-lo));
  letter-spacing: 0.01em;
  line-height: 1;
  padding-bottom: 0.12em;
}
.height-model-ft {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-lo);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
}
.height-model-bucket {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hm-accent);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--green, #22C55E) 30%, transparent);
  background: color-mix(in srgb, var(--green, #22C55E) 9%, transparent);
  line-height: 1;
  flex-shrink: 0;
}
.height-model-stage {
  position: relative;
  height: clamp(248px, 46vw, 312px);
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--green, #22C55E));
  background:
    radial-gradient(90% 55% at 68% 18%, color-mix(in srgb, var(--green, #22C55E) 5%, transparent) 0%, transparent 55%),
    radial-gradient(110% 70% at 50% 100%, color-mix(in srgb, var(--green, #22C55E) 4%, transparent) 0%, transparent 58%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg-card, #0c0f1a) 94%, #151c2a) 0%,
      var(--bg-deep, #060810) 100%);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent),
    0 10px 28px rgba(0, 0, 0, 0.18);
}
.height-model-grid {
  position: absolute;
  left: var(--hm-plot-inset-l);
  right: var(--hm-plot-inset-r);
  top: var(--hm-pad-top);
  bottom: calc(var(--hm-pad-bottom) + var(--hm-label-h));
  pointer-events: none;
  z-index: 0;
}
.height-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid color-mix(in srgb, var(--border2, #3a4154) 42%, transparent);
  opacity: 0.5;
}
.height-grid-line--minor {
  border-top-style: dotted;
  opacity: 0.22;
}
.height-model-ruler {
  position: absolute;
  left: 8px;
  top: var(--hm-pad-top);
  bottom: calc(var(--hm-pad-bottom) + var(--hm-label-h));
  width: 32px;
  pointer-events: none;
  z-index: 2;
}
.height-ruler-mark {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-lo);
  line-height: 1;
  letter-spacing: 0.01em;
}
.height-ruler-mark i {
  display: block;
  width: 9px;
  height: 1px;
  background: color-mix(in srgb, var(--border2, #3a4154) 80%, transparent);
  flex-shrink: 0;
}
.height-ruler-mark--minor i {
  width: 5px;
  opacity: 0.65;
}
.height-ruler-mark--minor span { display: none; }
.height-model-guide {
  position: absolute;
  left: var(--hm-plot-inset-l);
  right: var(--hm-plot-inset-r);
  height: 0;
  border-top: 1px dashed color-mix(in srgb, var(--green, #22C55E) 42%, transparent);
  pointer-events: none;
  transition: top 0.14s ease;
  z-index: 3;
}
.height-model-guide::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hm-accent) 92%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green, #22C55E) 14%, transparent);
}
.height-model-guide-cap {
  position: absolute;
  left: 72%;
  top: -5px;
  transform: translate(-50%, -100%);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--hm-accent);
  background: color-mix(in srgb, var(--bg-deep, #060810) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--green, #22C55E) 28%, transparent);
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: top 0.14s ease, transform 0.14s ease;
}
.height-model-guide.is-near-top .height-model-guide-cap {
  top: 6px;
  transform: translate(-50%, 0);
}
.height-model-plot {
  position: absolute;
  left: var(--hm-plot-inset-l);
  right: var(--hm-plot-inset-r);
  top: var(--hm-pad-top);
  bottom: var(--hm-pad-bottom);
  z-index: 1;
}
.height-model-figures {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(36px, 10vw, 64px);
  padding: 0 10px;
}
.height-fig {
  --cm: 170;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  width: clamp(58px, 18vw, 82px);
  position: relative;
}
.height-fig-body {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  /* Full plot column; visual height comes from scaleY(--cm / max) so slider clearly grows/shrinks the figure */
  height: calc(100% - var(--hm-label-h));
  transform: scaleY(var(--scale, calc(var(--cm) / 205)));
  transform-origin: bottom center;
  transition: transform 0.14s ease;
  position: relative;
  margin-bottom: 2px;
  will-change: transform;
}
.height-fig-svg {
  width: auto;
  height: 100%;
  max-width: 72px;
  display: block;
  overflow: visible;
}
.height-fig-svg path,
.height-fig-svg circle {
  fill: currentColor;
}
.height-fig-shadow {
  fill: currentColor;
  opacity: 0.16;
}
.height-fig--ref {
  color: color-mix(in srgb, var(--text-lo) 70%, #9aa3b5);
  opacity: 0.72;
}
.height-fig--you {
  color: var(--hm-accent);
  z-index: 1;
}
.height-fig--you .height-fig-svg {
  filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--green, #22C55E) 9%, transparent));
}
.height-fig--you .height-fig-shadow {
  opacity: 0.18;
}
.height-fig-tag {
  flex: 0 0 var(--hm-label-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-hi);
  background: color-mix(in srgb, var(--bg-card, #0c0f1a) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--border2, #3a4154) 55%, transparent);
  padding: 0 10px;
  height: 20px;
  border-radius: 999px;
  pointer-events: none;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.height-fig--ref .height-fig-tag {
  color: var(--text-lo);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.height-fig--you .height-fig-tag {
  color: var(--hm-accent);
  border-color: color-mix(in srgb, var(--green, #22C55E) 32%, transparent);
  background: color-mix(in srgb, var(--green, #22C55E) 10%, var(--bg-deep, #060810));
}
.height-model-floor {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: var(--hm-label-h);
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--border2, #3a4154) 70%, transparent) 14%,
    color-mix(in srgb, var(--border2, #3a4154) 70%, transparent) 86%,
    transparent 100%);
  z-index: 0;
  pointer-events: none;
}
.height-model-floor-glow {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -6px;
  height: 18px;
  background: radial-gradient(ellipse at center,
    color-mix(in srgb, var(--green, #22C55E) 6%, transparent) 0%,
    transparent 74%);
  pointer-events: none;
}
.height-model-slider-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 2px;
  --pct: 41.6667%;
}
.height-model-slider-ticks {
  position: absolute;
  left: var(--hm-slider-inset);
  right: var(--hm-slider-inset);
  top: 50%;
  transform: translateY(-50%);
  height: 12px;
  pointer-events: none;
  z-index: 0;
}
.height-slider-tick {
  position: absolute;
  top: 2px;
  width: 1px;
  height: 8px;
  background: color-mix(in srgb, var(--border2, #3a4154) 70%, transparent);
  transform: translateX(-50%);
  opacity: 0.4;
}
.height-slider-tick--major {
  height: 12px;
  top: 0;
  opacity: 0.85;
  background: color-mix(in srgb, var(--text-lo) 55%, transparent);
}
.height-model-slider {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--green, #22C55E);
}
.height-model-slider:focus {
  outline: none;
}
.height-model-slider:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--green, #22C55E) 24%, transparent),
    0 1px 5px rgba(0, 0, 0, 0.32);
}
.height-model-slider:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--green, #22C55E) 24%, transparent),
    0 1px 5px rgba(0, 0, 0, 0.32);
}
.height-model-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--green, #22C55E) 90%, #86efac) 0%,
    color-mix(in srgb, var(--green, #22C55E) 90%, #86efac) var(--pct),
    color-mix(in srgb, var(--border2, #3a4154) 55%, transparent) var(--pct),
    color-mix(in srgb, var(--border2, #3a4154) 55%, transparent) 100%
  );
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.18);
}
.height-model-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border2, #3a4154) 55%, transparent);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.18);
}
.height-model-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green, #22C55E) 90%, #86efac);
}
.height-model-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--green, #22C55E) 88%, #bbf7d0);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.3),
    0 0 0 1px color-mix(in srgb, var(--green, #22C55E) 18%, transparent);
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}
.height-model-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid color-mix(in srgb, var(--green, #22C55E) 88%, #bbf7d0);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.3),
    0 0 0 1px color-mix(in srgb, var(--green, #22C55E) 18%, transparent);
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}
.height-model-slider:active::-webkit-slider-thumb {
  transform: scale(1.06);
}
.height-model-slider:active::-moz-range-thumb {
  transform: scale(1.06);
}
.height-model-scale {
  position: relative;
  height: 16px;
  margin-top: -6px;
  margin-left: var(--hm-slider-inset);
  margin-right: var(--hm-slider-inset);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-lo);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.height-model-scale-mark {
  position: absolute;
  left: var(--p);
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1.2;
}
.height-model-scale-mark.is-min {
  transform: translateX(0);
}
.height-model-scale-mark.is-max {
  transform: translateX(-100%);
}
.height-model-scale-mark.is-ref {
  color: color-mix(in srgb, var(--text-lo) 82%, var(--hm-accent));
}
[data-theme="light"] .height-model {
  --hm-accent: color-mix(in srgb, var(--green, #16a34a) 88%, #052e16);
}
[data-theme="light"] .height-model-stage {
  background:
    radial-gradient(110% 70% at 50% 100%, color-mix(in srgb, var(--green, #22C55E) 6%, transparent) 0%, transparent 58%),
    linear-gradient(180deg, #f7f9fb 0%, #e8eef4 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
[data-theme="light"] .height-fig--ref {
  color: #7a8494;
  opacity: 0.85;
}
[data-theme="light"] .height-fig-tag {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .height-fig--you .height-fig-tag {
  background: color-mix(in srgb, var(--green, #22C55E) 10%, #fff);
}
[data-theme="light"] .height-model-guide-cap {
  background: rgba(255, 255, 255, 0.94);
}
[data-theme="light"] .height-model-slider::-webkit-slider-thumb,
[data-theme="light"] .height-model-slider::-moz-range-thumb {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}
@media (max-width: 480px) {
  .height-model {
    --hm-plot-inset-l: 38px;
    --hm-plot-inset-r: 10px;
    --hm-label-h: 26px;
    gap: 14px;
  }
  .height-model-cm-num {
    font-size: 32px;
  }
  .height-model-cm-unit {
    font-size: 15px;
  }
  .height-model-stage {
    height: 228px;
    border-radius: 16px;
  }
  .height-model-figures {
    gap: 28px;
    padding: 0 4px;
  }
  .height-fig {
    width: 56px;
  }
  .height-fig-svg {
    max-width: 58px;
  }
  .height-fig-tag {
    font-size: 8px;
    padding: 0 7px;
    height: 18px;
  }
  .height-model-guide-cap {
    font-size: 9px;
    padding: 2px 6px;
  }
}

.slide-range { width: 100%; accent-color: var(--green, #22C55E); margin-bottom: 6px; }
.slide-range-val { font-size: 13px; color: var(--text-lo); }

.slide-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.slide-nav-row-single { justify-content: flex-end; }
.run-analysis-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text-lo, #8a9099);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.btn-back-inline,
.slide-skip-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-md);
  font-family: var(--font-body, inherit);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
.slide-skip-btn {
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 11px 8px;
}
.btn-back-inline:hover,
.slide-skip-btn:hover { color: var(--text-hi); }

.btn-next,
.btn-analyze-big {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  background: var(--green, #22C55E);
  color: #050805;
  font-family: var(--font-body, inherit);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn-next:hover:not(:disabled),
.btn-analyze-big:hover { background: var(--green-lt, #4ADE80); }
.btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-next-arrow { transition: transform 0.15s ease; }
.btn-next:hover:not(:disabled) .btn-next-arrow { transform: translateX(2px); }

#slide-final .slide-nav-row { justify-content: space-between; }
#slide-final .btn-analyze-big {
  width: auto;
  flex: 1;
  margin-top: 0;
}

.dna-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  position: relative;
}
.dna-spinner div {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green, #22C55E);
  animation: dnaOrbit 1.4s ease-in-out infinite;
}
.dna-spinner div:nth-child(2) { animation-delay: 0.2s; opacity: 0.8; }
.dna-spinner div:nth-child(3) { animation-delay: 0.4s; opacity: 0.6; }
.dna-spinner div:nth-child(4) { animation-delay: 0.6s; opacity: 0.4; }
@keyframes dnaOrbit {
  0%, 100% { transform: translate(18px, 0) scale(1); }
  50% { transform: translate(-18px, 0) scale(0.7); }
}

.trait-guide-card-slide {
  margin-top: 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
  flex-shrink: 0;
}
.trait-guide-card-slide span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-lo);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.trait-guide-card-slide img {
  width: 100%;
  max-height: min(42vh, 320px);
  border-radius: 8px;
  display: block;
  object-fit: contain;
  background: var(--bg-deep, #060810);
}

@media (max-width: 768px) {
  #analyzer.slide-mode {
    inset: calc(60px + env(safe-area-inset-top, 0px)) 0 calc(62px + env(safe-area-inset-bottom, 0px)) 0;
  }
  .slide {
    display: flex;
    flex-direction: column;
    padding: 52px 16px 8px;
    -webkit-overflow-scrolling: touch;
  }
  .slide-inner {
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 0;
  }
  .slide-title,
  .slide-sub {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
  .slide-nav-row {
    position: sticky;
    bottom: 0;
    z-index: 8;
    flex-shrink: 0;
    margin-top: 16px;
    margin-left: -16px;
    margin-right: -16px;
    padding: 12px 16px 8px;
    background: linear-gradient(to top, var(--bg-deep) 72%, transparent);
    border-top: 0;
    flex-wrap: wrap;
  }
  .btn-next,
  .btn-analyze-big {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 2 !important;
    flex: 1 1 auto;
    min-height: 48px;
    width: auto;
    margin-left: 0;
    font-size: 15px;
  }
  #slide-final .btn-analyze-big {
    width: auto;
    flex: 1 1 auto;
  }
  .btn-back-inline,
  .slide-skip-btn {
    min-height: 44px;
  }
  .slide-back-btn,
  .slide-close-btn {
    top: 10px;
    width: 36px;
    height: 36px;
  }
  .slide-back-btn { left: 10px; }
  .slide-close-btn { right: 10px; }
  .option-card {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .option-card--with-example {
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
  }
  .option-card-example {
    max-width: 120px;
  }
  .region-card {
    min-height: 72px;
  }
}
@media (max-width: 480px) {
  .region-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   LIGHT THEME — match dark-mode contrast and card depth
   ============================================================ */
[data-theme="light"] body::after {
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(34,197,94,0.07) 0%, transparent 58%),
    radial-gradient(ellipse 50% 40% at 92% 100%, rgba(56,182,255,0.05) 0%, transparent 55%);
}

[data-theme="light"] .demo-shell,
[data-theme="light"] .chart-card,
[data-theme="light"] .full-grid-card,
[data-theme="light"] .results-panel,
[data-theme="light"] .heatmap-globe-card,
[data-theme="light"] .scan-compare-scroll,
[data-theme="light"] .ft-gate-card,
[data-theme="light"] .results-empty-state,
[data-theme="light"] .cred-review-card,
[data-theme="light"] .cred-wyg-item {
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .ft-gate-card {
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .cred-review-card:hover,
[data-theme="light"] .cred-wyg-item:hover {
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: var(--glow-green), 0 10px 24px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .desktop-nav-links .nav-btn:hover,
[data-theme="light"] .desktop-nav-links .nav-btn.active {
  background: var(--bg-surface) !important;
  border-color: var(--border2) !important;
}

[data-theme="light"] .demo-pheno-row,
[data-theme="light"] .cred-review-author {
  border-bottom-color: var(--border);
  border-top-color: var(--border);
}

[data-theme="light"] .loading-overlay {
  background: rgba(232, 238, 244, 0.94);
}

[data-theme="light"] .auth-modal input,
[data-theme="light"] .auth-modal .auth-username,
[data-theme="light"] .auth-modal .auth-email,
[data-theme="light"] .auth-modal .auth-password {
  background: #F1F5F9;
  border-color: rgba(15, 23, 42, 0.16);
}

[data-theme="light"] .auth-google-btn {
  border-color: rgba(15, 23, 42, 0.16);
  background: #fff;
}

[data-theme="light"] .auth-modal .auth-submit-btn:disabled {
  opacity: 1;
  background: #BBF7D0 !important;
  color: #166534 !important;
  box-shadow: none;
  filter: none;
}

[data-theme="light"] .auth-modal .auth-submit-btn.is-ready:not(:disabled) {
  background: var(--green) !important;
  color: #04140A !important;
}

[data-theme="light"] .sub-eth-group,
[data-theme="light"] .eth-expand-list,
[data-theme="light"] .ability-card,
[data-theme="light"] .sport-card,
[data-theme="light"] .explainer-card,
[data-theme="light"] .tendency-card,
[data-theme="light"] .longevity-card {
  background: var(--bg-surface);
  border-color: var(--border);
}

[data-theme="light"] .sub-eth-group-header,
[data-theme="light"] .sub-expand-row {
  border-bottom-color: var(--border);
}

[data-theme="light"] .sub-eth-group-pct {
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .sub-eth-item {
  background: #fff;
  border: 1px solid var(--border);
}

[data-theme="light"] .sub-eth-bar-track,
[data-theme="light"] .sub-expand-bar,
[data-theme="light"] .ability-bar,
[data-theme="light"] .sport-bar,
[data-theme="light"] .civ-progress,
[data-theme="light"] .genetic-comp-mini-bar {
  background: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .explainer-text {
  color: var(--text-hi);
}

[data-theme="light"] .explainer-top,
[data-theme="light"] .ability-desc,
[data-theme="light"] .explainer-meta,
[data-theme="light"] .explainer-disclaimer,
[data-theme="light"] .eth-expand-header,
[data-theme="light"] .sub-expand-region {
  color: var(--text-md);
}

[data-theme="light"] .free-teaser-cta-inner .lock-title {
  color: var(--text-hi);
}

[data-theme="light"] .ft-tree-canvas {
  background: var(--bg-surface);
}

[data-theme="light"] .combo-chip {
  background: var(--bg-surface);
}

[data-theme="light"] .community-globe-section {
  background: var(--bg-deep);
  color: var(--text-hi);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
}

[data-theme="light"] .community-stars-canvas {
  display: none;
}

[data-theme="light"] .community-globe-header h2 {
  color: var(--text-hi);
}

[data-theme="light"] .community-globe-header p {
  color: var(--text-md);
}

[data-theme="light"] .community-globe-wrapper {
  background: #0B1220;
  border-radius: 24px;
  border: 1px solid var(--border2);
  overflow: hidden;
}

[data-theme="light"] .community-person-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--border2);
}

[data-theme="light"] .person-details h4 {
  color: var(--text-hi);
}

[data-theme="light"] .section-wyg {
  background: var(--bg-deep);
  color: var(--text-hi);
}

[data-theme="light"] .wy-eyebrow {
  color: var(--green-dk);
}

[data-theme="light"] .wy-title {
  color: var(--text-hi);
}

[data-theme="light"] .wy-sub,
[data-theme="light"] .wy-card-info p {
  color: var(--text-md);
}

[data-theme="light"] .wy-card {
  background: var(--bg-card);
  border-color: var(--border2);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .wy-card.depth-0 {
  border-color: rgba(34, 197, 94, 0.45);
}

[data-theme="light"] .wy-img-box {
  background: var(--bg-surface);
}

[data-theme="light"] .wy-card-info h3 {
  color: var(--text-hi);
}

[data-theme="light"] .wy-nav-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border2);
  color: var(--text-hi);
}

[data-theme="light"] .wy-nav-btn:hover {
  background: var(--green);
  color: #fff;
}

[data-theme="light"] .wy-dot {
  background: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .wy-dot.active {
  background: var(--green);
}

[data-theme="light"] .option-card {
  background: #fff;
  border-color: var(--border2);
}

[data-theme="light"] .option-card-example {
  background: #0f141c;
}

[data-theme="light"] .option-card.selected {
  color: var(--text-hi);
  background: rgba(34, 197, 94, 0.12);
}

[data-theme="light"] .btn-next:disabled {
  opacity: 1;
  background: #BBF7D0;
  color: #166534;
}

[data-theme="light"] .slide-progress-wrap {
  background: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .btn-secondary {
  background: #fff;
  border-color: var(--border2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .upload-zone-big {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .trait-guide-card-slide,
[data-theme="light"] .region-card,
[data-theme="light"] .option-card {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .slide-back-btn,
[data-theme="light"] .slide-close-btn {
  background: var(--bg-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.eth-expand-tabs { display:flex; gap:8px; margin-bottom:14px; }
.eth-tab-btn {
  background:transparent; border:1px solid var(--border); color:var(--text-md);
  padding:6px 14px; border-radius:20px; font-size:12px; cursor:pointer; transition:.2s;
}
.eth-tab-btn.active { background:var(--green); color:#000; border-color:var(--green); }
.eth-tab-pane { display:none; } .eth-tab-pane.active { display:block; animation: fadeSlideUp .35s ease; }

.migration-story { position:relative; }
.story-badge {
  display:inline-block; font-size:11px; padding:3px 10px; border-radius:12px; margin-bottom:8px;
  text-transform:uppercase; letter-spacing:.03em;
}
.story-badge-strong { background:rgba(46,207,176,.18); color:#2ECFB0; }
.story-badge-moderate { background:rgba(212,168,67,.18); color:#D4A843; }
.story-badge-distant { background:rgba(123,92,245,.18); color:#7B5CF5; }

.story-timeline { position:relative; padding-left:28px; margin:18px 0; }
.story-node { position:relative; padding-bottom:8px; }
.story-node::before {
  content:''; position:absolute; left:-28px; top:4px; width:2px; height:100%;
  background:linear-gradient(to bottom, var(--green), transparent);
}
.story-node-icon {
  position:absolute; left:-40px; top:0; width:26px; height:26px; border-radius:50%;
  background:var(--bg-card); border:2px solid var(--green); display:flex; align-items:center;
  justify-content:center; font-size:14px;
}
.story-node-era { font-size:11px; color:var(--text-lo); text-transform:uppercase; letter-spacing:.05em; }
.story-node-title { font-size:15px; font-weight:700; color:var(--text-hi); margin:2px 0 6px; }
.story-node-text { font-size:13px; line-height:1.55; color:var(--text-md); }

.shared-pillars-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.shared-pillar-chip {
  border:1px solid; border-radius:10px; padding:5px 10px; font-size:12px; display:flex; gap:6px; align-items:center;
}
.shared-pillar-pcts { opacity:.6; font-size:11px; }
.story-disclaimer { font-size:11px; color:var(--text-lo); margin-top:14px; font-style:italic; }

@keyframes fadeSlideUp { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }
/* Base GIF hiding rule (Mobile / Tablet default) */
.hero-gif {
  display: none;
}

/* PC / Desktop styles */
@media (min-width: 1024px) {
  .hero-wrap {
    position: relative;
  }

  .hero-gif {
    display: block;
    position: absolute;
    pointer-events: none; /* Allows user to click buttons behind or under the GIF */
    z-index: 10;
    object-fit: contain;
  }

  /* GIF 1: Over the left text area */
  .desktop-gif-1 {
    top: 25%;
    left: -110px;
    width: 220px;
    height: auto;
    z-index: -10;
    display: none;
  }

  /* GIF 2: Above the hero text / demo gap */
  .desktop-gif-2 {
    top: 15%;
    left: 35%;
    width: 180px;
    height: auto;
    z-index: -10;
  }

  /* GIF 3: Over the right globe area */
  .desktop-gif-3 {
    top: 20%;
    right: -110px;
    width: 240px;
    height: auto;
    z-index: 10;
  }
}
.section-wyg {
  padding: 80px 20px;
  background: var(--bg-deep);
  color: var(--text-hi);
  overflow: hidden;
}

.wy-container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.wy-header {
  text-align: center;
  margin-bottom: 40px;
}

.wy-eyebrow {
  color: var(--green);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.wy-title {
  font-size: 42px;
  margin: 8px 0;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-hi);
}

.wy-sub {
  color: var(--text-md);
  font-size: 16px;
}

/* Slider Track */
.wy-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.wy-slider-track {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease-in-out;
  width: 100%;
}

.wy-card {
  min-width: calc(33.333% - 14px);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  flex-shrink: 0;
  transition: border-color 0.3s ease, transform 0.3s ease;
  box-shadow: var(--shadow-card);
}

.wy-card:hover {
  border-color: rgba(0, 230, 118, 0.4);
  transform: translateY(-4px);
}

.wy-img-box {
  width: 100%;
  height: 280px;
  background: var(--bg-surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.wy-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 8px;
}

.wy-card-info {
  padding: 20px;
}

.wy-card-info h3 {
  font-size: 18px;
  margin: 0 0 8px 0;
  color: var(--text-hi);
}

.wy-card-info p {
  font-size: 14px;
  color: var(--text-md);
  margin: 0;
  line-height: 1.5;
}

/* Controls */
.wy-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  color: var(--text-hi);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s ease, color 0.2s ease;
  box-shadow: var(--shadow-card);
}

.wy-nav-btn:hover {
  background: var(--green);
  color: #fff;
}

.wy-prev { left: -22px; }
.wy-next { right: -22px; }

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

.wy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border2);
  cursor: pointer;
  transition: background 0.3s ease, width 0.3s ease;
}

.wy-dot.active {
  background: var(--green);
  width: 24px;
  border-radius: 4px;
}

/* Responsive view */
@media (max-width: 900px) {
  .wy-card { min-width: calc(50% - 10px); }
  .wy-prev { left: 4px; }
  .wy-next { right: 4px; }
}

@media (max-width: 600px) {
  .wy-card { min-width: 100%; }
}












.section-wyg {
  padding: 80px 0;
  background: var(--bg-deep);
  color: var(--text-hi);
  overflow: hidden;
  width: 100%;
}

.wy-container {
  width: 100%;
  max-width: 100%;
  padding-left: 5vw; /* Flushes far left card to edge with clean padding */
  box-sizing: border-box;
}

.wy-header {
  text-align: center;
  margin-bottom: 50px;
  padding-right: 5vw;
}

.wy-eyebrow {
  color: var(--green);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.wy-title {
  font-size: 42px;
  margin: 8px 0;
  font-weight: 800;
  color: var(--text-hi);
}

.wy-sub {
  color: var(--text-md);
  font-size: 16px;
}

/* 3D Perspective Stage */
.wy-slider-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
  perspective: 1000px;
}

.wy-slider-track {
  display: flex;
  gap: 24px;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Card 3D Depth Scaling */
.wy-card {
  width: 460px;
  min-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  transform-origin: left center;
  transition: transform 0.65s ease, opacity 0.65s ease, border-color 0.3s ease;
  box-shadow: var(--shadow-card);
}

.wy-img-box {
  width: 100%;
  height: 320px;
  background: var(--bg-surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.wy-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 8px;
}

.wy-card-info {
  padding: 24px;
}

.wy-card-info h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  color: var(--text-hi);
}

.wy-card-info p {
  font-size: 14px;
  color: var(--text-md);
  margin: 0;
  line-height: 1.5;
}

/* Dynamic Perspective States */
.wy-card.depth-0 {
  transform: scale(1) translateZ(0);
  opacity: 1;
  border-color: rgba(0, 230, 118, 0.45);
  z-index: 5;
}

.wy-card.depth-1 {
  transform: scale(0.94) translateZ(-30px);
  opacity: 0.88;
  z-index: 4;
}

.wy-card.depth-2 {
  transform: scale(0.88) translateZ(-60px);
  opacity: 0.72;
  z-index: 3;
}

.wy-card.depth-3 {
  transform: scale(0.82) translateZ(-90px);
  opacity: 0.55;
  z-index: 2;
}

/* Navigation Buttons */
.wy-nav-btn {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border2);
  color: var(--text-hi);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  box-shadow: var(--shadow-card);
}

.wy-nav-btn:hover {
  background: var(--green);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.wy-prev { left: 2vw; }
.wy-next { right: 5vw; }

.wy-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  padding-right: 5vw;
}

.wy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border2);
  cursor: pointer;
  transition: background 0.3s ease, width 0.3s ease;
}

.wy-dot.active {
  background: var(--green);
  width: 24px;
  border-radius: 4px;
}
/* Mobile Fixes for Coverflow Slider */
@media (max-width: 768px) {
  .section-wyg {
    padding: 40px 0;
    overflow: hidden;
  }

  .wy-slider-wrap {
    height: 480px;
  }

  /* Scale card down to fit mobile view */
  .wy-card {
    width: 85vw;
    max-width: 340px;
    min-width: 85vw;
  }

  .wy-img-box {
    height: 260px;
    padding: 10px;
  }

  .wy-card-info {
    padding: 16px;
  }

  .wy-card-info h3 {
    font-size: 16px;
  }

  .wy-card-info p {
    font-size: 12px;
  }

  /* Move navigation arrows inside the viewport */
  .wy-nav-btn {
    width: 38px;
    height: 38px;
  }

  .wy-prev { left: 8px; }
  .wy-next { right: 8px; }
}
@media (max-width: 768px) {
  .section-wyg {
    padding: 40px 0;
    overflow: hidden;
    max-width: 100vw;
    left: -5px;
   
  }

  .wy-container {
    padding-right: 5vw; /* symmetry, was missing */
  }

  .wy-header {
    padding-right: 5vw;
  }

  /* Cap heading sizes so text can't force horizontal scroll */
  .wy-title {
    font-size: 28px;
  }

  .wy-sub {
    font-size: 14px;
  }

  .wy-eyebrow {
    font-size: 11px;
  }

  .wy-slider-wrap {
    height: 420px;
    overflow: hidden; /* was 'visible' — clips 3D translateZ bleed */
  }

  /* Scale card down to fit mobile view */
  .wy-card {
    width: 85vw;
    max-width: 320px;
    box-sizing: border-box; /* prevents border/padding pushing width past 85vw */
    border: none;
     top: -100px;
    position: relative;
  }

  .wy-img-box {
    height: 180px;
  }

  .wy-card-info {
    padding: 16px;
  }

  .wy-card-info h3 {
    font-size: 16px;
  }

  .wy-card-info p {
    font-size: 12px;
  }

  /* Move navigation arrows inside the viewport */
  .wy-nav-btn {
    width: 38px;
    height: 38px;
  }

  .wy-prev { left: 8px; }
  .wy-next { right: 8px; }
}

/* What You Get slideshow — id-scoped theme tokens (beats duplicate .section-wyg blocks) */
#what-you-get.section-wyg {
  background: var(--bg-deep);
  color: var(--text-hi);
}

#what-you-get .wy-title,
#what-you-get .wy-card-info h3 {
  color: var(--text-hi);
}

#what-you-get .wy-sub,
#what-you-get .wy-card-info p {
  color: var(--text-md);
}

#what-you-get .wy-eyebrow {
  color: var(--green);
}

#what-you-get .wy-card {
  background: var(--bg-card);
  border-color: var(--border2);
  box-shadow: var(--shadow-card);
}

#what-you-get .wy-img-box {
  background: var(--bg-surface);
}

#what-you-get .wy-nav-btn {
  background: var(--bg-card);
  border-color: var(--border2);
  color: var(--text-hi);
  box-shadow: var(--shadow-card);
}

#what-you-get .wy-nav-btn:hover {
  background: var(--green);
  color: #fff;
}

#what-you-get .wy-dot {
  background: var(--border2);
}

#what-you-get .wy-dot.active {
  background: var(--green);
}
.celeb-samples-section { 
  padding: 60px 24px; 
  max-width: 1200px; 
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.celeb-samples-header { 
  text-align: center; 
  margin-bottom: 32px; 
}

.celeb-slider-wrap { 
  position: relative;
  display: flex; 
  align-items: center; 
  gap: 12px; 
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* New viewport element to contain track overflow cleanly */
.celeb-slider-viewport {
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 8px 0; /* Prevents card borders/shadows from getting cut off top/bottom */
}

.celeb-slider-track { 
  display: flex; 
  gap: 20px; 
  transition: transform .4s cubic-bezier(0.25, 1, 0.5, 1); 
  will-change: transform;
}

.celeb-card {
  flex: 0 0 220px; 
  background: var(--bg-card); 
  border: 1px solid var(--border);
  border-radius: var(--r-md); 
  padding: 20px 16px; 
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}

.celeb-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
}

.celeb-photo-wrap { 
  width: 110px; 
  height: 110px; 
  border-radius: 50%; 
  overflow: hidden; 
  margin: 0 auto 14px; 
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-surface);
  position: relative;
  isolation: isolate;
}

.celeb-photo-wrap img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover;
  display: block;
  /* Hide broken-image alt text bleed in WebKit */
  color: transparent;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.celeb-card-name { 
  font-weight: 700; 
  margin-bottom: 4px; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 1;
  line-height: 1.25;
  max-width: 100%;
}

.celeb-card-top { 
  font-size: 12px; 
  color: var(--text-lo); 
  margin-bottom: 14px;
  min-height: 1.2em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.celeb-view-btn { 
  width: 100%; 
}

.celeb-nav-btn { 
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  border-radius: 50%;
  font-size: 18px; 
  color: var(--text-hi); 
  cursor: pointer; 
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
  z-index: 2;
}

.celeb-nav-btn:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.celeb-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.celeb-dots { 
  display: flex; 
  justify-content: center; 
  align-items: center;
  flex-wrap: wrap;
  gap: 8px; 
  margin-top: 24px; 
}

.celeb-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.celeb-dot.active { 
  background: var(--green); 
  transform: scale(1.25);
}

@media (max-width: 700px) {
  .celeb-samples-section {
    padding: 40px 16px;
  }

  .celeb-slider-wrap {
    gap: 8px;
  }

  .celeb-nav-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .celeb-card {
    flex: 0 0 min(220px, calc(100vw - 112px));
  }

  .celeb-dots {
    margin-top: 18px;
    gap: 6px;
  }
}

.haplo-disclaimer-banner {
  background: rgba(212,168,67,0.08); border: 1px solid rgba(212,168,67,0.25);
  border-radius: 8px; padding: 12px 14px; font-size: 12px; color: var(--text-lo);
  margin-bottom: 18px; line-height: 1.5;
}
.haplo-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .haplo-columns { grid-template-columns: 1fr; } }
.haplo-col-head { display:flex; align-items:center; gap:8px; font-weight:700; font-size:15px; }
.haplo-col-sub { font-size:11px; color:var(--text-lo); margin-bottom:12px; }
.haplo-row { background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.06); border-radius:8px; padding:10px 12px; margin-bottom:8px; }
.haplo-row-top { border-color: #D4A843; }
.haplo-row-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.haplo-badge { font-weight:800; font-size:15px; color:var(--text-hi); }
.haplo-conf { font-size:11px; color:#D4A843; font-weight:600; }
.haplo-region { font-size:11px; color:var(--text-lo); margin-bottom:4px; }
.haplo-desc { font-size:11px; color:var(--text-lo); line-height:1.4; margin-bottom:8px; }
.haplo-bar-track { height:4px; background:rgba(255,255,255,0.08); border-radius:2px; overflow:hidden; }
.haplo-bar-fill { height:100%; background:#D4A843; }
.home-live-demo {
  max-width: 1100px;
  margin: 56px auto 72px;
  padding: 0 20px;
}
.lvd-header { text-align: center; margin-bottom: 28px; }
.lvd-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-lt, #4ADE80);
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.lvd-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green, #22C55E);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: lvd-pulse 1.8s ease-out infinite;
}
@keyframes lvd-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.lvd-title {
  font-family: var(--font-disp, 'Syne', sans-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  margin: 0 0 10px;
}
.lvd-sub {
  color: var(--text-md);
  font-size: 14px;
  line-height: 1.55;
  max-width: 560px;
  margin: 0 auto;
}
.lvd-sub a { color: var(--green); }

.lvd-panel {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl, 24px);
  overflow: hidden;
}
@media (max-width: 720px) {
  .lvd-panel { grid-template-columns: 1fr; }
}

.lvd-photo-col {
  padding: 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(34,197,94,0.04), transparent 70%);
}
@media (max-width: 720px) {
  .lvd-photo-col { border-right: 0; border-bottom: 1px solid var(--border); }
}
.lvd-photo-wrap {
  position: relative;
  border-radius: var(--r-md, 12px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0d14;
}
.lvd-photo-wrap canvas { width: 100%; display: block; }
#lvdOverlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.lvd-photo-busy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(6, 10, 16, 0.62);
  color: var(--text-hi);
  font-size: 12px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(2px);
}
.lvd-photo-busy[hidden] { display: none !important; }
.lvd-photo-wrap.is-busy canvas {
  filter: brightness(0.72);
}
.lvd-photo-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 4;
  background: rgba(6, 10, 16, 0.82);
  color: #F2F4F7;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="light"] .lvd-photo-tag {
  background: rgba(255, 255, 255, 0.92);
  color: #1C2434;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.lvd-refresh-btn {
  width: 100%;
  margin-top: 12px;
  border-radius: var(--r-md, 12px);
  min-height: 44px;
  touch-action: manipulation;
  cursor: pointer;
}
.lvd-refresh-btn[aria-busy="true"] {
  opacity: 0.92;
}

.lvd-results-col { padding: 18px 18px 20px; min-width: 0; }
.lvd-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--text-md);
  font-size: 13px;
}
.lvd-loading[hidden],
.lvd-results[hidden],
.lvd-error[hidden] {
  display: none !important;
}
.lvd-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: lvd-spin 0.8s linear infinite;
}
@keyframes lvd-spin { to { transform: rotate(360deg); } }

.lvd-reveal {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 560px) {
  .lvd-reveal { grid-template-columns: 1fr; }
}

.lvd-podium {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-lg, 18px);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.lvd-podium-title {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-md);
}
.lvd-podium-items { display: flex; flex-direction: column; gap: 8px; }
.lvd-podium-item {
  display: grid;
  grid-template-columns: 22px 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-md, 12px);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  min-width: 0;
}
.lvd-podium-item.rank-1 {
  border-color: rgba(212, 168, 67, 0.45);
  background: rgba(212, 168, 67, 0.08);
}
.lvd-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #06110a;
  background: var(--text-md);
}
.lvd-podium-item.rank-1 .lvd-rank { background: var(--gold, #D4A843); color: #1a1408; }
.lvd-podium-item.rank-2 .lvd-rank { background: #94A3B8; color: #0b1220; }
.lvd-podium-item.rank-3 .lvd-rank { background: #B45309; color: #fff7ed; }
.lvd-podium-flag { font-size: 14px; line-height: 1; }
.lvd-podium-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hi);
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  line-height: 1.25;
}
.lvd-podium-pct {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 650;
  color: var(--green-lt, #4ADE80);
}
.lvd-podium-item.rank-1 .lvd-podium-pct { color: var(--gold-lt, #F0C96A); }

.lvd-conf { text-align: center; margin-top: 6px; }
.lvd-conf-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 3px solid rgba(34, 197, 94, 0.25);
  box-shadow: inset 0 0 0 3px rgba(34, 197, 94, 0.55);
  display: grid;
  place-items: center;
  font-family: var(--font-disp, 'Syne', sans-serif);
  font-size: 15px;
  font-weight: 750;
  color: var(--text-hi);
}
.lvd-conf-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
}

.lvd-main { min-width: 0; }
.lvd-primary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.lvd-primary-flag { font-size: 28px; line-height: 1; }
.lvd-top-match-name {
  font-family: var(--font-disp, 'Syne', sans-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  line-height: 1.15;
}
.lvd-top-match-pct {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--gold, #D4A843);
  margin-top: 2px;
}
.lvd-primary-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-md);
  margin: 0 0 14px;
}
.lvd-composition-label {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 10px;
}
.lvd-comp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.lvd-comp-flag { flex: 0 0 18px; }
.lvd-comp-name {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  color: var(--text-md);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  line-height: 1.25;
}
.lvd-comp-track {
  flex: 1.2 1 80px;
  min-width: 64px;
  height: 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.lvd-comp-fill { height: 100%; border-radius: inherit; background: var(--green); }
.lvd-comp-pct {
  flex: 0 0 42px;
  text-align: right;
  color: var(--text-hi);
  font-weight: 650;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.lvd-error {
  color: #E85D7A;
  font-size: 13px;
  text-align: center;
  padding: 24px 12px;
  line-height: 1.45;
}

/* ============================================================
   What You Get — professional mock previews (no scrapbook assets)
   ============================================================ */
#what-you-get .wy-mock {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  color: var(--text-hi);
}
#what-you-get .wy-mock-footnote {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-md);
  line-height: 1.4;
}
#what-you-get .wy-mock-civ {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#what-you-get .wy-mock-civ-card {
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#what-you-get .wy-civ-era {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-lo);
}
#what-you-get .wy-mock-civ-card strong {
  font-size: 13px;
  color: var(--text-hi);
  line-height: 1.2;
}
#what-you-get .wy-civ-pct {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}
#what-you-get .wy-mock-civ-card em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-md);
}

#what-you-get .wy-mock-map {
  display: grid;
  grid-template-columns: minmax(110px, 42%) 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
}
#what-you-get .wy-map-stage {
  position: relative;
  height: 132px;
  display: grid;
  place-items: center;
}
#what-you-get .wy-globe-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid rgba(34,197,94,0.35);
  background:
    radial-gradient(circle at 35% 35%, rgba(34,197,94,0.2), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(212,168,67,0.18), transparent 50%),
    rgba(255,255,255,0.02);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
#what-you-get .wy-globe-pin {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.2);
}
#what-you-get .wy-globe-pin.p1 { top: 36px; left: calc(50% - 26px); }
#what-you-get .wy-globe-pin.p2 { top: 54px; left: calc(50% + 18px); background: var(--gold); box-shadow: 0 0 0 4px rgba(212,168,67,0.2); }
#what-you-get .wy-globe-pin.p3 { top: 76px; left: calc(50% - 4px); background: #60A5FA; box-shadow: 0 0 0 4px rgba(96,165,250,0.2); }
#what-you-get .wy-map-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
#what-you-get .wy-map-leg {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 12px;
}
#what-you-get .wy-map-leg i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
#what-you-get .wy-map-leg b {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--green-lt, #4ADE80);
}

#what-you-get .wy-mock-mig {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 4px 2px 2px;
}
#what-you-get .wy-mig-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}
#what-you-get .wy-mig-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  opacity: 0.75;
}
#what-you-get .wy-mig-node {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#what-you-get .wy-mig-node::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.45);
}
#what-you-get .wy-mig-node:first-child::before {
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(212,168,67,0.45);
}
#what-you-get .wy-mig-node b {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-hi);
}
#what-you-get .wy-mig-node span {
  font-size: 10px;
  color: var(--text-md);
}
#what-you-get .wy-mig-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#what-you-get .wy-mig-card {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(34,197,94,0.04);
  min-width: 0;
}
#what-you-get .wy-mig-card span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 4px;
}
#what-you-get .wy-mig-card strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-hi);
  line-height: 1.3;
}

@media (max-width: 420px) {
  #what-you-get .wy-mock-eth { grid-template-columns: 1fr; }
  #what-you-get .wy-preview { min-height: 0; padding: 12px; }
  #what-you-get .wy-mock-map { grid-template-columns: 1fr; }
  #what-you-get .wy-map-stage { height: 118px; }
  #what-you-get .wy-mig-cards { grid-template-columns: 1fr; }
}
#what-you-get .wy-mock-label {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-md);
  margin-bottom: 8px;
}
#what-you-get .wy-mock-eth {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 12px;
  align-items: start;
}
#what-you-get .wy-mock-rank {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 11px;
  margin-bottom: 6px;
}
#what-you-get .wy-mock-rank span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#what-you-get .wy-mock-rank b { color: var(--green-lt, #4ADE80); font-weight: 650; }
#what-you-get .wy-rk {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #0b1220;
  background: var(--text-md);
}
#what-you-get .wy-mock-rank.r1 {
  border-color: rgba(212,168,67,0.45);
  background: rgba(212,168,67,0.08);
}
#what-you-get .wy-mock-rank.r1 .wy-rk { background: var(--gold, #D4A843); color: #1a1408; }
#what-you-get .wy-mock-rank.r2 .wy-rk { background: #94A3B8; }
#what-you-get .wy-mock-rank.r3 .wy-rk { background: #B45309; color: #fff7ed; }
#what-you-get .wy-mock-hero {
  font-family: var(--font-disp, Syne, sans-serif);
  font-size: 1.15rem;
  font-weight: 750;
  margin-bottom: 10px;
}
#what-you-get .wy-mock-hero em {
  font-style: normal;
  color: var(--gold, #D4A843);
  margin-left: 6px;
}
#what-you-get .wy-mock-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin-bottom: 7px;
  flex: 1;
  min-width: 0;
}
#what-you-get .wy-mock-barrow {
  display: grid;
  grid-template-columns: 22px 1fr 34px;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
}
#what-you-get .wy-mock-barrow > span {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-md);
}
#what-you-get .wy-mock-barrow b {
  font-size: 10px;
  font-weight: 650;
  text-align: right;
  color: var(--text-hi);
  font-family: var(--font-mono, monospace);
}
#what-you-get .wy-mock-barrow .wy-mock-bar {
  margin-bottom: 0;
}
#what-you-get .wy-mock-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

#what-you-get .wy-mock-stack {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  gap: 2px;
}
#what-you-get .wy-mock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#what-you-get .wy-mock-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  font-size: 11px;
}
#what-you-get .wy-mock-chip b { margin-left: auto; color: var(--text-hi); }
#what-you-get .wy-dot-ic {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
#what-you-get .wy-mock-chip.c1 { border-color: rgba(217,119,6,0.35); }
#what-you-get .wy-mock-chip.c1 .wy-dot-ic { background: #D97706; }
#what-you-get .wy-mock-chip.c2 { border-color: rgba(167,139,250,0.35); }
#what-you-get .wy-mock-chip.c2 .wy-dot-ic { background: #A78BFA; }
#what-you-get .wy-mock-chip.c3 { border-color: rgba(20,184,166,0.35); }
#what-you-get .wy-mock-chip.c3 .wy-dot-ic { background: #14B8A6; }
#what-you-get .wy-mock-chip.c4 { border-color: rgba(59,130,246,0.35); }
#what-you-get .wy-mock-chip.c4 .wy-dot-ic { background: #3B82F6; }

#what-you-get .wy-mock-traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#what-you-get .wy-trait {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(34,197,94,0.04);
}
#what-you-get .wy-trait span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin-bottom: 4px;
}
#what-you-get .wy-trait b {
  font-size: 14px;
  color: var(--text-hi);
  font-weight: 650;
}

/* Live demo — placement + face frame polish */
.home-live-demo {
  max-width: 1100px;
  margin: 40px auto 72px;
  padding: 0 20px;
}
.lvd-photo-wrap {
  border-radius: 16px;
  border: 1px solid rgba(34, 197, 94, 0.28);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.12);
}
.lvd-photo-wrap canvas {
  width: 100%;
  display: block;
}
#lvdCanvas {
  background: #0a0d14;
}
#lvdOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

/* ============================================================
   YAMNAYA + LOOKALIKE PAGES
   ============================================================ */
.yamnaya-page,
.lookalike-page {
  min-height: calc(100vh - 60px);
  padding: 100px 24px 80px;
}

.yam-hero,
.lka-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.yam-hero .section-sub,
.lka-hero .section-sub {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-md);
  font-size: 15px;
  line-height: 1.6;
}

.yam-stage,
.lka-stage {
  max-width: 720px;
  margin: 0 auto;
}

.yam-stage .upload-zone-big {
  max-width: 520px;
  margin: 0 auto;
}

.lka-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.lka-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lka-slot-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-md);
  text-align: center;
}

.lka-slot-label span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-lo);
}

.lka-upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 148px;
  padding: 22px 14px;
  border: 1px dashed var(--border2, rgba(255,255,255,0.16));
  border-radius: 16px;
  background: var(--bg-card, rgba(255,255,255,0.02));
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lka-upload-zone:hover,
.lka-upload-zone:focus-visible,
.lka-upload-zone.dragover {
  border-color: var(--green, #22C55E);
  background: rgba(34, 197, 94, 0.06);
  outline: none;
}

.lka-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green, #22C55E);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.lka-upload-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hi);
}

.lka-hint {
  text-align: center;
  color: var(--green-lt, #4ADE80);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 18px;
}

.lka-run-btn,
.yam-run-btn {
  display: block;
  margin: 0 auto;
  min-width: min(100%, 280px);
}

.lka-status,
.yam-status {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-md);
}

.lka-results,
.yam-results {
  max-width: 860px;
  margin: 28px auto 0;
}

.lka-thumb-canvas {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}

.lka-slot-status {
  min-height: 16px;
  font-size: 12px;
  color: var(--text-lo);
  text-align: center;
}

.yam-detect-panel {
  position: relative;
  max-width: 420px;
  margin: 18px auto 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.yam-detect-panel canvas {
  width: 100%;
  display: block;
}

#yamOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.yam-trait-picker {
  max-width: 420px;
  margin: 18px auto 0;
  display: grid;
  gap: 12px;
}

.yam-trait-row {
  display: grid;
  gap: 6px;
  text-align: left;
}

.yam-trait-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-md);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.yam-trait-row select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-hi);
  padding: 10px 12px;
  font: inherit;
}

@media (max-width: 720px) {
  .lka-slots {
    grid-template-columns: 1fr;
  }
  .lka-upload-zone {
    min-height: 120px;
  }
}
