/* BetterLife SG Family Trusts v39.9 — audited hierarchy and non-blocking flow */

:root {
  --v399-content: 1320px;
  --v399-line: rgba(23, 59, 50, 0.16);
}

html,
body {
  min-height: 100%;
}

body {
  height: auto !important;
  overflow-x: hidden;
  overflow-y: auto;
}

#root {
  height: auto;
  min-height: 100dvh;
}

.experience-shell {
  height: auto;
  min-height: 100dvh;
  grid-template-rows: var(--v398-header) auto auto;
}

.experience-stage,
.stage-screen {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

.app-footer {
  position: static !important;
  inset: auto !important;
  z-index: 1;
}

h1[tabindex="-1"]:focus,
h1[tabindex="-1"]:focus-visible {
  outline: none !important;
}

/* Brief export must remain unmistakably visible before the browser print dialog opens. */
.brief-actions-v393 > button.brief-print-action-v399,
.brief-actions > button.brief-print-action-v399 {
  min-height: 52px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px solid #174a3e !important;
  color: #123f35 !important;
  background: #fffdf8 !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-weight: 780;
  box-shadow: 0 8px 22px rgba(18, 63, 53, .08);
}

.brief-print-action-v399 svg {
  color: currentColor !important;
}

.brief-print-action-v399:hover {
  background: #edf3ed !important;
}

.brief-print-action-v399:focus-visible {
  outline: 3px solid #c79b3b !important;
  outline-offset: 3px;
}

/* Start page: one uninterrupted hero, then a quiet comparison strip. */
body[data-journey-stage="start"] .experience-shell {
  grid-template-rows: var(--v398-header) auto;
}

.start-screen {
  width: min(var(--v399-content), 100%);
  min-height: calc(100dvh - var(--v398-header));
  height: auto;
  margin: 0 auto;
  padding: clamp(28px, 4vh, 48px) clamp(26px, 4vw, 56px) 36px;
  grid-template-rows: auto auto;
  gap: clamp(26px, 3vh, 38px);
  overflow: visible;
}

.start-intro {
  min-height: 0;
  grid-template-columns: minmax(350px, 0.84fr) minmax(480px, 1.16fr);
  gap: clamp(40px, 5vw, 76px);
  align-items: center;
}

.start-copy {
  min-width: 0;
}

.start-copy h1 {
  max-width: 14ch;
  margin: 8px 0 18px;
  font-size: clamp(46px, 4.2vw, 66px);
  line-height: 1.01;
  overflow: visible;
}

.start-copy > p:not(.stage-kicker) {
  max-width: 34rem;
  line-height: 1.6;
}

.calm-start-primary {
  margin-top: 24px;
}

.start-paths-v399 {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(290px, 1fr);
  gap: 12px;
  align-items: stretch;
  max-width: 660px;
  margin-top: 26px;
}

.start-paths-v399 .calm-start-primary {
  min-height: 64px;
  margin: 0;
}

.funding-map-entry-v399 {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  border: 1px solid rgba(172, 126, 41, .5);
  border-radius: 999px;
  color: var(--v38-forest-900);
  background: rgba(255, 252, 245, .88);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(21, 54, 45, .05);
}

.funding-map-entry-v399 span {
  display: grid;
  gap: 2px;
}

.funding-map-entry-v399 small {
  color: var(--v38-muted);
  font: 650 11px/1.25 var(--v38-sans);
}

.funding-map-entry-v399 strong {
  font: 760 14px/1.25 var(--v38-sans);
}

.funding-map-entry-v399 b {
  color: var(--v38-gold);
  font-size: 22px;
}

.calm-start-secondary {
  display: none !important;
}

.intro-video-frame {
  max-height: min(43vh, 430px);
}

.decision-lanes {
  min-height: 108px;
}

.decision-lanes article {
  padding-block: 16px;
}

/* Questions: retain Aila as a calm visual guide instead of an empty sidebar. */
.question-screen {
  width: min(1240px, 100%);
  grid-template-columns: minmax(360px, 0.88fr) minmax(520px, 1.12fr);
  gap: clamp(34px, 4vw, 58px);
  align-items: center;
}

.question-guide {
  align-self: center;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  min-height: 500px;
  max-height: 550px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--v399-line);
  border-radius: 18px;
  background: var(--v38-forest-900);
  box-shadow: 0 16px 38px rgba(13,43,36,.10);
}

.question-guide img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border-radius: 0;
  object-fit: cover;
  object-position: 52% 28%;
}

.question-guide > div {
  margin: 0;
  padding: 24px 28px 28px;
  color: #fff;
  background: var(--v38-forest-900);
}

.question-guide > div p {
  margin-bottom: 7px;
  color: #ead7af;
}

.question-guide > div strong {
  max-width: 310px;
  color: #fff;
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.14;
}

/* Result page: Aila is a primary explanatory moment, not a hidden utility. */
.result-screen-v391 {
  width: min(var(--v399-content), 100%);
  min-height: 0;
  height: auto;
  overflow: visible;
  padding-bottom: 44px;
}

.aila-result-feature-v399 {
  display: grid;
  grid-template-columns: minmax(360px, 0.94fr) minmax(0, 1.06fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: center;
  margin: 0 0 34px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--v399-line);
  border-radius: 24px;
  background: linear-gradient(130deg, rgba(255,253,248,.97), rgba(241,232,210,.75));
  box-shadow: 0 18px 48px rgba(18, 48, 40, 0.09);
}

.aila-result-copy-v399 small {
  display: block;
  margin-bottom: 8px;
  color: var(--v38-copper);
  font: 780 12px/1.3 var(--v38-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.aila-result-copy-v399 h2 {
  max-width: 14ch;
  margin: 0 0 10px;
  color: var(--v38-forest-900);
  font: 560 clamp(32px, 3.2vw, 46px)/1.04 var(--v38-serif);
}

.aila-result-copy-v399 p {
  max-width: 34rem;
  margin: 0 0 18px;
  color: var(--v38-muted);
  line-height: 1.6;
}

.aila-result-meta-v399 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--v38-forest-800);
  font: 700 12px/1.4 var(--v38-sans);
}

.aila-result-watch-v399 {
  min-height: 48px;
  margin-top: 18px;
  padding: 0 22px;
  border: 1px solid var(--v38-gold);
  border-radius: 999px;
  color: #fff;
  background: var(--v38-forest-900);
  font-weight: 760;
}

.aila-result-media-v399 {
  min-width: 0;
}

.aila-result-video-v399 {
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 1px solid rgba(23,59,50,.22);
  border-radius: 18px;
  background: #102a24;
  box-shadow: 0 16px 38px rgba(13,43,36,.14);
}

.aila-result-video-v399 video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aila-result-transcript-v399 {
  margin-top: 10px;
  border-top: 1px solid var(--v399-line);
}

.aila-result-transcript-v399 summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--v38-forest-800);
  font-weight: 730;
  cursor: pointer;
}

.aila-result-transcript-copy-v399 {
  max-height: 220px;
  overflow: auto;
  padding: 0 10px 8px 0;
  color: var(--v38-muted);
  font-size: 14px;
  line-height: 1.6;
}

.aila-result-transcript-copy-v399 p {
  margin: 0 0 10px;
}

.result-map-v391 {
  align-items: start;
}

@media (max-width: 980px) {
  .start-intro,
  .question-screen,
  .aila-result-feature-v399 {
    grid-template-columns: 1fr;
  }

  .intro-video-frame {
    max-height: none;
  }

  .question-guide {
    grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
    grid-template-rows: 260px;
    min-height: 260px;
    max-height: none;
  }

  .question-guide img {
    min-height: 260px;
  }

  .question-guide > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .app-header {
    position: sticky;
  }

  .app-footer {
    position: static !important;
  }

  .start-screen {
    min-height: 0;
    padding: 28px 20px 36px;
  }

  .decision-lanes {
    min-height: 0;
  }

  .start-paths-v399 {
    grid-template-columns: 1fr;
  }

  .question-guide {
    grid-template-columns: minmax(150px, 42%) minmax(0, 1fr);
    grid-template-rows: auto;
    min-height: 176px;
  }

  .question-guide img {
    width: 100%;
    height: 100%;
    min-height: 176px;
    object-position: 52% 24%;
  }

  .question-guide > div {
    padding: 20px;
  }

  .question-guide > div strong {
    font-size: clamp(21px, 5.5vw, 26px);
  }

  .aila-result-feature-v399 {
    grid-template-columns: 1fr;
    margin-bottom: 26px;
    padding: 18px;
    border-radius: 18px;
  }

  .aila-result-copy-v399 h2 {
    max-width: none;
  }

  .aila-result-watch-v399 {
    width: 100%;
  }
}

@media print {
  .aila-result-feature-v399 {
    display: none !important;
  }

  .brief-actions-v393,
  .brief-actions {
    display: none !important;
  }
}
