/* Infinis system theme compatibility layer.
   Loaded last so every tab respects the operating-system light/dark preference. */
:root{
  --themeSurface:#ffffff;
  --themeSurfaceRaised:#ffffff;
  --themeSurfaceSoft:#f1f4fb;
  --themeSurfaceGlass:rgba(255,255,255,.88);
  --themeBorder:rgba(24,34,60,.12);
  --themeText:#151a2d;
  --themeMuted:#667085;
  --themeShadow:0 14px 38px rgba(29,42,78,.09);
  --themeTopbar:rgba(255,255,255,.82);
  --themeNav:rgba(255,255,255,.9);
}

@media (prefers-color-scheme:light){
  html,body,.app{background-color:#f7f9ff!important;color:var(--themeText)!important}
  body:before{opacity:.42}
  .topbar{background:var(--themeTopbar)!important;border-bottom-color:var(--themeBorder)!important;box-shadow:0 8px 28px rgba(29,42,78,.08),inset 0 -1px 0 rgba(255,255,255,.75)!important}
  .bottomnav{background:var(--themeNav)!important;border-color:var(--themeBorder)!important;box-shadow:0 -8px 28px rgba(29,42,78,.09),inset 0 1px 0 rgba(255,255,255,.9)!important}
  .bell{background:#fff!important;border-color:var(--themeBorder)!important;color:var(--themeText)!important}
  .toast{background:#fff!important;color:var(--themeText)!important;border:1px solid var(--themeBorder)!important}
  .tab-loader{background:rgba(247,249,255,.72)!important}

  /* Core/member tab previously used fixed dark colors. */
  .coretab{background:transparent!important;color:var(--themeText)!important}
  .coretab__profile,.coretab__membership,.coretab__list,.coretab__row,
  .coretab__masthead,.coretab__command,.coretab__memberCard,.coretab__pulsePanel,
  .godMembersPanel,.godMembersHero,.godMembersDetails,.godMembersSignedOut,
  .godMembersTopbar,.godMembersRow{
    background:var(--themeSurface)!important;
    color:var(--themeText)!important;
    border-color:var(--themeBorder)!important;
  }
  .coretab__profile,.coretab__membership,.coretab__list,
  .coretab__masthead,.coretab__command,.coretab__memberCard,.coretab__pulsePanel,
  .godMembersPanel,.godMembersHero,.godMembersDetails,.godMembersSignedOut{box-shadow:var(--themeShadow)!important}
  .coretab__row{border-bottom-color:var(--themeBorder)!important}
  .coretab__row:active{background:var(--themeSurfaceSoft)!important}
  .coretab__identityCopy span,.coretab__membership p,.coretab__rowCopy small,
  .coretab__footer,.coretab__footer span,.coretab__footer small,
  .coretab__welcome p,.coretab__welcome>div>span,.coretab__moduleCopy small,
  .coretab__memberCopy p,.coretab__metrics span,.godMembersHero p,.godMembersSignedOut p{color:var(--themeMuted)!important}
  .coretab__footer strong,.coretab__row,.coretab__identity,.coretab__module,.coretab__metrics div{color:var(--themeText)!important}
  .coretab__rowIcon,.coretab__module,.coretab__metrics div,.coretab__badge,.godMembersRow{background:var(--themeSurfaceSoft)!important}
  .coretab__membershipMark{background:color-mix(in srgb,var(--appBlue) 16%,#fff)!important;color:#2451b7!important}
  .coretab__toast{background:#fff!important;color:var(--themeText)!important;border-color:var(--themeBorder)!important;box-shadow:0 16px 46px rgba(29,42,78,.16)!important}
  .godMembersTopbar button{background:var(--themeSurfaceSoft)!important;border-color:var(--themeBorder)!important;color:var(--themeText)!important}

  /* Search, catalog, merit, aura and hub surfaces. */
  .findToolbar{background:transparent!important;background-color:transparent!important;background-image:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important}
  .findSearch,.findSavedShortcut,.findBackBtn,.findFilterBtn,.findQuickChip,
  .findResultCard,.findSortSelect,.findProductSheet,.findProductClose,.findProductShare,
  .findProductSave,.findProductFact,.findProductChoices>div,
  .meritPromoCard,.meritRewardCard,.meritCategoryRail button,.meritTierCard,.meritActivityList,
  .auraHero,.auraStatement,.auraSection,.auraPreview,.auraReleaseCard,
  .hubCard,.hubPanel,.hubModule{
    background-color:var(--themeSurface)!important;
    color:var(--themeText)!important;
    border-color:var(--themeBorder)!important;
  }
  .findProductGallery,.meritMiniTrack,.meritJourney:before,.auraFeature,.auraFlow div,
  .auraFlow div i,.findProductCallout>i{background-color:var(--themeSurfaceSoft)!important}

  /* Shop by budget cards must use true light surfaces in day mode. */
  .findMerchChip{
    background:var(--themeSurface)!important;
    color:var(--themeText)!important;
    border-color:var(--themeBorder)!important;
    box-shadow:var(--themeShadow)!important;
  }
  .findMerchChip>i:first-child{
    background:color-mix(in srgb,var(--appBlue) 12%,#ffffff)!important;
    color:#2451b7!important;
  }
  .findMerchChip strong{color:var(--themeText)!important}
  .findMerchChip small{color:var(--themeMuted)!important;opacity:1!important}
  .findMerchChip>i:last-child{color:var(--themeText)!important}
  .findProductSheet{box-shadow:0 -20px 60px rgba(29,42,78,.16)!important}
  .findProductOverlay{background:rgba(31,41,55,.24)!important}
  .meritRewardArt span{background:rgba(255,255,255,.94)!important;color:#334155!important}

  /* Embedded account overlay light surfaces were partially overridden by fixed translucent dark values. */
  #infinisAuthRoot .infinisAuthPanel,
  #infinisAuthRoot .infinisAuthAccount .infinisAuthCard,
  #infinisAuthRoot .infinisAuthAccountTop,
  #infinisAuthRoot .infinisAuthMemberTabs,
  #infinisAuthRoot .infinisAuthFloatingActions,
  #infinisAuthRoot .infinisAuthProfileHero,
  #infinisAuthRoot .infinisAuthQuickCard,
  #infinisAuthRoot .infinisAuthInfoSection,
  #infinisAuthRoot .infinisAuthInfoRow{
    color:#111827!important;
    border-color:rgba(24,34,60,.12)!important;
  }
}

@media (prefers-color-scheme:dark){
  :root{
    --themeSurface:#111827;
    --themeSurfaceRaised:#172033;
    --themeSurfaceSoft:#202a3e;
    --themeSurfaceGlass:rgba(17,24,39,.9);
    --themeBorder:rgba(203,213,225,.14);
    --themeText:#f8fafc;
    --themeMuted:#aeb8ca;
    --themeShadow:0 18px 48px rgba(0,0,0,.28);
    --themeTopbar:rgba(9,14,25,.82);
    --themeNav:rgba(9,14,25,.9);
  }
  html,body,.app{background-color:#070b13!important;color:var(--themeText)!important}
  body:before{opacity:.7}
  .topbar{background:var(--themeTopbar)!important;border-bottom-color:var(--themeBorder)!important;box-shadow:0 10px 38px rgba(0,0,0,.28)!important}
  .bottomnav{background:var(--themeNav)!important;border-color:var(--themeBorder)!important;box-shadow:0 -10px 38px rgba(0,0,0,.3)!important}
  .bell{background:rgba(255,255,255,.07)!important;border-color:var(--themeBorder)!important;color:var(--themeText)!important}
  .toast{background:#172033!important;color:var(--themeText)!important;border:1px solid var(--themeBorder)!important}
  .tab-loader{background:rgba(3,6,14,.7)!important}

  .coretab{background:transparent!important;color:var(--themeText)!important}
  .coretab__profile,.coretab__membership,.coretab__list,.coretab__row,
  .coretab__masthead,.coretab__command,.coretab__memberCard,.coretab__pulsePanel,
  .godMembersPanel,.godMembersHero,.godMembersDetails,.godMembersSignedOut,
  .godMembersTopbar,.godMembersRow{
    background:var(--themeSurfaceRaised)!important;
    color:var(--themeText)!important;
    border-color:var(--themeBorder)!important;
  }
  .coretab__identityCopy span,.coretab__membership p,.coretab__rowCopy small,
  .coretab__footer,.coretab__welcome p,.coretab__welcome>div>span,.coretab__moduleCopy small,
  .coretab__memberCopy p,.coretab__metrics span,.godMembersHero p,.godMembersSignedOut p{color:var(--themeMuted)!important}
  .coretab__rowIcon,.coretab__module,.coretab__metrics div,.coretab__badge,.godMembersRow{background:var(--themeSurfaceSoft)!important;color:var(--themeText)!important}
  .coretab__row:active{background:#263249!important}
  .coretab__toast{background:#172033!important;color:#f8fafc!important;border-color:var(--themeBorder)!important}

  .findToolbar{background:transparent!important;background-color:transparent!important;background-image:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important}
  .findSearch,.findSavedShortcut,.findBackBtn,.findFilterBtn,.findQuickChip,
  .findResultCard,.findSortSelect,.findProductSheet,.findProductClose,.findProductShare,
  .findProductSave,.findProductFact,.findProductChoices>div,
  .meritPromoCard,.meritRewardCard,.meritCategoryRail button,.meritTierCard,.meritActivityList,
  .auraHero,.auraStatement,.auraSection,.auraPreview,.auraReleaseCard,
  .hubCard,.hubPanel,.hubModule{
    background-color:var(--themeSurface)!important;
    color:var(--themeText)!important;
    border-color:var(--themeBorder)!important;
  }
  .findProductGallery,.meritMiniTrack,.meritJourney:before,.auraFeature,.auraFlow div,
  .auraFlow div i,.findProductCallout>i{background-color:var(--themeSurfaceSoft)!important}
  .findProductOverlay{background:rgba(0,0,0,.62)!important}
  .findProductSheet{box-shadow:0 -20px 60px rgba(0,0,0,.48)!important}
  .meritRewardArt span{background:rgba(17,24,39,.9)!important;color:#f8fafc!important}

  #infinisAuthRoot .infinisAuthPanel,
  #infinisAuthRoot .infinisAuthAccount .infinisAuthCard,
  #infinisAuthRoot .infinisAuthAccountTop,
  #infinisAuthRoot .infinisAuthMemberTabs,
  #infinisAuthRoot .infinisAuthFloatingActions,
  #infinisAuthRoot .infinisAuthProfileHero,
  #infinisAuthRoot .infinisAuthQuickCard,
  #infinisAuthRoot .infinisAuthInfoSection,
  #infinisAuthRoot .infinisAuthInfoRow{
    color:#f8fafc!important;
    border-color:rgba(203,213,225,.14)!important;
  }
}

/* iOS Safari focus-zoom prevention
   Keep every editable form control at 16px or larger on touch-sized screens.
   Safari automatically zooms the viewport when focusing controls below 16px. */
@media (max-width: 900px) {
  input,
  textarea,
  select,
  [contenteditable="true"],
  [role="textbox"] {
    font-size: 16px !important;
  }
}
