:root {
  --family-ink: #13211e;
  --family-muted: #61706b;
  --family-line: #dbe5e1;
  --family-green: #1d5c4e;
  --family-green-dark: #153f36;
  --family-mint: #eef7f4;
  --family-mint-strong: #dcefe8;
  --family-warm: #f7f4ec;
  --family-panel: #ffffff;
  --family-bg: #f5f8f6;
  --family-shadow: 0 20px 60px rgba(19, 33, 30, .07);
}

body.family-snapshot-page {
  background:
    radial-gradient(circle at 88% 6%, rgba(205, 233, 222, .55), transparent 28rem),
    linear-gradient(180deg, #f9fbfa 0%, var(--family-bg) 38%, #f7f8f6 100%);
  color: var(--family-ink);
}

.family-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 72px;
}

.family-hero,
.family-section,
.family-final-cta {
  border: 1px solid var(--family-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--family-shadow);
}

.family-hero {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
  padding: clamp(34px, 7vw, 82px);
}

.family-hero::before,
.family-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.family-hero::before {
  width: 460px;
  height: 460px;
  right: -180px;
  top: -170px;
  background: var(--family-mint);
}

.family-hero::after {
  width: 240px;
  height: 240px;
  right: 8%;
  bottom: -120px;
  background: rgba(247, 244, 236, .9);
}

.family-hero > * {
  position: relative;
  z-index: 1;
}

.family-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--family-green);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.family-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--family-green);
  box-shadow: 0 0 0 6px rgba(29, 92, 78, .09);
}

.family-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.65rem, 7vw, 5.45rem);
  line-height: .96;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.family-hero .family-lead {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--family-muted);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  line-height: 1.58;
}

.family-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.family-actions .btn-primary,
.family-actions .btn-secondary,
.family-final-cta .btn-primary {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 750;
}

.family-actions .btn-primary,
.family-final-cta .btn-primary {
  background: var(--family-green-dark);
}

.family-actions .btn-primary:hover,
.family-final-cta .btn-primary:hover {
  filter: none;
  background: #0f352d;
  transform: translateY(-1px);
}

.family-actions .btn-secondary {
  background: rgba(255,255,255,.7);
}

.family-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 20px;
  color: var(--family-muted);
  font-size: .9rem;
}

.family-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.family-trust-row span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--family-green);
}

.home-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.home-core {
  width: min(290px, 76vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #cfe0da;
  background:
    radial-gradient(circle at 40% 32%, #ffffff 0%, #f1f8f5 48%, #e5f1ed 100%);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 52px;
  box-shadow:
    0 30px 70px rgba(29, 92, 78, .12),
    inset 0 0 0 14px rgba(255,255,255,.62);
}

.home-core strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.home-core span {
  display: block;
  margin-top: 10px;
  color: var(--family-muted);
  font-size: .86rem;
  line-height: 1.45;
}

.home-orbit {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.orbit-tag {
  position: absolute;
  padding: 9px 12px;
  border: 1px solid var(--family-line);
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 10px 26px rgba(19,33,30,.06);
  color: var(--family-ink);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.orbit-tag:nth-child(1) { top: 5%; left: 11%; }
.orbit-tag:nth-child(2) { top: 12%; right: 2%; }
.orbit-tag:nth-child(3) { bottom: 28%; right: -2%; }
.orbit-tag:nth-child(4) { bottom: 7%; left: 50%; transform: translateX(-50%); }
.orbit-tag:nth-child(5) { bottom: 25%; left: -3%; }

.family-section {
  margin-top: 20px;
  padding: clamp(28px, 5vw, 54px);
}

.family-section-head {
  max-width: 800px;
  margin-bottom: 28px;
}

.family-section-head h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.family-section-head p {
  margin: 14px 0 0;
  color: var(--family-muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.family-intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.family-step {
  min-height: 230px;
  border: 1px solid var(--family-line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #fbfdfc 100%);
  padding: 24px;
}

.family-step-number,
.lens-index {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--family-mint);
  color: var(--family-green);
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: .03em;
}

.family-step h3 {
  margin: 34px 0 9px;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.family-step p {
  margin: 0;
  color: var(--family-muted);
  line-height: 1.6;
}

.lens-ecosystem {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.lens-tile {
  min-height: 190px;
  border: 1px solid var(--family-line);
  border-radius: 20px;
  background: #fff;
  padding: 20px;
}

.lens-tile strong {
  display: block;
  margin-top: 34px;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.lens-tile p {
  margin: 8px 0 0;
  color: var(--family-muted);
  font-size: .9rem;
  line-height: 1.5;
}

.growth-path-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, .8fr);
  gap: 34px;
  align-items: center;
}

.growth-path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 20px 0;
}

.growth-path::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 44px;
  height: 2px;
  background: linear-gradient(90deg, #c9ded7 0%, var(--family-green) 50%, #c9ded7 100%);
}

.growth-node {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 12px;
}

.growth-dot {
  width: 50px;
  height: 50px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 9px solid #fff;
  background: var(--family-green);
  box-shadow: 0 0 0 1px #bad3ca, 0 10px 30px rgba(29, 92, 78, .14);
}

.growth-node:nth-child(2) .growth-dot {
  transform: scale(1.08);
}

.growth-node strong {
  display: block;
  font-size: 1rem;
}

.growth-node span {
  display: block;
  max-width: 190px;
  margin: 6px auto 0;
  color: var(--family-muted);
  font-size: .88rem;
  line-height: 1.45;
}

.growth-message {
  border-radius: 22px;
  background: var(--family-mint);
  padding: 26px;
}

.growth-message strong {
  display: block;
  font-size: 1.2rem;
  letter-spacing: -.02em;
}

.growth-message p {
  margin: 10px 0 0;
  color: var(--family-muted);
  line-height: 1.6;
}

.preview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 34px;
  align-items: center;
}

.preview-copy p {
  color: var(--family-muted);
  line-height: 1.65;
}

.preview-card {
  border: 1px solid #cadbd5;
  border-radius: 24px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(19, 33, 30, .09);
}

.preview-kicker {
  margin: 0 0 7px;
  color: var(--family-green);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preview-card h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.preview-card > p {
  margin: 0 0 20px;
  color: var(--family-muted);
  font-size: .9rem;
}

.preview-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid #edf2f0;
}

.preview-row strong {
  font-size: .92rem;
}

.preview-status {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--family-mint);
  color: var(--family-green-dark);
  font-size: .72rem;
  font-weight: 800;
}

.preview-status.focus {
  background: var(--family-warm);
  color: #6b5630;
}

.preview-seed {
  margin-top: 18px;
  border-radius: 16px;
  background: var(--family-green-dark);
  color: #fff;
  padding: 18px;
}

.preview-seed span {
  display: block;
  color: rgba(255,255,255,.7);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.preview-seed strong {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

.privacy-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  border: 1px solid #cadbd5;
  border-radius: 22px;
  background: var(--family-mint);
  padding: 24px;
}

.privacy-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--family-green-dark);
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(19,33,30,.06);
}

.privacy-strip strong {
  display: block;
  font-size: 1.05rem;
}

.privacy-strip p {
  margin: 5px 0 0;
  color: var(--family-muted);
  line-height: 1.55;
}

.family-progress-section {
  background: linear-gradient(180deg, #fff 0%, #fbfdfc 100%);
}

.cs-trajectory-card {
  border: 0;
  border-radius: 22px;
  background: transparent;
  padding: 0;
}

.cs-trajectory-empty {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--family-line);
  border-radius: 20px;
  background: #fff;
  padding: 22px;
}

.cs-trajectory-empty-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--family-mint);
  display: grid;
  place-items: center;
  color: var(--family-green);
  font-weight: 900;
}

.cs-trajectory-empty h3,
.cs-trajectory-card h3 {
  margin: 0;
  letter-spacing: -.02em;
}

.cs-trajectory-empty p {
  margin: 5px 0 0;
  color: var(--family-muted);
}

.cs-trajectory-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.cs-trajectory-sub {
  margin: 6px 0 0;
  color: var(--family-muted);
}

.cs-trajectory-current {
  text-align: right;
}

.cs-trajectory-current span {
  display: block;
  color: var(--family-muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.cs-trajectory-current strong {
  display: block;
  margin-top: 4px;
  font-size: 1.7rem;
  letter-spacing: -.04em;
}

.cs-trajectory-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.cs-trajectory-meta span {
  display: block;
  border: 1px solid var(--family-line);
  border-radius: 14px;
  background: #fff;
  padding: 13px 14px;
  color: var(--family-muted);
  font-size: .8rem;
}

.cs-trajectory-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--family-ink);
  font-size: 1rem;
}

.cs-trajectory-summary {
  margin: 0 0 18px;
  color: var(--family-muted);
  line-height: 1.6;
}

.cs-trajectory-visual {
  border: 1px solid var(--family-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdfc 0%, #f4f9f7 100%);
  padding: 18px;
  color: var(--family-green);
}

.cs-trajectory-chart {
  display: block;
  width: 100%;
  height: 130px;
}

.cs-trajectory-chart circle {
  fill: currentColor;
}

.cs-trajectory-dates {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--family-muted);
  font-size: .78rem;
}

.cs-trajectory-details {
  margin-top: 14px;
  border: 1px solid var(--family-line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.cs-trajectory-details summary {
  padding: 16px 18px;
  font-weight: 750;
}

.cs-trajectory-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 0 18px 18px;
}

.cs-trajectory-detail-body h4 {
  margin: 0 0 10px;
}

.cs-traj-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #edf2f0;
  font-size: .86rem;
}

.cs-traj-row:first-of-type {
  border-top: 0;
}

.cs-traj-range {
  color: var(--family-muted);
}

.cs-traj-delta {
  font-weight: 800;
}

.cs-traj-delta.is-up { color: var(--family-green); }
.cs-traj-delta.is-down { color: #9a4a46; }
.cs-traj-delta.is-flat { color: #776f62; }

.cs-milestones {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--family-muted);
}

.cs-milestones li + li {
  margin-top: 8px;
}

.cs-trajectory-debug {
  margin-top: 12px;
  text-align: right;
}

.cs-btn-reset {
  border: 0;
  background: transparent;
  color: var(--family-muted);
  text-decoration: underline;
  font-size: .78rem;
  cursor: pointer;
}

.family-final-cta {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  padding: clamp(36px, 7vw, 74px);
  text-align: center;
  background: var(--family-green-dark);
  color: #fff;
}

.family-final-cta::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -150px;
  bottom: -210px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}

.family-final-cta > * {
  position: relative;
  z-index: 1;
}

.family-final-cta h2 {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(2rem, 5vw, 3.45rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.family-final-cta p {
  max-width: 620px;
  margin: 16px auto 0;
  color: rgba(255,255,255,.74);
  line-height: 1.6;
}

.family-final-cta .family-actions {
  justify-content: center;
}

.family-final-cta .btn-primary {
  background: #fff;
  color: var(--family-green-dark);
}

.family-final-cta .btn-primary:hover {
  background: #f3f8f6;
}

.family-final-cta .family-secondary-link {
  color: rgba(255,255,255,.84);
  text-underline-offset: 4px;
}

/* Snapshot modal refinement: keep the existing engine, improve the experience. */
.family-snapshot-page .modal {
  background: rgba(11, 25, 21, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.family-snapshot-page .modal-shell,
.family-snapshot-page .snapshot-modal {
  border-radius: 24px;
  border-color: #cfddd8;
  box-shadow: 0 30px 90px rgba(11, 25, 21, .24);
}

.family-snapshot-page .choice-set {
  gap: 10px;
}

.family-snapshot-page .choice-row {
  min-height: 56px;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.family-snapshot-page .choice-row:hover {
  border-color: #a9c7bd;
  background: #f9fcfb;
  transform: translateY(-1px);
}

.family-snapshot-page .progress {
  font-weight: 700;
  color: var(--family-green);
}

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

@media (max-width: 980px) {
  .family-hero,
  .growth-path-shell,
  .preview-shell {
    grid-template-columns: 1fr;
  }

  .home-visual {
    min-height: 330px;
  }

  .lens-ecosystem {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lens-tile:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .family-main {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .family-hero,
  .family-section,
  .family-final-cta {
    border-radius: 22px;
  }

  .family-hero {
    min-height: auto;
    padding: 30px 22px 28px;
    gap: 18px;
  }

  .family-hero h1 {
    font-size: clamp(2.45rem, 13vw, 4rem);
  }

  .family-hero .family-lead {
    font-size: 1.04rem;
  }

  .family-actions {
    align-items: stretch;
  }

  .family-actions .btn-primary,
  .family-actions .btn-secondary {
    width: 100%;
  }

  .family-trust-row {
    display: grid;
    gap: 8px;
  }

  .home-visual {
    min-height: 290px;
    margin-top: 8px;
  }

  .home-core {
    width: 210px;
    padding: 35px;
  }

  .home-core strong {
    font-size: 1.2rem;
  }

  .orbit-tag {
    padding: 7px 9px;
    font-size: .67rem;
  }

  .orbit-tag:nth-child(1) { top: 7%; left: 1%; }
  .orbit-tag:nth-child(2) { top: 8%; right: 0; }
  .orbit-tag:nth-child(3) { bottom: 27%; right: -2%; }
  .orbit-tag:nth-child(4) { bottom: 3%; }
  .orbit-tag:nth-child(5) { bottom: 27%; left: -2%; }

  .family-section {
    padding: 28px 20px;
  }

  .family-intro-grid,
  .lens-ecosystem {
    grid-template-columns: 1fr;
  }

  .lens-tile:last-child {
    grid-column: auto;
  }

  .family-step,
  .lens-tile {
    min-height: 0;
  }

  .growth-path {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0;
  }

  .growth-path::before {
    left: 24px;
    right: auto;
    top: 24px;
    bottom: 24px;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, #c9ded7 0%, var(--family-green) 50%, #c9ded7 100%);
  }

  .growth-node {
    display: grid;
    grid-template-columns: 50px 1fr;
    column-gap: 16px;
    text-align: left;
    padding: 0;
  }

  .growth-dot {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .growth-node strong,
  .growth-node span {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
  }

  .growth-node strong {
    align-self: end;
  }

  .preview-shell {
    gap: 24px;
  }

  .preview-card {
    padding: 20px;
  }

  .privacy-strip {
    grid-template-columns: 1fr;
  }

  .cs-trajectory-empty {
    grid-template-columns: 48px 1fr;
  }

  .cs-trajectory-empty .btn-secondary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .cs-trajectory-head {
    grid-template-columns: 1fr;
  }

  .cs-trajectory-current {
    text-align: left;
  }

  .cs-trajectory-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-trajectory-detail-body {
    grid-template-columns: 1fr;
  }

  .cs-traj-row {
    grid-template-columns: 1fr auto;
  }

  .cs-traj-range {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .family-main {
    width: min(100% - 14px, 1180px);
  }

  .family-hero,
  .family-section,
  .family-final-cta {
    border-radius: 18px;
  }

  .family-hero,
  .family-section {
    padding-left: 17px;
    padding-right: 17px;
  }

  .home-visual {
    transform: scale(.92);
    margin-inline: -12px;
  }
}
