/* RX Billing shell alignment v3 — one header geometry owner + dashboard partner sizing. */
:root{
  --rxb-shell-h:58px;
  --rxb-border:#d6e3ed;
  --rxb-text:#173b5a;
  --rxb-muted:#6f8191;
  --rxb-blue:#0874ce;
}

/* ---------- Header ---------- */
body.rx-v32 .rx41-topbar{
  position:sticky!important;
  top:0!important;
  z-index:2800!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  min-height:var(--rxb-shell-h)!important;
  height:var(--rxb-shell-h)!important;
  display:grid!important;
  grid-template-columns:minmax(240px,1fr) auto auto!important;
  grid-template-rows:58px!important;
  align-items:center!important;
  column-gap:10px!important;
  padding:0 12px!important;
  overflow:visible!important;
  border:0!important;
  border-bottom:1px solid var(--rxb-border)!important;
  border-radius:0!important;
  background:rgba(255,255,255,.99)!important;
  box-shadow:0 4px 14px rgba(27,65,96,.06)!important;
}
body.rx-v32 .rx41-runtime-context{display:none!important}
body.rx-v32 .rx41-topbar-brand{
  grid-column:1!important;
  grid-row:1!important;
  display:grid!important;
  grid-template-columns:38px 38px minmax(0,1fr)!important;
  align-items:center!important;
  gap:7px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
}
body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle{
  grid-column:1!important;
  position:relative!important;
  inset:auto!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  max-width:38px!important;
  max-height:38px!important;
  margin:0!important;
  padding:8px!important;
  border-radius:10px!important;
  box-sizing:border-box!important;
}
body.rx-v32 .rx41-topbar-brand>.rx41-brand-link{
  grid-column:2!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  padding:2px!important;
  margin:0!important;
  display:grid!important;
  place-items:center!important;
  border:1px solid var(--rxb-border)!important;
  border-radius:9px!important;
  background:#fff!important;
  box-sizing:border-box!important;
}
body.rx-v32 .rx41-topbar-brand>.rx41-brand-link img{
  display:block!important;
  width:32px!important;
  height:32px!important;
  max-width:32px!important;
  max-height:32px!important;
  object-fit:contain!important;
}
body.rx-v32 .rx41-page-context{
  grid-column:3!important;
  min-width:0!important;
  overflow:hidden!important;
  line-height:1.05!important;
}
body.rx-v32 .rx41-page-context strong,
body.rx-v32 .rx41-page-context small{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body.rx-v32 .rx41-page-context strong{color:var(--rxb-text)!important;font-size:13px!important;line-height:1.1!important;font-weight:850!important}
body.rx-v32 .rx41-page-context small{margin-top:2px!important;color:var(--rxb-muted)!important;font-size:8px!important;line-height:1.05!important}
body.rx-v32 .rx42-inline-context{display:none!important}

/* Desktop switch belongs to the right-side control cluster, not the viewport centre. */
body.rx-v32 .rx41-ecosystem-nav{
  position:relative!important;
  inset:auto!important;
  left:auto!important;
  top:auto!important;
  transform:none!important;
  grid-column:2!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:center!important;
  display:flex!important;
  align-items:stretch!important;
  gap:0!important;
  width:max-content!important;
  max-width:min(430px,38vw)!important;
  height:40px!important;
  margin:0!important;
  padding:2px!important;
  border:1px solid #d7e3ed!important;
  border-radius:11px!important;
  background:#fff!important;
  box-shadow:0 2px 8px rgba(24,63,94,.06)!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  -webkit-overflow-scrolling:touch!important;
  z-index:5!important;
}
body.rx-v32 .rx41-ecosystem-nav::-webkit-scrollbar{display:none!important}
body.rx-v32 .rx41-ecosystem-nav>a{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 auto!important;
  min-width:72px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0 11px!important;
  margin:0!important;
  border:0!important;
  border-radius:8px!important;
  background:transparent!important;
  color:#315675!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.015em!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  box-shadow:none!important;
}
body.rx-v32 .rx41-ecosystem-nav>a+a:before{content:""!important;position:absolute!important;left:-1px!important;top:8px!important;bottom:8px!important;width:1px!important;background:#d7e3ed!important}
body.rx-v32 .rx41-ecosystem-nav>a:hover{background:#f3f7fb!important;color:#164f7d!important}
body.rx-v32 .rx41-ecosystem-nav>a.is-active{background:linear-gradient(135deg,#0874ce,#0754a5)!important;color:#fff!important;box-shadow:0 3px 9px rgba(7,96,181,.20)!important}
body.rx-v32 .rx41-ecosystem-nav>a.is-active:before,
body.rx-v32 .rx41-ecosystem-nav>a.is-active+a:before{opacity:0!important}
body.rx-v32 .rx41-ecosystem-nav>a:focus-visible{outline:3px solid rgba(8,116,206,.22)!important;outline-offset:1px!important}

body.rx-v32 .rx41-topbar-actions{
  grid-column:3!important;
  grid-row:1!important;
  align-self:center!important;
  justify-self:end!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:6px!important;
  min-width:0!important;
}
body.rx-v32 .rx-topbar-quick,
body.rx-v32 .rx-incoming-invoice-bell,
body.rx-v32 .rx-user-button{min-height:36px!important;height:36px!important;border-radius:9px!important}
body.rx-v32 .rx-topbar-quick{padding:5px 10px!important;font-size:9px!important}
body.rx-v32 .rx-incoming-invoice-bell{width:40px!important;min-width:40px!important;padding:0!important}
body.rx-v32 .rx-user-button{width:auto!important;min-width:44px!important;padding:2px 7px 2px 3px!important}
body.rx-v32 .rx-user-button>.rx-avatar{width:30px!important;height:30px!important;min-width:30px!important;font-size:10px!important}
body.rx-v32 .rx-user-copy b{font-size:9px!important;line-height:1.05!important}
body.rx-v32 .rx-user-copy small{font-size:7px!important;line-height:1!important}

/* Tablet: keep one row and make the page title visible in the formerly empty middle area. */
@media (min-width:600px) and (max-width:899px){
  :root{--rxb-shell-h:58px}
  body.rx-v32 .rx41-topbar{
    grid-template-columns:minmax(155px,1fr) auto auto!important;
    grid-template-rows:58px!important;
    min-height:58px!important;
    height:58px!important;
    column-gap:6px!important;
    padding:4px 7px!important;
  }
  body.rx-v32 .rx41-topbar-brand{grid-template-columns:42px minmax(0,1fr)!important;gap:7px!important}
  body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle{grid-column:1!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important}
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link{display:none!important}
  body.rx-v32 .rx41-page-context{display:block!important;grid-column:2!important}
  body.rx-v32 .rx41-page-context strong{font-size:10.5px!important}
  body.rx-v32 .rx41-page-context small{font-size:7px!important}
  body.rx-v32 .rx41-ecosystem-nav{grid-column:2!important;grid-row:1!important;justify-self:end!important;width:max-content!important;max-width:300px!important;height:40px!important}
  body.rx-v32 .rx41-ecosystem-nav>a{min-width:60px!important;max-width:90px!important;height:34px!important;min-height:34px!important;padding:0 8px!important;font-size:9.5px!important}
  body.rx-v32 .rx41-topbar-actions{grid-column:3!important;grid-row:1!important;gap:4px!important}
  body.rx-v32 .rx41-quick-actions>:not(.rx-incoming-invoice-bell){display:none!important}
  body.rx-v32 .rx-settings-quick{display:none!important}
  body.rx-v32 .rx-user-copy,
  body.rx-v32 .rx-user-button>span:last-child{display:none!important}
  body.rx-v32 .rx-incoming-invoice-bell,
  body.rx-v32 .rx-user-button{display:flex!important;width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;max-height:38px!important;padding:2px!important}
  body.rx-v32 .rx-user-button>.rx-avatar{width:32px!important;height:32px!important}
}

/* Phone: first row stays task-oriented; module switch gets a dedicated contained row. */
@media (max-width:599px){
  :root{--rxb-shell-h:96px}
  body.rx-v32 .rx41-topbar{
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:50px 40px!important;
    min-height:96px!important;
    height:96px!important;
    column-gap:6px!important;
    row-gap:2px!important;
    padding:3px 6px!important;
  }
  body.rx-v32 .rx41-topbar-brand{grid-column:1!important;grid-row:1!important;grid-template-columns:42px minmax(0,1fr)!important;gap:7px!important}
  body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle{grid-column:1!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important}
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link{display:none!important}
  body.rx-v32 .rx41-page-context{display:block!important;grid-column:2!important}
  body.rx-v32 .rx41-page-context strong{font-size:11px!important;line-height:1.1!important}
  body.rx-v32 .rx41-page-context small{font-size:7px!important;line-height:1.05!important}
  body.rx-v32 .rx41-topbar-actions{grid-column:2!important;grid-row:1!important;gap:4px!important}
  body.rx-v32 .rx41-quick-actions>:not(.rx-incoming-invoice-bell){display:none!important}
  body.rx-v32 .rx-settings-quick{display:none!important}
  body.rx-v32 .rx-user-copy,
  body.rx-v32 .rx-user-button>span:last-child{display:none!important}
  body.rx-v32 .rx-incoming-invoice-bell,
  body.rx-v32 .rx-user-button{display:flex!important;width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;min-height:38px!important;max-height:38px!important;padding:2px!important}
  body.rx-v32 .rx-user-button>.rx-avatar{width:32px!important;height:32px!important}
  body.rx-v32 .rx41-ecosystem-nav{
    grid-column:1/-1!important;
    grid-row:2!important;
    justify-self:stretch!important;
    width:100%!important;
    max-width:none!important;
    height:38px!important;
    justify-content:center!important;
  }
  body.rx-v32 .rx41-ecosystem-nav>a{flex:1 1 0!important;min-width:64px!important;max-width:110px!important;height:32px!important;min-height:32px!important;padding:0 7px!important;font-size:9.5px!important}
  body.rx-v32 .rx41-desktop-module-switch{display:none!important}
}
@media (max-width:390px){
  body.rx-v32 .rx41-topbar{padding-inline:5px!important;column-gap:4px!important}
  body.rx-v32 .rx41-topbar-brand{grid-template-columns:40px minmax(0,1fr)!important;gap:5px!important}
  body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;max-width:40px!important;max-height:40px!important}
  body.rx-v32 .rx41-page-context strong{font-size:10px!important}
  body.rx-v32 .rx41-ecosystem-nav>a{min-width:58px!important;padding-inline:5px!important;font-size:9px!important}
  body.rx-v32 .rx-incoming-invoice-bell,
  body.rx-v32 .rx-user-button{width:36px!important;min-width:36px!important;max-width:36px!important;height:36px!important;min-height:36px!important;max-height:36px!important}
}

/* ---------- Dashboard partner cards ---------- */
body.rx-v32 .rx30-partner-row.rx30-dashboard-partners{
  width:100%!important;max-width:none!important;margin:10px 0 14px!important;padding:0!important;
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;align-items:stretch!important;
}
body.rx-v32 .rx30-dashboard-partners>a,
body.rx-v32 .rx30-dashboard-partners>.rx30-partner-disabled{
  width:100%!important;min-width:0!important;height:82px!important;min-height:82px!important;padding:6px 10px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;box-sizing:border-box!important;
  border:1px solid #d5e2eb!important;border-radius:11px!important;background:#fff!important;box-shadow:0 2px 8px rgba(27,65,96,.035)!important;
}
body.rx-v32 .rx30-dashboard-partners img{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:68px!important;object-fit:contain!important;object-position:center!important;margin:auto!important}
@media(max-width:899px){
  body.rx-v32 .rx30-partner-row.rx30-dashboard-partners{gap:5px!important;margin:6px 0 8px!important}
  body.rx-v32 .rx30-dashboard-partners>a,
  body.rx-v32 .rx30-dashboard-partners>.rx30-partner-disabled{height:58px!important;min-height:58px!important;padding:3px 5px!important;border-radius:8px!important}
  body.rx-v32 .rx30-dashboard-partners img{max-height:50px!important}
}
@media(max-width:430px){
  body.rx-v32 .rx30-partner-row.rx30-dashboard-partners{gap:4px!important}
  body.rx-v32 .rx30-dashboard-partners>a,
  body.rx-v32 .rx30-dashboard-partners>.rx30-partner-disabled{height:52px!important;min-height:52px!important;padding:2px 4px!important}
  body.rx-v32 .rx30-dashboard-partners img{max-height:44px!important}
}
