/* BetterLife v40.5 — shared brand, plain-language and progressive-guidance layer */
:root{
  --bl-bg:#f7f1e6;--bl-surface:#fffdf8;--bl-surface-2:#f1eadf;--bl-ink:#172821;--bl-muted:#64736c;
  --bl-green:#123f35;--bl-green-2:#1e5a4b;--bl-gold:#b5862f;--bl-gold-soft:#ead7a7;--bl-line:#ddd3c3;
  --bl-danger:#8e3f36;--bl-success:#2f6a54;--bl-shadow:0 16px 50px rgba(18,63,53,.10);
  --bl-r-sm:12px;--bl-r-md:18px;--bl-r-lg:28px;--bl-max:1200px;
  --bl-space-1:4px;--bl-space-2:8px;--bl-space-3:12px;--bl-space-4:16px;--bl-space-5:24px;--bl-space-6:32px;--bl-space-7:48px;--bl-space-8:64px;
}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:var(--bl-bg);color:var(--bl-ink);font-size:16px;line-height:1.6;overflow-x:hidden}
body{font-family:"Manrope",Arial,sans-serif}
body :where(p,li,dd){text-wrap:pretty}
body :where(h1,h2,h3){text-wrap:balance}
body :where(button,a,input,select,textarea,summary){touch-action:manipulation}
body :where(button,a,[role="button"],summary,input,select,textarea):focus-visible{outline:3px solid #2f6a54;outline-offset:3px;border-radius:8px}
body :where(button,.primary-action,.quiet-button,.aila-button,.back-button,.choice-card,[role="button"]){min-height:44px}
body :where(button,.primary-action,.quiet-button,.aila-button,.back-button){font-weight:700}
body :where(img,video,svg){max-width:100%}
body :where(input,select,textarea){font:inherit;font-size:16px}
body :where(p){max-width:72ch}
.skip-link,.bl403-skip-link{position:fixed;left:16px;top:12px;z-index:10000;padding:10px 14px;border-radius:10px;background:#fff;color:var(--bl-green);box-shadow:var(--bl-shadow);transform:translateY(-160%);transition:transform .18s ease}
.skip-link:focus,.bl403-skip-link:focus{transform:translateY(0)}

/* Site-wide headers/navigation */
.app-header,.guide-header,.ffm-header{backdrop-filter:saturate(140%) blur(16px);-webkit-backdrop-filter:saturate(140%) blur(16px);background:rgba(247,241,230,.92)!important;border-bottom:1px solid rgba(181,134,47,.18)!important}
.app-header,.guide-header,.ffm-header{min-height:72px}
.brand-button img,.guide-brand img,.ffm-brand img,.studio-brand img{width:176px!important;max-height:50px;height:auto!important;object-fit:contain}
.journey-nav,.guide-tabs,.ffm-progress{scrollbar-width:none}
.journey-nav::-webkit-scrollbar,.guide-tabs::-webkit-scrollbar,.ffm-progress::-webkit-scrollbar{display:none}

/* Main React experience */
#root :where(.stage-screen){padding-inline:clamp(18px,4vw,44px)!important}
#root :where(.stage-screen>*){max-width:var(--bl-max);margin-inline:auto}
.start-screen,.question-screen,.result-screen-v391,.scenario-screen,.brief-screen{min-height:calc(100dvh - 72px)}
.start-screen{background:radial-gradient(circle at 85% 10%,rgba(234,215,167,.32),transparent 28%),radial-gradient(circle at 10% 70%,rgba(69,123,100,.12),transparent 30%)}
.start-copy h1,.question-main h1,.result-hero-v391 h1,.scenario-topbar h1,.brief-screen h1{letter-spacing:-.025em;line-height:1.03}
.stage-kicker,.eyebrow{letter-spacing:.08em;text-transform:uppercase;font-weight:800}
.question-choices{display:grid;gap:12px}
.question-choices>button,.question-choices>[role="button"]{min-height:64px!important;border-radius:16px!important;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease}
.question-choices>button:hover,.question-choices>[role="button"]:hover{transform:translateY(-1px);box-shadow:0 10px 28px rgba(18,63,53,.08)}
.question-choices>button:active,.question-choices>[role="button"]:active{transform:translateY(0) scale(.992)}
.result-map-v391,.continuity-path-v391,.scenario-alternatives-v391,.selected-scenario-v391,.boundaries-v391,.brief-sheet,.institutional-identity-v3916,.specialist-gates-v3916,.executive-register-v3916{border-color:rgba(18,63,53,.13)!important;box-shadow:0 12px 34px rgba(18,63,53,.07)!important}
.path-step-v391{position:relative}
.path-step-v391:before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,.52),transparent 44%)}

/* Whole-site new continuity-studio invitation */
.bl403-studio-entry{max-width:var(--bl-max);margin:28px auto 0;padding:0 clamp(18px,4vw,44px)}
.bl403-studio-card{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.65fr);gap:28px;align-items:center;padding:clamp(22px,4vw,38px);border:1px solid rgba(181,134,47,.28);border-radius:var(--bl-r-lg);background:linear-gradient(135deg,#fffdf8 0%,#fbf4e8 60%,#f1e5c9 100%);box-shadow:var(--bl-shadow)}
.bl403-studio-card small{display:block;color:var(--bl-gold);font-weight:800;letter-spacing:.08em;text-transform:uppercase;margin-bottom:8px}
.bl403-studio-card h2{font-family:"Cormorant Garamond",Georgia,serif;font-size:clamp(30px,4vw,46px);line-height:1.02;margin:0 0 12px;color:var(--bl-green)}
.bl403-studio-card p{margin:0;color:var(--bl-muted);font-size:17px}
.bl403-studio-actions{display:flex;flex-direction:column;gap:10px;align-items:stretch}
.bl403-studio-actions a{display:flex;justify-content:center;align-items:center;min-height:48px;padding:10px 18px;border-radius:999px;text-decoration:none;font-weight:800;text-align:center}
.bl403-primary{background:var(--bl-green);color:#fff!important;box-shadow:0 10px 26px rgba(18,63,53,.17)}
.bl403-secondary{background:rgba(255,255,255,.72);color:var(--bl-green)!important;border:1px solid rgba(18,63,53,.18)}

/* Planning guide */
.guide-hero,.guide-workspace,.guide-panel{max-width:var(--bl-max)!important;margin-inline:auto}
.guide-hero{padding-inline:clamp(20px,4vw,48px)!important;padding-top:clamp(42px,7vw,88px)!important}
.hero-copy .hero-lead{font-size:clamp(18px,2vw,21px);line-height:1.65}
.continuity-figure,.guide-panel,.benefit-limit-pair,.professional-review-gates,.validity-note{box-shadow:0 12px 34px rgba(18,63,53,.07)!important;border-color:rgba(18,63,53,.13)!important}
.guide-tabs{position:sticky;top:72px;z-index:20;background:rgba(247,241,230,.94);backdrop-filter:blur(14px);padding-block:10px;border-bottom:1px solid rgba(18,63,53,.09)}
.guide-tabs button{min-height:44px!important}
.guide-panel{scroll-margin-top:150px}

/* Family Funding Map */
.ffm-header-tools button{min-height:44px!important}
#map-main{min-height:calc(100dvh - 126px)}
.ffm-privacy-bar{font-size:13px;line-height:1.45}
.ffm-privacy-bar>div{min-width:0}
.ffm-privacy-bar span{overflow-wrap:anywhere}
.dialog-shell,.portrait-dialog-shell{box-shadow:0 24px 80px rgba(18,63,53,.24)}
.aila-chapters button{min-height:44px}
.ffm-header-tools button{white-space:nowrap}

/* Progressive disclosure: important answer first, professional detail on demand */
.bl405-disclosure{margin:18px 0;border:1px solid rgba(18,63,53,.14);border-radius:18px;background:#fffdf8;box-shadow:0 10px 30px rgba(18,63,53,.05);overflow:hidden}
.bl405-disclosure>summary{display:flex;align-items:center;justify-content:space-between;min-height:54px;padding:12px 18px;color:var(--bl-green);font-weight:800;cursor:pointer;list-style:none}
.bl405-disclosure>summary::-webkit-details-marker{display:none}
.bl405-disclosure>summary::after{content:"+";display:grid;place-items:center;width:28px;height:28px;border:1px solid rgba(18,63,53,.18);border-radius:50%;font-size:18px;line-height:1}
.bl405-disclosure[open]>summary::after{content:"−"}
.bl405-disclosure-body{padding:0 16px 16px}
.bl405-disclosure-body>:first-child{margin-top:0!important}
.bl405-disclosure-body>:last-child{margin-bottom:0!important}

/* Trust Guide result: the user sees the answer before legal review material */
.result-screen-v391.bl405-result-order{display:flex!important;flex-direction:column;align-items:stretch}
.bl405-result-order>.result-hero-v391{order:1}
.bl405-result-order>.result-map-v391{order:2}
.bl405-result-order>.selected-scenario-v391{order:3}
.bl405-result-order>.aila-result-feature-v399{order:4}
.bl405-result-order>.bl405-specialist-disclosure{order:5}
.bl405-result-order>.boundaries-v391{order:6}
.bl405-result-order>.bl403-studio-entry{order:7}
.bl405-result-order .result-hero-v391{margin-bottom:18px}
.bl405-result-order .result-map-v391{margin-top:0}
.bl405-specialist-disclosure .specialist-gates-v3916{margin:0!important;box-shadow:none!important;border:0!important}

/* Family Funding Map: one task at a time */
#map-main :where(.stage-heading h1,.editorial-head h1,.family-wide-head h1){font-size:clamp(2.8rem,4.4vw,4.7rem)!important;line-height:.98!important}
.bl405-map-funding .stage-heading{margin-bottom:1rem}
.bl405-map-funding .context-help{margin:.7rem 0 1rem;padding:.75rem 1rem;min-height:0}
.bl405-map-funding .context-help h3{margin:.1rem 0;font-size:1rem}
.bl405-map-funding .context-help p{margin:.15rem 0;font-size:.82rem;line-height:1.45}
.bl405-map-funding .love-structure-funds{margin:.8rem 0 1rem;padding:1rem;border-radius:18px}
.bl405-map-funding .love-structure-funds>header{gap:.55rem}
.bl405-map-funding .love-structure-funds h2{font-size:clamp(1.8rem,3vw,2.7rem)}
.bl405-map-funding .funding-choice-grid article{padding:.8rem;min-height:0}
.bl405-map-funding .privacy-callout{margin:.7rem 0;padding:.7rem .9rem;font-size:.78rem;line-height:1.45}
.funding-card:not(.bl405-fund-included)>:not(.funding-card-head){display:none!important}
.funding-card:not(.bl405-fund-included){min-height:72px;padding:.9rem 1rem;align-content:center;box-shadow:none}
.funding-card:not(.bl405-fund-included) .funding-card-head{align-items:center}
.funding-card:not(.bl405-fund-included) .funding-card-head h3{font-size:1.08rem}
.funding-card.bl405-fund-included{border-color:rgba(47,106,84,.38);box-shadow:0 14px 38px rgba(18,63,53,.08)}
.bl405-empty-preview img{opacity:.32}
.bl405-empty-preview p strong{color:var(--bl-green)}

/* Funding result: outcome, explanation, then optional professional detail */
.bl405-family-result{display:flex!important;flex-direction:column;gap:0}
.bl405-family-result>.editorial-head{order:1}
.bl405-family-result>.family-story-thread{order:2}
.bl405-family-result>.family-outcome{order:3}
.bl405-family-result>.complexity-result.has-flags{order:4}
.bl405-family-result>.map-result-aila{order:5}
.bl405-family-result>.assumption-strip{order:6}
.bl405-family-result>.route-verification-banner{order:7}
.bl405-family-result>.needs-calculation{order:8}
.bl405-family-result>.family-route-overview{order:9}
.bl405-family-result>.family-provision-map{order:10}
.bl405-family-result>.bl405-governance-disclosure{order:11}
.bl405-family-result>.bl405-route-disclosure{order:12}
.bl405-family-result>.runway-details{order:13}
.bl405-family-result>.planning-lab{order:14}
.bl405-family-result>.result-boundary{order:15}
.bl405-family-result>.technical-details{order:16}
.bl405-family-result>.bl405-secondary-check{display:none!important}
.bl405-family-result .family-outcome{margin-top:1rem}
.bl405-family-result .map-result-aila{margin-top:1rem}
.bl405-family-result .assumption-strip,.bl405-family-result .route-verification-banner{margin-block:.65rem}
.bl405-governance-disclosure .governance-map,.bl405-route-disclosure .route-scenario-check{margin:0!important;border:0!important;box-shadow:none!important}

/* Stronger readable density and card discipline */
:where(.institutional-identity-v3916,.specialist-gates-v3916,.executive-register-v3916) p,
:where(.institutional-identity-v3916,.specialist-gates-v3916,.executive-register-v3916) span{line-height:1.55}
:where(.institutional-identity-v3916,.specialist-gates-v3916,.executive-register-v3916) article{border-radius:14px!important}

/* Utility status styles injected by JS */
.bl403-status{display:inline-flex;align-items:center;gap:7px;padding:6px 10px;border-radius:999px;background:#edf4f0;color:#255846;font-size:13px;font-weight:800}
.bl403-status:before{content:"";width:8px;height:8px;border-radius:50%;background:#4c8a70}

@media(max-width:900px){
  .bl403-studio-card{grid-template-columns:1fr}
  .bl403-studio-actions{flex-direction:row;flex-wrap:wrap}
  .bl403-studio-actions a{flex:1 1 220px}
  .guide-tabs{top:64px}
}
@media(max-width:680px){
  .app-header,.guide-header,.ffm-header{min-height:64px}
  #root :where(.stage-screen){padding-inline:16px!important}
  .start-copy h1,.question-main h1,.result-hero-v391 h1,.brief-screen h1{font-size:clamp(34px,11vw,48px)!important}
  .question-choices>button,.question-choices>[role="button"]{min-height:60px!important}
  .bl403-studio-entry{padding:0 16px;margin-top:20px}
  .bl403-studio-card{padding:22px;border-radius:22px}
  .bl403-studio-card h2{font-size:34px}
  .bl403-studio-card p{font-size:16px}
  .bl403-studio-actions{flex-direction:column}
  .bl403-studio-actions a{width:100%;flex:auto}
  .ffm-header{padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right))}
  .ffm-header-tools{gap:6px}
  .ffm-header-tools button{min-width:44px;padding-inline:10px;font-size:12px}
  .ffm-privacy-bar{padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .brand-button img,.guide-brand img,.ffm-brand img,.studio-brand img{width:148px!important;max-height:42px}
  #map-main :where(.stage-heading h1,.editorial-head h1,.family-wide-head h1){font-size:clamp(2.35rem,11vw,3.2rem)!important}
  .bl405-map-funding .love-structure-funds{padding:.8rem}
  .bl405-map-funding .funding-choice-grid{grid-template-columns:1fr}
  .bl405-disclosure>summary{padding:11px 14px}
  .bl405-disclosure-body{padding:0 10px 10px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
@media print{
  .bl403-studio-entry,.app-header,.guide-header,.ffm-header,.guide-tabs,.ffm-privacy-bar{display:none!important}
  body{background:#fff!important;color:#111!important}
  *{box-shadow:none!important;text-shadow:none!important}
  .bl405-disclosure>summary{display:none!important}
  .bl405-disclosure>.bl405-disclosure-body{display:block!important;padding:0!important}
  .bl405-family-result>.bl405-secondary-check{display:block!important}
}
