/* RXOPD Index Preserve Alignment V8
   Scope: visual alignment only. No workflow, no SQL, no admin/company/pharmacy logic.
   Contract: keep existing index design; fix header flow, card containment, mobile overflow, and requested typography. */
:root{
  --rx-v8-page-x:clamp(8px,2.8vw,24px);
  --rx-v8-max:1180px;
  --rx-v8-radius:18px;
  --rx-v8-gap:10px;
  --rx-v8-font:12px;
  --rx-v8-quick-label:14px;
  --rx-v8-line:#dcecff;
  --rx-v8-shadow:0 10px 26px rgba(11,94,215,.08);
  --rx-v8-blue:#1769e0;
  --rx-v8-ink:#0b2540;
  --rx-v8-muted:#64748b;
}
html{font-size:var(--rx-v8-font)!important;-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;overflow-x:hidden!important;}
body{overflow-x:hidden!important;}
body.rx-standard-shell{font-size:var(--rx-v8-font)!important;line-height:1.42!important;color:var(--rx-v8-ink)!important;}
*,*::before,*::after{box-sizing:border-box;min-width:0;}
img,svg,video,canvas{max-width:100%;height:auto;}
button,a,input,select,textarea{font-family:inherit;}

/* Header must stay in the document flow. Main content starts after it, never under it. */
body.rx-standard-shell .rx-topbar,
body.rx-standard-shell .rx-topbar.rx-hanging-header,
body.rx-standard-shell header.rx-topbar.rx-hanging-header{
  position:sticky!important;
  top:0!important;
  left:auto!important;
  right:auto!important;
  transform:none!important;
  translate:none!important;
  width:min(var(--rx-v8-max), calc(100% - 16px))!important;
  max-width:var(--rx-v8-max)!important;
  min-height:56px!important;
  height:auto!important;
  margin:0 auto 10px!important;
  padding:7px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  z-index:1000!important;
  border-radius:0 0 18px 18px!important;
  overflow:visible!important;
  box-shadow:0 10px 26px rgba(15,50,90,.11)!important;
}
body.rx-standard-shell .rx-topbar .rx-brand,
body.rx-standard-shell .rx-topbar .rx-logo-brand{display:flex!important;align-items:center!important;min-width:0!important;max-width:160px!important;height:auto!important;overflow:hidden!important;}
body.rx-standard-shell .rx-topbar .rx-brand img,
body.rx-standard-shell .rx-topbar .rx-logo-brand img{height:auto!important;max-height:42px!important;max-width:150px!important;object-fit:contain!important;}
body.rx-standard-shell .rx-page{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:8px 0 40px!important;
  overflow-x:hidden!important;
  clear:both!important;
}
body.rx-standard-shell .rx-topbar + .rx-page{margin-top:0!important;padding-top:8px!important;}
body.rx-standard-shell .rx-page > .rxhome,
body.rx-standard-shell .rxhome,
body.rx-standard-shell .rx20-page{
  width:min(var(--rx-v8-max), calc(100% - (var(--rx-v8-page-x) * 2)))!important;
  max-width:var(--rx-v8-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow:visible!important;
}

/* Do not let old emergency patches create a fake bottom/footer layer. */
.rx-sticky-bottom,.sticky-bottom,.bottom-tabs,.mobile-bottom-nav,.rx-doctor-bottom-actions,.rx-fixed-footer{position:static!important;inset:auto!important;transform:none!important;}

/* Base index section containment; preserve original colors/design as much as possible. */
body.rx-standard-shell .rxhome-shell,
body.rx-standard-shell .rxhome-section,
body.rx-standard-shell .rxhome-ad,
body.rx-standard-shell .rx20-home-block{
  max-width:100%!important;
  overflow:hidden!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}
body.rx-standard-shell .rxhome-section{margin-top:12px!important;}
body.rx-standard-shell .rxhome-section h2,
body.rx-standard-shell .rxhome-section-head h2,
body.rx-standard-shell .rx20-home-head h2{
  font-size:16px!important;
  line-height:1.18!important;
  font-weight:900!important;
  letter-spacing:-.01em!important;
  color:var(--rx-v8-ink)!important;
}

/* Quick Actions: centered title, eight cards stay inside parent, label exactly 14px. */
body.rx-standard-shell .rxhome-actions-section{
  background:#fff!important;
  border:1px solid var(--rx-v8-line)!important;
  border-radius:var(--rx-v8-radius)!important;
  box-shadow:var(--rx-v8-shadow)!important;
  padding:12px!important;
  margin-top:12px!important;
}
body.rx-standard-shell .rxhome-actions-section > h2{
  text-align:center!important;
  margin:0 0 12px!important;
  width:100%!important;
}
body.rx-standard-shell .rxhome-actions{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
  margin:0!important;
  align-items:stretch!important;
}
body.rx-standard-shell .rxhome-actions a{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:76px!important;
  padding:8px 4px!important;
  border-radius:12px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  text-align:center!important;
  white-space:normal!important;
  overflow:hidden!important;
}
body.rx-standard-shell .rxhome-actions a span{font-size:22px!important;line-height:1!important;display:block!important;}
body.rx-standard-shell .rxhome-actions a b{
  font-size:var(--rx-v8-quick-label)!important;
  line-height:1.05!important;
  font-weight:900!important;
  text-align:center!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  display:block!important;
}

/* Advertisement cards: keep the current nice design, only contain overflow. */
body.rx-standard-shell .rxhome-ad{
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body.rx-standard-shell .rxhome-ad-copy{min-width:0!important;max-width:100%!important;}
body.rx-standard-shell .rxhome-ad-art{max-width:48%!important;object-fit:contain!important;}
body.rx-standard-shell .rxhome-ad-arrow{flex:0 0 auto!important;}
body.rx-standard-shell .rxhome-dots{max-width:100%!important;}

/* Explore Near You: title centered; View All and cards stay inside section. */
body.rx-standard-shell .rxhome-near-section{
  background:#fff!important;
  border:1px solid var(--rx-v8-line)!important;
  border-radius:var(--rx-v8-radius)!important;
  box-shadow:var(--rx-v8-shadow)!important;
  padding:12px!important;
}
body.rx-standard-shell .rxhome-near-section .rxhome-section-head{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  width:100%!important;
  margin:0 0 10px!important;
  text-align:center!important;
}
body.rx-standard-shell .rxhome-near-section .rxhome-section-head h2{flex:1 1 100%!important;text-align:center!important;margin:0!important;}
body.rx-standard-shell .rxhome-near-section .rxhome-section-head a{
  position:static!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  max-width:100%!important;
  padding:6px 12px!important;
  border-radius:999px!important;
  background:#eef7ff!important;
  border:1px solid var(--rx-v8-line)!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
body.rx-standard-shell .rxhome-pills{width:100%!important;max-width:100%!important;display:flex!important;gap:6px!important;overflow-x:auto!important;padding:2px 0 8px!important;scrollbar-width:none;}
body.rx-standard-shell .rxhome-pills::-webkit-scrollbar{display:none;}
body.rx-standard-shell .rxhome-pills button{flex:0 0 auto!important;font-size:12px!important;white-space:nowrap!important;}
body.rx-standard-shell .rxhome-near-grid{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0 0 4px!important;
  display:flex!important;
  gap:8px!important;
  overflow-x:auto!important;
  scroll-snap-type:x proximity!important;
  -webkit-overflow-scrolling:touch!important;
  scrollbar-width:none!important;
}
body.rx-standard-shell .rxhome-near-grid::-webkit-scrollbar{display:none;}
body.rx-standard-shell .rxhome-map-card,
body.rx-standard-shell .rxhome-near-card{
  flex:0 0 min(210px,78vw)!important;
  min-width:0!important;
  max-width:210px!important;
  scroll-snap-align:start!important;
  overflow:hidden!important;
}

/* Network at a Glance / stats: keep all mini cards inside parent. */
body.rx-standard-shell .rxhome-network-row,
body.rx-standard-shell .rxhome-network-card{
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body.rx-standard-shell .rxhome-network-card{
  background:#fff!important;
  border:1px solid var(--rx-v8-line)!important;
  border-radius:var(--rx-v8-radius)!important;
  box-shadow:var(--rx-v8-shadow)!important;
  padding:12px!important;
}
body.rx-standard-shell .rxhome-network-card h2{text-align:center!important;margin:0 0 10px!important;}
body.rx-standard-shell .rxhome-network-card > div{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
}
body.rx-standard-shell .rxhome-network-card span{
  min-width:0!important;
  width:100%!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  gap:3px!important;
  padding:8px 4px!important;
  overflow:hidden!important;
}
body.rx-standard-shell .rxhome-network-card b{font-size:15px!important;line-height:1!important;white-space:nowrap!important;}
body.rx-standard-shell .rxhome-network-card em{font-size:10.5px!important;line-height:1.1!important;overflow-wrap:anywhere!important;}

/* Featured Doctors & Chambers: heading centered, links/footer stay inside card. */
body.rx-standard-shell .rx20-home-block{
  background:#fff!important;
  border:1px solid var(--rx-v8-line)!important;
  border-radius:var(--rx-v8-radius)!important;
  box-shadow:var(--rx-v8-shadow)!important;
  padding:12px!important;
}
body.rx-standard-shell .rx20-home-head{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:center!important;
  align-items:center!important;
  gap:8px!important;
  width:100%!important;
  max-width:100%!important;
  margin:0 0 10px!important;
  text-align:center!important;
}
body.rx-standard-shell .rx20-home-head > div:first-child{flex:1 1 100%!important;text-align:center!important;}
body.rx-standard-shell .rx20-home-head h2{text-align:center!important;margin:0!important;}
body.rx-standard-shell .rx20-home-links{display:flex!important;justify-content:center!important;gap:8px!important;flex-wrap:wrap!important;width:100%!important;max-width:100%!important;}
body.rx-standard-shell .rx20-home-links a,
body.rx-standard-shell .rx20-home-footer a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:6px 12px!important;
  border-radius:999px!important;
  background:#eef7ff!important;
  border:1px solid var(--rx-v8-line)!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
body.rx-standard-shell .rx20-home-list{width:100%!important;max-width:100%!important;overflow:hidden!important;}
body.rx-standard-shell .rx20-mini-card{max-width:100%!important;overflow:hidden!important;}
body.rx-standard-shell .rx20-home-footer{
  width:100%!important;
  max-width:100%!important;
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:center!important;
  align-items:center!important;
  gap:8px!important;
  text-align:center!important;
  margin-top:10px!important;
}

/* Mobile refinement 320px and up */
@media (max-width:520px){
  :root{--rx-v8-page-x:6px;--rx-v8-radius:16px;--rx-v8-gap:8px;}
  body.rx-standard-shell{font-size:12px!important;}
  body.rx-standard-shell .rx-topbar,
  body.rx-standard-shell .rx-topbar.rx-hanging-header,
  body.rx-standard-shell header.rx-topbar.rx-hanging-header{width:calc(100% - 8px)!important;min-height:54px!important;margin:0 auto 8px!important;padding:7px 9px!important;border-radius:0 0 16px 16px!important;}
  body.rx-standard-shell .rx-topbar .rx-brand img,
  body.rx-standard-shell .rx-topbar .rx-logo-brand img{max-height:38px!important;max-width:132px!important;}
  body.rx-standard-shell .rx-page{padding-top:6px!important;}
  body.rx-standard-shell .rxhome,
  body.rx-standard-shell .rx20-page{width:calc(100% - 12px)!important;}
  body.rx-standard-shell .rxhome-actions-section,
  body.rx-standard-shell .rxhome-near-section,
  body.rx-standard-shell .rxhome-network-card,
  body.rx-standard-shell .rx20-home-block{padding:10px!important;border-radius:16px!important;}
  body.rx-standard-shell .rxhome-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;}
  body.rx-standard-shell .rxhome-actions a{min-height:72px!important;padding:7px 3px!important;border-radius:10px!important;}
  body.rx-standard-shell .rxhome-actions a span{font-size:20px!important;}
  body.rx-standard-shell .rxhome-actions a b{font-size:14px!important;line-height:1.02!important;}
  body.rx-standard-shell .rxhome-ad{padding:10px!important;}
  body.rx-standard-shell .rxhome-ad-copy h2{font-size:15px!important;line-height:1.15!important;}
  body.rx-standard-shell .rxhome-ad-art{max-width:44%!important;}
  body.rx-standard-shell .rxhome-network-card > div{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
  body.rx-standard-shell .rxhome-network-card span{min-height:58px!important;}
  body.rx-standard-shell .rxhome-network-card b{font-size:15px!important;}
  body.rx-standard-shell .rxhome-network-card em{font-size:10.5px!important;}
  body.rx-standard-shell .rx20-home-list{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
}
@media (min-width:521px) and (max-width:920px){
  body.rx-standard-shell .rxhome-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  body.rx-standard-shell .rxhome-network-card > div{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  body.rx-standard-shell .rxhome-near-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;overflow:visible!important;}
  body.rx-standard-shell .rxhome-map-card,
  body.rx-standard-shell .rxhome-near-card{max-width:100%!important;flex:auto!important;}
}
@media (min-width:921px){
  body.rx-standard-shell .rxhome-actions{grid-template-columns:repeat(8,minmax(0,1fr))!important;}
  body.rx-standard-shell .rxhome-near-grid{display:grid!important;grid-template-columns:1.15fr repeat(4,minmax(0,1fr))!important;overflow:visible!important;}
  body.rx-standard-shell .rxhome-map-card,
  body.rx-standard-shell .rxhome-near-card{max-width:100%!important;flex:auto!important;}
}
