/* V18.4.5 — layout safety / footer + header polish */
html,body{min-height:100%;overflow-x:hidden!important}body{overflow-y:auto!important}
html[data-ifx-product="matematica"] .appShell:not(.route-splash){height:auto!important;min-height:100dvh!important;overflow:visible!important;padding-bottom:calc(154px + env(safe-area-inset-bottom))!important}
html[data-ifx-product="matematica"] .appShell:not(.route-splash) main{height:auto!important;min-height:0!important;overflow:visible!important;padding-bottom:28px!important}
html[data-ifx-product="matematica"] .appShell:not(.route-splash) .brandFooter{position:relative!important;margin-top:28px!important;margin-bottom:calc(34px + env(safe-area-inset-bottom))!important}
html[data-ifx-product="matematica"] .appShell>header .v14Logo{height:auto!important;min-height:54px!important;overflow:visible!important;display:flex!important;align-items:center!important;flex:0 1 auto!important}
html[data-ifx-product="matematica"] .appShell>header .v14Logo img{content:url('./resources/logo-intelectus-matematica-header.webp')!important;display:block!important;width:min(220px,48vw)!important;max-width:100%!important;max-height:72px!important;height:auto!important;object-fit:contain!important;object-position:left center!important}
html[data-ifx-product="matematica"] .route-onboard{padding-bottom:calc(84px + env(safe-area-inset-bottom))!important}
html[data-ifx-product="matematica"] .route-onboard .familySetup{overflow:visible!important;margin-bottom:22px!important}
html[data-ifx-product="matematica"] .route-onboard .setupActions{position:relative!important;z-index:2!important;margin-bottom:4px!important}
html[data-ifx-product="matematica"] .route-onboard .brandFooter{margin-bottom:calc(26px + env(safe-area-inset-bottom))!important}
body:has(.route-onboard) #ifx-commerce-fab{display:none!important}
body:not(:has(.route-splash)):not(:has(.route-onboard)) #ifx-commerce-fab{bottom:calc(104px + env(safe-area-inset-bottom))!important;right:max(18px,env(safe-area-inset-right))!important}
html[data-ifx-product="matematica"] .v14Nav{bottom:calc(10px + env(safe-area-inset-bottom))!important}
@media(max-width:820px){html[data-ifx-product="matematica"] .appShell:not(.route-splash){padding-bottom:calc(138px + env(safe-area-inset-bottom))!important}html[data-ifx-product="matematica"] .appShell>header .v14Logo{min-height:46px!important}html[data-ifx-product="matematica"] .appShell>header .v14Logo img{width:min(190px,52vw)!important;max-height:62px!important}html[data-ifx-product="matematica"] .route-onboard{padding-bottom:calc(64px + env(safe-area-inset-bottom))!important}}
@media(max-width:520px){html[data-ifx-product="matematica"] .appShell:not(.route-splash){padding-bottom:calc(128px + env(safe-area-inset-bottom))!important}html[data-ifx-product="matematica"] .appShell>header .v14Logo img{width:min(172px,50vw)!important;max-height:58px!important}html[data-ifx-product="matematica"] .route-onboard .familySetup{margin-bottom:16px!important}html[data-ifx-product="matematica"] .route-onboard .brandFooter{margin-bottom:calc(20px + env(safe-area-inset-bottom))!important}}
/* V18.4.6 — notebook viewport fit: ações do onboarding sempre no primeiro quadro */
@media (min-width:761px) and (max-height:820px){
  html[data-ifx-product="matematica"] .appShell.route-onboard{padding-top:7px!important;padding-bottom:54px!important}
  html[data-ifx-product="matematica"] .route-onboard>header{top:5px!important;min-height:62px!important;margin-bottom:9px!important;padding:5px 12px!important;border-radius:20px!important}
  html[data-ifx-product="matematica"] .route-onboard>header .v14Logo{min-height:46px!important}
  html[data-ifx-product="matematica"] .route-onboard>header .v14Logo img{width:188px!important;max-height:58px!important}
  html[data-ifx-product="matematica"] .route-onboard>header .headerProfile{padding:5px 10px 5px 6px!important;gap:8px!important}
  html[data-ifx-product="matematica"] .route-onboard>header .headerProfile .castArt{width:42px!important;height:42px!important}
  html[data-ifx-product="matematica"] .route-onboard .familySetup{padding:22px 28px 24px!important;border-radius:28px!important;margin-bottom:14px!important}
  html[data-ifx-product="matematica"] .route-onboard .steps{gap:8px!important;margin-bottom:14px!important}
  html[data-ifx-product="matematica"] .route-onboard .steps i{height:7px!important}
  html[data-ifx-product="matematica"] .route-onboard .step{min-height:27px!important;margin-bottom:9px!important;padding:5px 11px!important;font-size:.69rem!important}
  html[data-ifx-product="matematica"] .route-onboard .familySetup h1{margin-bottom:7px!important;font-size:clamp(2rem,3.4vw,2.45rem)!important;line-height:1.02!important}
  html[data-ifx-product="matematica"] .route-onboard .familySetup>p{margin-bottom:11px!important;font-size:.92rem!important;line-height:1.42!important}
  html[data-ifx-product="matematica"] .route-onboard .familyCharacterGrid{gap:9px!important;margin:10px 0 3px!important}
  html[data-ifx-product="matematica"] .route-onboard .familyCharacterCard{padding:6px!important;border-radius:18px!important}
  html[data-ifx-product="matematica"] .route-onboard .familyCharacterCard .castArt{height:112px!important;min-height:112px!important;aspect-ratio:auto!important;border-radius:14px!important}
  html[data-ifx-product="matematica"] .route-onboard .guideFamilyCard .teacherCast{height:124px!important;min-height:124px!important;aspect-ratio:auto!important}
  html[data-ifx-product="matematica"] .route-onboard .familyCharacterCard b{margin-top:5px!important;font-size:.78rem!important}
  html[data-ifx-product="matematica"] .route-onboard .familyCharacterCard small{min-height:22px!important;margin-top:2px!important;font-size:.65rem!important}
  html[data-ifx-product="matematica"] .route-onboard .setupActions{margin-top:10px!important;gap:9px!important}
  html[data-ifx-product="matematica"] .route-onboard .setupActions .primary,html[data-ifx-product="matematica"] .route-onboard .setupActions .back{min-height:49px!important}
  html[data-ifx-product="matematica"] .route-onboard .soundCard{margin-top:10px!important;padding:15px!important;gap:9px!important}
  html[data-ifx-product="matematica"] .route-onboard .familySetup>.teacherCast{width:125px!important;height:148px!important;max-width:125px!important;max-height:148px!important;margin-bottom:10px!important}
}
/* V18.4.6 — step 5 compacta em notebooks, preservando todos os controles */
@media (min-width:761px) and (max-height:820px){
  html[data-ifx-product="matematica"] .route-onboard .familySetup>.teacherCast{float:left!important;width:92px!important;height:108px!important;max-width:92px!important;max-height:108px!important;margin:0 16px 6px 0!important;border-radius:18px!important}
  html[data-ifx-product="matematica"] .route-onboard .familySetup>.teacherCast+h1{padding-top:6px!important;margin-top:0!important}
  html[data-ifx-product="matematica"] .route-onboard .soundCard{clear:both!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px 8px!important;margin:8px 0 3px!important;padding:11px!important;border-radius:18px!important}
  html[data-ifx-product="matematica"] .route-onboard .soundCard>label{margin:0!important}
  html[data-ifx-product="matematica"] .route-onboard .soundCard>label:first-child,html[data-ifx-product="matematica"] .route-onboard .soundCard>.soundRow{grid-column:1/-1!important}
  html[data-ifx-product="matematica"] .route-onboard .soundCard select{min-height:43px!important;height:43px!important}
  html[data-ifx-product="matematica"] .route-onboard .soundCard .secondary{min-height:41px!important;margin:0!important;padding:6px 8px!important;font-size:.78rem!important;border-radius:13px!important}
  html[data-ifx-product="matematica"] .route-onboard .soundRow{grid-template-columns:66px 1fr 42px!important;gap:8px!important}
  html[data-ifx-product="matematica"] .route-onboard .soundRow input[type=range]{min-height:28px!important}
  html[data-ifx-product="matematica"] .route-onboard .soundRow output{font-size:.72rem!important}
}
