
/* HealthByAI restored visual fidelity R5. Preserves R4 compact sizing. */
:root{--hba-compact-sidebar:252px}
@media(min-width:800px){
  body.physio-injected-rail #hba-rail.physio-unified-rail{
    position:fixed!important;inset:12px auto 12px 12px!important;
    left:12px!important;right:auto!important;top:12px!important;bottom:12px!important;
    width:226px!important;min-width:226px!important;max-width:226px!important;
    height:calc(100dvh - 24px)!important;max-height:calc(100dvh - 24px)!important;
    margin:0!important;
    border:1px solid rgba(230,169,109,.22)!important;border-radius:26px!important;
    box-shadow:0 22px 72px rgba(0,0,0,.38),inset 0 1px rgba(255,255,255,.055),0 0 0 1px rgba(238,185,123,.035)!important;
    background:radial-gradient(ellipse at 15% -3%,rgba(242,165,98,.12),transparent 48%),linear-gradient(180deg,rgba(22,22,23,.975),rgba(8,12,17,.97))!important;
    backdrop-filter:blur(22px) saturate(112%)!important;
    overflow:hidden!important;
  }
  body.physio-injected-rail #root{
    margin:0 0 0 var(--hba-compact-sidebar)!important;
    width:calc(100% - var(--hba-compact-sidebar))!important;
    max-width:calc(100% - var(--hba-compact-sidebar))!important;
    min-width:0!important;
  }
  /* EAN uses the same ornamented pod but keeps the rail in the flex layout. */
  html:has(#app) body>#hba-rail.physio-unified-rail{
    position:sticky!important;inset:auto!important;top:12px!important;left:auto!important;
    flex:0 0 226px!important;align-self:flex-start!important;
    width:226px!important;min-width:226px!important;max-width:226px!important;
    height:calc(100dvh - 24px)!important;max-height:calc(100dvh - 24px)!important;
    margin:12px 0 12px 12px!important;
    border:1px solid rgba(230,169,109,.22)!important;border-radius:26px!important;
    box-shadow:0 22px 72px rgba(0,0,0,.35),inset 0 1px rgba(255,255,255,.055)!important;
    background:radial-gradient(ellipse at 15% -3%,rgba(242,165,98,.12),transparent 48%),linear-gradient(180deg,rgba(22,22,23,.975),rgba(8,12,17,.97))!important;
    backdrop-filter:blur(22px) saturate(112%)!important;
  }
  html:has(#app) body>main{min-width:0!important;max-width:none!important;overflow:visible!important}
}
@media(min-width:800px) and (max-width:1100px){
  :root{--hba-compact-sidebar:230px}
  body.physio-injected-rail #hba-rail.physio-unified-rail{
    left:10px!important;top:10px!important;bottom:10px!important;
    width:208px!important;min-width:208px!important;max-width:208px!important;
    height:calc(100dvh - 20px)!important;max-height:calc(100dvh - 20px)!important;
  }
  html:has(#app) body>#hba-rail.physio-unified-rail{
    flex-basis:208px!important;width:208px!important;min-width:208px!important;max-width:208px!important;
    margin-left:10px!important;
  }
}
#hba-rail.physio-unified-rail{
  color:#dadddf!important;isolation:isolate!important;
  border-color:rgba(231,169,112,.23)!important;
}
#hba-rail.physio-unified-rail::before{
  content:"";position:absolute;z-index:2;top:0;left:20px;right:20px;height:1px;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(245,183,120,.72),rgba(110,207,169,.38),transparent);
  box-shadow:0 0 14px rgba(255,167,85,.16);
}
#hba-rail.physio-unified-rail::after{
  content:"";position:absolute;right:-65px;top:42%;width:155px;height:155px;border-radius:50%;
  pointer-events:none;z-index:0;opacity:.5;
  background:radial-gradient(circle,rgba(75,124,167,.16),transparent 68%);
}
#hba-rail.physio-unified-rail .hba-brand{
  position:relative!important;z-index:1!important;
  border-bottom:1px solid rgba(216,191,172,.12)!important;
  background:linear-gradient(110deg,rgba(224,145,83,.09),rgba(25,26,29,.03) 80%)!important;
  min-height:65px!important;height:65px!important;padding:10px 13px!important;
}
#hba-rail.physio-unified-rail .hba-brand a{
  font:720 15px/1.16 system-ui,sans-serif!important;color:#f2f2f1!important;
}
#hba-rail.physio-unified-rail .hba-brand small{
  font:700 8px/1.22 system-ui,sans-serif!important;letter-spacing:1.25px!important;
  color:#91a5b2!important;
}
#hba-rail.physio-unified-rail .hba-logo rect{fill:#efb781!important}
#hba-rail.physio-unified-rail .hba-logo path{stroke:#13212a!important}
#hba-rail.physio-unified-rail nav{position:relative!important;z-index:1!important}
#hba-rail.physio-unified-rail .hba-group>p{
  color:#73808b!important;font:780 9px/1.35 system-ui,sans-serif!important;
  letter-spacing:1.45px!important;
}
#hba-rail.physio-unified-rail .hba-link{
  position:relative!important;min-height:37px!important;
  color:#aab2b7!important;border:1px solid transparent!important;
  border-radius:11px!important;transition:color .18s ease,background .18s ease,border-color .18s ease,box-shadow .18s ease!important;
}
#hba-rail.physio-unified-rail .hba-link svg{
  opacity:.9!important;filter:drop-shadow(0 0 0 transparent);
}
#hba-rail.physio-unified-rail .hba-link[href="/dashboard"] svg{color:#e8ab74!important}
#hba-rail.physio-unified-rail .hba-link[href="/log"] svg{color:#5fd0ad!important}
#hba-rail.physio-unified-rail .hba-link[href="/renpho"] svg{color:#bfaaa2!important}
#hba-rail.physio-unified-rail .hba-link[href="/physical"] svg{color:#c9aba4!important}
#hba-rail.physio-unified-rail .hba-link[href="/history"] svg{color:#9eafbc!important}
#hba-rail.physio-unified-rail .hba-link[href="/calendar"] svg{color:#b9ac9e!important}
#hba-rail.physio-unified-rail .hba-link[href="/foods"] svg{color:#eac27b!important}
#hba-rail.physio-unified-rail .hba-link[href="/compare"] svg{color:#d6aaad!important}
#hba-rail.physio-unified-rail .hba-link[href="/raw"] svg{color:#e5a261!important}
#hba-rail.physio-unified-rail .hba-link[href="/ean-catalog"] svg{color:#c0a4ee!important}
#hba-rail.physio-unified-rail .hba-link[href="/sources"] svg{color:#86ceda!important}
#hba-rail.physio-unified-rail .hba-link[href="/advanced"] svg{color:#d3b58e!important}
#hba-rail.physio-unified-rail .hba-link[href="/profile"] svg{color:#e69dab!important}
#hba-rail.physio-unified-rail .hba-link:hover{
  color:#f6e5d2!important;background:linear-gradient(95deg,rgba(229,142,74,.10),rgba(129,89,48,.025))!important;
  border-color:rgba(235,181,117,.15)!important;
}
#hba-rail.physio-unified-rail .hba-link.active,
#hba-rail.physio-unified-rail .hba-link[aria-current="page"]{
  color:#f4e7d9!important;
  background:linear-gradient(100deg,rgba(220,136,68,.23),rgba(173,116,68,.08) 65%,rgba(12,15,18,.38))!important;
  border-color:rgba(245,177,109,.29)!important;
  border-radius:12px!important;
  box-shadow:inset 2px 0 0 rgba(238,170,104,.9),inset 0 1px rgba(255,255,255,.035),0 8px 27px rgba(0,0,0,.10)!important;
}
#hba-rail.physio-unified-rail .hba-footer{
  z-index:1!important;position:relative!important;
  color:#96a5af!important;border-top:1px solid rgba(228,184,138,.085)!important;
  background:linear-gradient(90deg,rgba(10,17,24,.74),rgba(7,13,19,.92))!important;
  padding:10px 13px!important;
}
@media(max-width:799px){
  body.physio-injected-rail #hba-rail.physio-unified-rail{
    width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;
    margin:8px!important;border:1px solid rgba(230,169,109,.22)!important;
    border-radius:16px!important;
    box-shadow:0 14px 34px rgba(0,0,0,.25)!important;
  }
  body.physio-injected-rail #hba-rail.physio-unified-rail .hba-brand{
    min-height:49px!important;height:49px!important;padding:7px 12px!important;
  }
  html:has(#app) body>#hba-rail.physio-unified-rail{
    width:calc(100% - 16px)!important;max-width:calc(100% - 16px)!important;
    margin:8px!important;border:1px solid rgba(230,169,109,.22)!important;border-radius:16px!important;
  }
}
/* Restore RAW semantic palette accents and details without replacing nutrient values. */
body.physio-injected-rail #root .text-cyan-400,
body.physio-injected-rail #root .text-sky-400{color:#efa961!important}
body.physio-injected-rail #root .border-cyan-500\/20{border-color:rgba(239,169,97,.22)!important}
