/* RXOPD final post-login header + home responsive repair - 2026-09-21.
   Shared authenticated header has a single geometry owner in this file. */
body.rx-role-shell .rx-role-topbar.rxopd-rounded-header{
  position:fixed!important;
  inset:8px 12px auto calc(var(--rx15-sidebar-width,var(--rx-role-sidebar-width,272px)) + 12px)!important;
  width:auto!important;max-width:none!important;min-width:0!important;
  height:60px!important;min-height:60px!important;margin:0!important;transform:none!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;
  gap:10px!important;padding:7px 10px!important;overflow:visible!important;border-radius:18px!important;z-index:1100!important;
}
body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rxopd-rounded-header{left:12px!important}
body.rx-role-shell .rx-role-header-left{
  display:grid!important;grid-template-columns:44px auto minmax(0,1fr)!important;align-items:center!important;
  gap:9px!important;min-width:0!important;overflow:hidden!important;
}
body.rx-role-shell .rx-role-header-left .rx-role-menu-button{
  position:static!important;inset:auto!important;width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;margin:0!important;transform:none!important;
}
body.rx-role-shell .rx-role-header-left .rx-role-top-brand-inline{
  position:static!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;
  width:auto!important;min-width:68px!important;max-width:126px!important;height:42px!important;margin:0!important;padding:0!important;overflow:hidden!important;text-decoration:none!important;
}
body.rx-role-shell .rx-role-header-left .rx-role-top-brand-inline img{display:block!important;width:auto!important;max-width:100%!important;height:38px!important;max-height:38px!important;object-fit:contain!important;object-position:left center!important}
body.rx-role-shell .rx-role-brand-compact{display:none;color:#0b4f86;font-size:14px;font-weight:900;letter-spacing:.02em;white-space:nowrap}
body.rx-role-shell .rx-role-page-title{display:grid!important;gap:1px!important;min-width:0!important;max-width:320px!important;overflow:hidden!important;margin:0!important;padding:0!important}
body.rx-role-shell .rx-role-page-title :is(small,strong){display:block!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
body.rx-role-shell .rx-role-page-title small{font-size:9px!important;line-height:1.08!important}
body.rx-role-shell .rx-role-page-title strong{font-size:15px!important;line-height:1.18!important}
body.rx-role-shell .rx-role-top-actions{
  position:static!important;display:flex!important;flex-flow:row nowrap!important;align-items:center!important;justify-content:flex-end!important;
  gap:7px!important;width:auto!important;min-width:0!important;max-width:none!important;margin:0!important;justify-self:end!important;
}
body.rx-role-shell .rx-role-top-actions .rxopd-bell-button{order:2!important;margin:0!important}
body.rx-role-shell .rx-role-top-actions .rxopd-header-logout{order:3!important;margin:0!important}
body.rx-role-shell .rx-role-top-actions .rxopd-bell-button,
body.rx-role-shell .rx-role-top-actions .rxopd-header-logout,
body.rx-role-shell .rx-role-top-actions .rxopd-header-logout button{
  flex:0 0 44px!important;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;max-height:44px!important;
}
@media(max-width:1100px){body.rx-role-shell .rx-role-page-title{max-width:190px!important}body.rx-role-shell .rx-role-page-title small{display:none!important}body.rx-role-shell .rx-role-page-title strong{font-size:13px!important}}
@media(max-width:860px){
  body.rx-role-shell .rx-role-topbar.rxopd-rounded-header,
  body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rxopd-rounded-header{inset:7px 7px auto 7px!important;height:58px!important;min-height:58px!important;padding:6px 7px!important;gap:6px!important;border-radius:17px!important}
  body.rx-role-shell .rx-role-header-left{grid-template-columns:40px auto!important;gap:7px!important}
  body.rx-role-shell .rx-role-header-left .rx-role-menu-button{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
  body.rx-role-shell .rx-role-header-left .rx-role-top-brand-inline{min-width:54px!important;max-width:72px!important;height:40px!important}
  body.rx-role-shell .rx-role-header-left .rx-role-top-brand-inline img{display:none!important}
  body.rx-role-shell .rx-role-brand-compact{display:inline!important}
  body.rx-role-shell .rx-role-page-title{display:none!important}
  body.rx-role-shell .rx-role-top-actions{gap:5px!important;max-width:min(62vw,360px)!important}
  body.rx-role-shell .rx-role-top-actions .rxopd-bell-button,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout button{flex-basis:40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;height:40px!important;min-height:40px!important;max-height:40px!important}
}
@media(max-width:390px){
  body.rx-role-shell .rx-role-topbar.rxopd-rounded-header,body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rxopd-rounded-header{inset:5px 5px auto 5px!important;padding-inline:5px!important}
  body.rx-role-shell .rx-role-header-left{grid-template-columns:38px auto!important;gap:5px!important}
  body.rx-role-shell .rx-role-header-left .rx-role-menu-button{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important}
  body.rx-role-shell .rx-role-brand-compact{font-size:12px!important}
  body.rx-role-shell .rx-role-top-actions{gap:4px!important;max-width:min(64vw,250px)!important}
  body.rx-role-shell .rx-role-top-actions .rxopd-bell-button,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout button{flex-basis:38px!important;width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;max-height:38px!important}
}

/* -------------------------------------------------------------------------
   Home search. Apply on guest and authenticated home shells. This deliberately
   does not depend on .rx-standard-shell because logged-in users render the
   same home content inside .rx-role-shell.
   ------------------------------------------------------------------------- */
body.rx-ui-home .rxhome-search.rxhome-location-search-compact{
  display:grid!important;
  grid-template-columns:minmax(170px,.82fr) minmax(280px,1.35fr) 120px!important;
  grid-template-rows:48px!important;
  align-items:stretch!important;
  width:min(100%,760px)!important;
  max-width:760px!important;
  gap:10px!important;
  margin:16px 0 12px!important;
}
body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-field-select,
body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-location-entry,
body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-btn{
  position:static!important;
  order:initial!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  height:48px!important;
  min-height:48px!important;
  max-height:48px!important;
  margin:0!important;
  border-radius:12px!important;
}
body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-field-select{
  display:flex!important;
  grid-column:1!important;
  padding:0 12px!important;
  overflow:hidden!important;
}
body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-location-entry{
  display:grid!important;
  grid-column:2!important;
  grid-template-columns:46px minmax(0,1fr)!important;
  align-items:stretch!important;
  padding:0!important;
  overflow:hidden!important;
}
body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-btn{
  display:flex!important;
  grid-column:3!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 15px!important;
  font-size:13px!important;
  font-weight:800!important;
  line-height:1!important;
}
body.rx-ui-home .rxhome-search .rxhome-field :is(select,input){
  width:100%!important;
  min-width:0!important;
  height:46px!important;
  min-height:46px!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  font-size:13px!important;
  line-height:1.2!important;
}
body.rx-ui-home .rxhome-search .rxhome-field-select select{
  padding:0 28px 0 0!important;
  text-overflow:ellipsis!important;
}
body.rx-ui-home .rxhome-search .rxhome-location-detect{
  position:static!important;
  grid-column:1!important;
  width:46px!important;
  min-width:46px!important;
  height:46px!important;
  min-height:46px!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  border:0!important;
  border-right:1px solid #d7e4ef!important;
  border-radius:0!important;
}
body.rx-ui-home .rxhome-search .rxhome-field-location{
  grid-column:2!important;
  width:100%!important;
  min-width:0!important;
  height:46px!important;
  min-height:46px!important;
  margin:0!important;
  padding:0 12px!important;
  border:0!important;
  border-radius:0!important;
  background:#fff!important;
}

@media(min-width:768px) and (max-width:1100px){
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact{
    grid-template-columns:minmax(155px,.8fr) minmax(240px,1.35fr) 110px!important;
    width:min(100%,680px)!important;
    gap:9px!important;
  }
}
@media(max-width:767px){
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact{
    grid-template-columns:minmax(118px,.76fr) minmax(0,1.34fr)!important;
    grid-template-rows:46px 46px!important;
    width:100%!important;
    max-width:none!important;
    gap:8px!important;
    margin:13px 0 12px!important;
  }
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-field-select{
    display:flex!important;
    grid-column:1!important;
    grid-row:1!important;
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    padding:0 9px!important;
  }
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-location-entry{
    grid-column:2!important;
    grid-row:1!important;
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    grid-template-columns:42px minmax(0,1fr)!important;
  }
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-btn{
    grid-column:1/-1!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    font-size:13px!important;
  }
  body.rx-ui-home .rxhome-search .rxhome-field :is(select,input){
    height:44px!important;
    min-height:44px!important;
    font-size:11.5px!important;
  }
  body.rx-ui-home .rxhome-search .rxhome-location-detect{
    width:42px!important;
    min-width:42px!important;
    height:44px!important;
    min-height:44px!important;
  }
  body.rx-ui-home .rxhome-search .rxhome-field-location{
    height:44px!important;
    min-height:44px!important;
    padding-inline:9px!important;
  }
}
@media(max-width:340px){
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact{
    grid-template-columns:1fr!important;
    grid-template-rows:44px 44px 44px!important;
  }
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-field-select{grid-column:1!important;grid-row:1!important}
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-location-entry{grid-column:1!important;grid-row:2!important}
  body.rx-ui-home .rxhome-search.rxhome-location-search-compact>.rxhome-btn{grid-column:1!important;grid-row:3!important}
}

/* -------------------------------------------------------------------------
   Quick Actions. Explicit SVG geometry prevents WebView/legacy cascade layers
   from collapsing the inline icons.
   ------------------------------------------------------------------------- */
body.rx-ui-home .rxhome-actions{
  display:grid!important;
  grid-template-columns:repeat(8,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
}
body.rx-ui-home .rxhome-actions a{
  min-width:0!important;
  min-height:90px!important;
  padding:11px 7px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  text-align:center!important;
  overflow:hidden!important;
}
body.rx-ui-home .rxhome-actions .rxhome-action-icon{
  display:grid!important;
  place-items:center!important;
  flex:0 0 36px!important;
  width:36px!important;
  min-width:36px!important;
  height:36px!important;
  min-height:36px!important;
  margin:0!important;
  padding:6px!important;
  border:1px solid #d8eaf8!important;
  border-radius:12px!important;
  background:#eef8ff!important;
  color:#0878a8!important;
  font-size:0!important;
  line-height:0!important;
  overflow:visible!important;
}
body.rx-ui-home .rxhome-actions .rxhome-action-icon .rxhome-action-svg,
body.rx-ui-home .rxhome-actions .rxhome-action-icon svg{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  width:23px!important;
  min-width:23px!important;
  max-width:23px!important;
  height:23px!important;
  min-height:23px!important;
  max-height:23px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  overflow:visible!important;
}
body.rx-ui-home .rxhome-actions a b{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.15!important;
  text-align:center!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}
@media(max-width:1024px){
  body.rx-ui-home .rxhome-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important}
}
@media(max-width:767px){
  body.rx-ui-home .rxhome-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
  body.rx-ui-home .rxhome-actions a{min-height:82px!important;padding:8px 4px!important;gap:6px!important;border-radius:12px!important}
  body.rx-ui-home .rxhome-actions .rxhome-action-icon{width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;flex-basis:32px!important;padding:5px!important;border-radius:10px!important}
  body.rx-ui-home .rxhome-actions .rxhome-action-icon .rxhome-action-svg,
  body.rx-ui-home .rxhome-actions .rxhome-action-icon svg{width:21px!important;min-width:21px!important;max-width:21px!important;height:21px!important;min-height:21px!important;max-height:21px!important}
  body.rx-ui-home .rxhome-actions a b{font-size:10.5px!important;line-height:1.12!important}
}
@media(max-width:560px){
  body.rx-ui-home .rxhome-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  body.rx-ui-home .rxhome-actions a{min-height:90px!important;padding:10px 7px!important}
  body.rx-ui-home .rxhome-actions a b{font-size:12px!important;line-height:1.18!important;word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important}
  body.rx-ui-home .rxhome-action-status{font-size:11px!important;line-height:1.1!important;white-space:nowrap!important}
}

/* Logged-in home uses the real role bottom navigation; remove the legacy fake
   fixed strip from the public index stylesheet and reserve safe content space. */
body.rx-role-shell.rx-ui-home .rxhome:after{display:none!important;content:none!important}
@media(max-width:860px){
  body.rx-role-shell.rx-ui-home .rx-role-main{
    padding-bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }
  body.rx-role-shell.rx-ui-home .rxhome{
    padding-bottom:calc(30px + env(safe-area-inset-bottom))!important;
  }
}

/* Care search: one fluid layout across guest and signed-in shells. */
body.rx-ui-home .rxhome-hero-copy{container-type:inline-size;min-width:0!important}
body.rx-ui-home #rxhome-care-search{
 display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;
 grid-auto-rows:auto!important;width:100%!important;max-width:100%!important;gap:10px!important;
 height:auto!important;max-height:none!important;padding:12px!important;box-sizing:border-box!important;
}
body.rx-ui-home #rxhome-care-search > :is(.rxhome-field-select,.rxhome-location-entry,.rxhome-btn){
 grid-column:auto!important;grid-row:auto!important;position:static!important;transform:none!important;
 width:100%!important;min-width:0!important;max-width:none!important;height:48px!important;min-height:48px!important;margin:0!important;
}
body.rx-ui-home #rxhome-care-search .rxhome-location-entry{display:grid!important;grid-template-columns:46px minmax(0,1fr)!important}
body.rx-ui-home #rxhome-care-search .rxhome-field-location{min-width:0!important;width:100%!important;padding:0 8px!important}
body.rx-ui-home #rxhome-care-search :is(input,select){font-size:16px!important;min-width:0!important;width:100%!important}
body.rx-ui-home #rxhome-care-search .rxhome-btn{font-size:16px!important}
body.rx-ui-home #rxhome-care-search :is(input,select,button):focus-visible{outline:3px solid #075985!important;outline-offset:2px!important}
@container (min-width:620px){body.rx-ui-home #rxhome-care-search{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) 104px!important}}
body.rx-ui-home .rxhome-near-grid > [hidden]{display:none!important}
.rx-ad-pause{position:relative;z-index:2;min-height:44px;padding:8px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#164e63;cursor:pointer}

/* -------------------------------------------------------------------------
   Follow-up 2026-09-21b: one-row role header.
   The OPD / Billing / Lab switch stays inside the header row. The flexible
   page-title region gives up space first; on the narrowest phones the title
   is hidden instead of moving the module switch below the header.
   ------------------------------------------------------------------------- */
body.rx-role-shell .rx-role-topbar.rx-role-topbar-has-modules,
body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rx-role-topbar-has-modules{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto auto!important;
  grid-template-rows:1fr!important;
  align-items:center!important;
  column-gap:7px!important;
}
body.rx-role-shell .rx-role-topbar.rx-role-topbar-has-modules>.rxopd-module-switch{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:center!important;
}
body.rx-role-shell .rx-role-topbar.rx-role-topbar-has-modules>.rx-role-top-actions{
  grid-column:3!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:center!important;
}

@media(max-width:860px){
  body.rx-role-shell .rx-role-topbar.rxopd-rounded-header.rx-role-topbar-has-modules,
  body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rxopd-rounded-header.rx-role-topbar-has-modules{
    height:58px!important;
    min-height:58px!important;
    grid-template-columns:minmax(84px,1fr) auto auto!important;
    grid-template-rows:44px!important;
    column-gap:6px!important;
    row-gap:0!important;
    padding:7px!important;
  }
  body.rx-role-shell .rx-role-header-left{
    grid-column:1!important;
    grid-row:1!important;
    display:grid!important;
    grid-template-columns:40px minmax(0,1fr)!important;
    align-items:center!important;
    gap:7px!important;
    min-width:0!important;
    overflow:hidden!important;
  }
  body.rx-role-shell .rx-role-header-left .rx-role-top-brand-inline{display:none!important}
  body.rx-role-shell .rx-role-page-title{
    display:block!important;
    min-width:0!important;
    max-width:none!important;
    overflow:hidden!important;
  }
  body.rx-role-shell .rx-role-page-title small{display:none!important}
  body.rx-role-shell .rx-role-page-title strong{
    display:block!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:12.5px!important;
    line-height:1.15!important;
  }
  body.rx-role-shell .rx-role-topbar.rx-role-topbar-has-modules + .rx-role-main,
  body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rx-role-topbar-has-modules + .rx-role-main{
    padding-top:72px!important;
  }
  body.rx-role-shell .rx-role-top-actions{
    grid-column:3!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:end!important;
    display:flex!important;
    flex-flow:row nowrap!important;
    gap:4px!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }
  body.rx-role-shell .rx-role-top-actions .rxopd-bell-button,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout button{
    flex:0 0 38px!important;
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
  }
}
@media(max-width:560px){
  body.rx-role-shell .rx-role-topbar.rxopd-rounded-header.rx-role-topbar-has-modules,
  body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rxopd-rounded-header.rx-role-topbar-has-modules{
    grid-template-columns:minmax(62px,1fr) auto auto!important;
    column-gap:4px!important;
    padding-inline:5px!important;
  }
  body.rx-role-shell .rx-role-header-left{
    grid-template-columns:38px minmax(0,1fr)!important;
    gap:5px!important;
  }
  body.rx-role-shell .rx-role-page-title strong{font-size:11px!important}
  body.rx-role-shell .rx-role-top-actions{gap:3px!important}
  body.rx-role-shell .rx-role-top-actions .rxopd-bell-button,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout,
  body.rx-role-shell .rx-role-top-actions .rxopd-header-logout button{
    flex-basis:36px!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
  }
}
@media(max-width:350px){
  body.rx-role-shell .rx-role-topbar.rxopd-rounded-header.rx-role-topbar-has-modules,
  body.rx-role-shell.rx-role-sidebar-collapsed .rx-role-topbar.rxopd-rounded-header.rx-role-topbar-has-modules{
    grid-template-columns:38px auto auto!important;
  }
  body.rx-role-shell .rx-role-header-left{grid-template-columns:38px!important}
  body.rx-role-shell .rx-role-header-left .rx-role-page-title{display:none!important}
}
