/* Compact responsive workspace, touch billing and non-overlapping Live OPD drawer. */
:root{--rx42-mobile-status-h:29px;--rx42-mobile-action-h:82px;--rx42-mobile-gap:6px}
.rx42-inline-context,.rx42-mobile-switch,.rx42-short{display:none}

/* Desktop/tablet refinements that do not alter the established business layout. */
.rx30-dashboard-partners{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:9px!important}
.rx30-dashboard-partners>a{min-width:0!important;overflow:hidden!important}
.rx30-dashboard-partners img{display:block;width:100%;height:auto;object-fit:contain}

@media(max-width:899px){
  :root{--rx41-topbar-h:50px;--rx41-status-h:var(--rx42-mobile-status-h)}
  html{font-size:13px} html,body{width:100%;max-width:100%;overflow-x:hidden!important}
  body{padding-bottom:var(--rx42-mobile-status-h)!important;background:#f3f8fd}
  .rx-app{width:100%;min-width:0;overflow-x:hidden}

  /* One compact, stable mobile header. */
  .rx41-topbar{position:sticky!important;top:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;min-height:50px!important;padding:3px 5px!important;gap:4px!important;border-radius:0!important}
  .rx41-topbar-brand{display:grid!important;grid-template-columns:34px 31px minmax(0,1fr)!important;gap:4px!important;align-items:center!important;min-width:0}
  .rx-menu-toggle{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:8px!important;border-radius:8px!important}
  .rx-menu-toggle span{width:17px!important;height:2px!important;margin:2px auto!important}
  .rx41-brand-link{width:31px!important;height:34px!important;border-radius:7px!important}
  .rx41-brand-link img{width:30px!important;height:30px!important}
  .rx41-page-context{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:0!important;line-height:1.02!important;overflow:hidden}
  .rx41-page-context strong{font-size:10.5px!important;line-height:1.05!important;font-weight:900!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .rx41-page-context small{font-size:6.9px!important;line-height:1.05!important;max-width:none!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#64778a!important}
  .rx42-inline-context{display:flex!important;align-items:center;gap:3px;margin-top:2px;min-width:0;white-space:nowrap;overflow:hidden}
  .rx42-inline-context>span{display:inline-flex;align-items:center;gap:3px;min-height:14px;padding:0 4px;border:1px solid #d4e0eb;border-radius:5px;background:#f7fbff;color:#315676;font-size:5.9px;font-weight:900}
  .rx42-inline-context>span:nth-child(1),.rx42-inline-context>span:nth-child(2){max-width:72px;overflow:hidden;text-overflow:ellipsis}
  .rx42-inline-context .is-connected{border-color:#bde3c9;background:#effaf3;color:#087a36}
  .rx42-inline-context .is-disconnected{border-color:#edbec2;background:#fff1f2;color:#a61e28}
  .rx42-inline-context i{width:5px;height:5px;border-radius:50%;background:currentColor;box-shadow:0 0 5px currentColor}
  .rx41-runtime-context{display:none!important}
  .rx41-topbar-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:3px!important;min-width:0}
  .rx41-ecosystem-switch,.rx41-quick-actions,.rx-user-copy{display:none!important}
  .rx42-mobile-switch{display:flex!important;gap:2px;padding:2px;border:1px solid #d5e2ed;border-radius:7px;background:#f8fbfe}
  .rx42-mobile-switch a{display:grid;place-items:center;min-width:27px;height:26px;padding:0 4px;border-radius:5px;color:#24567f;text-decoration:none;font-size:6.4px;font-weight:950}
  .rx42-mobile-switch a.active{background:#e6f2ff;color:#0761bd}
  .rx-user-button{min-width:34px!important;width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;border-radius:9px!important}
  .rx-user-button>.rx-avatar{width:30px!important;height:30px!important;font-size:10px!important}
  .rx-user-button>span:last-child{display:none!important}
  .rx-user-dropdown{position:fixed!important;top:51px!important;right:5px!important;left:auto!important;width:min(88vw,300px)!important;max-height:calc(100dvh - 86px)!important;overflow:auto!important;z-index:220!important}

  /* Smaller drawer; no giant half-screen menu items. */
  .rx-sidebar{position:fixed!important;top:0!important;bottom:0!important;left:0!important;width:min(74vw,278px)!important;max-width:278px!important;z-index:210!important;box-shadow:18px 0 46px rgba(7,34,64,.28)!important}
  .rx-sidebar-brand{min-height:48px!important;padding:6px 8px!important}
  .rx-sidebar-brand a{font-size:10px!important}.rx-sidebar-brand small{font-size:12px!important}
  .rx-sidebar-brand button{width:30px!important;height:30px!important;font-size:19px!important}
  .rx-nav{padding:5px!important}.rx-menu-group{margin:0 0 4px!important}
  .rx-menu-group>summary{min-height:34px!important;padding:6px 8px!important;font-size:10px!important;white-space:nowrap!important}
  .rx-menu-panel{padding:3px!important}.rx-menu-panel a{min-height:32px!important;padding:6px 8px!important;font-size:9px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .rx-menu-panel kbd{font-size:6px!important}

  /* Command/help strip wraps inside viewport instead of requiring horizontal scrolling. */
  .rx-command-bar{display:none!important}
  .rx-command-bar>span{display:inline-flex!important;align-items:center!important;gap:2px!important;font-size:6.4px!important;line-height:1!important;white-space:nowrap!important}
  .rx-command-bar .rx-command-title{font-size:6.7px!important}.rx-command-bar kbd{font-size:6px!important;padding:1px 3px!important}

  .rx-billing-stage{display:block!important;width:100%!important;max-width:100%!important;padding:4px 4px calc(var(--rx42-mobile-status-h) + 4px)!important}
  .rx-content,.rx-billing-content{width:100%!important;max-width:100%!important;padding:0!important;margin:0!important}

  /* Dashboard — two actions, three ads and three KPIs remain visible at once. */
  .rx41-dashboard{padding:0!important;margin:0!important}
  .rx41-dashboard-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;margin:0!important}
  .rx30-primary-action{min-height:82px!important;padding:8px!important;gap:6px!important;border-radius:10px!important}
  .rx30-primary-action .rx30-action-icon{width:34px!important;height:34px!important;min-width:34px!important;font-size:13px!important}
  .rx30-primary-action b{font-size:10px!important;line-height:1.05!important}.rx30-primary-action small{font-size:6.8px!important;line-height:1.2!important;margin-top:3px!important}
  .rx30-primary-action kbd{top:5px!important;right:5px!important;font-size:6px!important;padding:2px 4px!important}
  .rx30-partner-row.rx30-dashboard-partners{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px!important;margin:5px 0 0!important}
  .rx30-dashboard-partners>a{min-height:0!important;height:auto!important;border-radius:7px!important}
  .rx30-dashboard-partners img{width:100%!important;height:auto!important;max-height:88px!important;object-fit:contain!important}
  .rx30-kpi-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important;margin-top:5px!important}
  .rx30-kpi-grid article,.rx30-kpi-grid>a{min-height:69px!important;padding:6px!important;gap:4px!important;border-radius:8px!important}
  .rx30-kpi-icon{width:27px!important;height:27px!important;min-width:27px!important;font-size:9px!important}
  .rx30-kpi-grid b{font-size:12px!important;line-height:1.05!important}.rx30-kpi-grid strong{font-size:10.5px!important;line-height:1.05!important;margin-top:3px!important}.rx30-kpi-grid small{font-size:5.8px!important;line-height:1.15!important}
  .rx30-keyboard-strip{display:none!important}
  .rx30-keyboard-strip>*{font-size:6px!important;white-space:nowrap!important}.rx30-keyboard-strip strong{flex:1 0 100%;font-size:6.5px!important}
  .rx30-recent-grid{margin-top:5px!important;gap:5px!important}.rx30-data-panel{border-radius:8px!important}.rx30-data-panel>header{padding:7px!important}.rx30-data-panel h2{font-size:10px!important}.rx30-data-panel p,.rx30-data-panel a{font-size:6.5px!important}
  .rx-table th,.rx-table td{padding:5px!important;font-size:12px!important}

  /* Retail / wholesale / purchase mobile form density. */
  .rx-r38-window{width:100%!important;max-width:100%!important;margin:0 0 calc(var(--rx42-mobile-action-h) + 8px)!important;border-radius:8px!important;overflow:visible!important}
  .rx-r38-title{display:grid!important;grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr)!important;align-items:end!important;gap:5px!important;padding:6px!important}
  .rx-r38-title>div:first-child{min-width:0}.rx-r38-title h1{font-size:13px!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}.rx-r38-title p{display:none!important}
  .rx-r38-doc{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px!important;min-width:0!important;width:100%!important}
  .rx-r38 label{gap:2px!important;font-size:12px!important;line-height:1.05!important}.rx-r38 label small{font-size:5.7px!important;line-height:1.05!important}
  .rx-r38 input,.rx-r38 select,.rx-r38 textarea{min-height:32px!important;padding:5px 6px!important;border-radius:6px!important;font-size:9px!important}
  .rx-r38-doc input{min-height:29px!important;padding:4px!important;font-size:7.5px!important}
  .rx-r38-grid,.rx-r38-grid.cols-4{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;padding:6px!important}
  .rx-r38-grid.cols-4>.rx-r38-search{grid-column:auto!important}.rx-r38-grid.cols-4>*{grid-column:auto!important;min-width:0!important}
  .rx-r38-entry{padding:6px!important}.rx-r38-entry .rx-r38-search{width:100%}
  .rx-r38-results{position:fixed!important;z-index:230!important;left:5px!important;right:5px!important;top:auto!important;bottom:calc(var(--rx42-mobile-status-h) + var(--rx42-mobile-action-h) + 8px)!important;max-height:42dvh!important;border-radius:12px!important;box-shadow:0 0 0 100vmax rgba(7,28,52,.28),0 16px 50px rgba(7,28,52,.35)!important}
  .rx-r38-result{grid-template-columns:minmax(0,1.25fr) minmax(0,.8fr)!important;gap:3px 6px!important;min-height:42px!important;padding:6px 8px!important}.rx-r38-result b{font-size:9px!important}.rx-r38-result span{font-size:7.5px!important}.rx-r38-result small{grid-column:1/-1;font-size:6.3px!important}
  .rx-r38-party-summary{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px!important;padding:5px 6px!important}
  .rx-r38-party-summary small{font-size:5.8px!important}.rx-r38-party-summary b{font-size:7.6px!important}

  /* Mobile invoice rows are cards; no 1050px table drag for normal billing. */
  .rx-r38-table-wrap{max-height:none!important;overflow:visible!important;border-top:1px solid #d6e2ed!important}
  .rx-r38-table{display:block!important;min-width:0!important;width:100%!important}.rx-r38-table thead{display:none!important}.rx-r38-table tbody{display:grid!important;gap:4px!important;padding:5px!important}
  .rx-r38-table tr{display:grid!important;grid-template-columns:minmax(0,1.4fr) minmax(54px,.75fr) minmax(48px,.65fr) 29px!important;gap:3px!important;padding:5px!important;border:1px solid #d8e4ef!important;border-radius:8px!important;background:#fff!important}
  .rx-r38-table td{display:block!important;min-width:0!important;padding:2px!important;border:0!important;font-size:7.5px!important;white-space:normal!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .rx-r38-table td:nth-child(1),.rx-r38-table td:nth-child(5),.rx-r38-table td:nth-child(6),.rx-r38-table td:nth-child(8),.rx-r38-table td:nth-child(10),.rx-r38-table td:nth-child(11){display:none!important}
  .rx-r38-table td:nth-child(2){grid-column:1;grid-row:1;font-weight:900;font-size:8.5px!important}.rx-r38-table td:nth-child(3){grid-column:2;grid-row:1}.rx-r38-table td:nth-child(4){grid-column:3;grid-row:1}
  .rx-r38-table td:nth-child(7){grid-column:1;grid-row:2}.rx-r38-table td:nth-child(7)::before{content:'QTY ';font-size:6px;font-weight:900;color:#56718c}.rx-r38-table td:nth-child(9){grid-column:2;grid-row:2}.rx-r38-table td:nth-child(9)::before{content:'RATE ';font-size:6px;font-weight:900;color:#56718c}.rx-r38-table td:nth-child(12){grid-column:3;grid-row:2;font-weight:900}.rx-r38-table td:nth-child(12)::before{content:'₹ ';font-weight:900}.rx-r38-table td:nth-child(13){grid-column:4;grid-row:1/3;display:grid!important;place-items:center!important}
  .rx-r38-table input{min-height:27px!important;padding:3px!important;font-size:8px!important}.rx-r38-table .rx-r38-action{min-height:27px!important;width:27px!important;padding:0!important}
  .rx-r38-summary-area{display:block!important;padding:5px!important}.rx-r38-analysis{display:none!important}.rx-r38-totals{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:2px!important;padding:6px!important}.rx-r38-totals div{font-size:12px!important;padding:3px!important}.rx-r38-totals .net{grid-column:1/-1;font-size:11px!important;padding-top:5px!important}
  .rx-r38-status{min-height:28px!important;padding:5px 7px!important;font-size:12px!important}

  /* Full action set stays visible; OPD button sits above it, never over Save. */
  .rx-r38-footer-actions{position:fixed!important;left:0!important;right:0!important;bottom:var(--rx42-mobile-status-h)!important;z-index:150!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px!important;height:var(--rx42-mobile-action-h)!important;padding:4px!important;overflow:hidden!important;background:rgba(255,255,255,.98)!important}
  .rx-r38-footer-actions>a,.rx-r38-footer-actions>button{min-width:0!important;min-height:34px!important;height:34px!important;padding:3px!important;border-radius:6px!important;font-size:12px!important;white-space:nowrap!important}
  .rx41-opd-reopen{display:flex!important;right:5px!important;bottom:calc(var(--rx42-mobile-status-h) + 7px)!important;min-width:69px!important;min-height:31px!important;height:31px!important;padding:0 7px!important;border-radius:8px!important;font-size:12px!important}
  .rx42-has-actionbar .rx41-opd-reopen{bottom:calc(var(--rx42-mobile-status-h) + var(--rx42-mobile-action-h) + 7px)!important}
  .rx41-opd-reopen b{min-width:18px!important;height:18px!important;font-size:12px!important}

  /* OPD is a proper drawer, not a permanent overlay. */
  .rx41-live-opd{position:fixed!important;z-index:245!important;inset:0 0 0 auto!important;width:min(92vw,390px)!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;transform:translateX(104%)!important;visibility:hidden!important;pointer-events:none!important;transition:transform .18s ease,visibility .18s!important}
  .rx41-live-opd.is-open{transform:translateX(0)!important;visibility:visible!important;pointer-events:auto!important}
  .rx41-opd-backdrop{z-index:240!important}.rx41-opd-backdrop.is-open{display:block!important}

  /* Batch and item editors are bottom sheets sized for a single touch workflow. */
  .rx-r38-dialog{position:fixed!important;inset:auto 0 0 0!important;width:100vw!important;max-width:100vw!important;height:auto!important;max-height:78dvh!important;margin:auto 0 0!important;border-radius:16px 16px 0 0!important;padding:0!important}
  .rx-r38-dialog::backdrop{background:rgba(7,27,52,.42)!important}.rx-r38-dialog-head{padding:8px 10px!important}.rx-r38-dialog-head h3{font-size:11px!important}.rx-r38-dialog-close{width:30px!important;height:30px!important;font-size:18px!important}.rx-r38-dialog-body{max-height:calc(78dvh - 46px)!important;padding:7px!important}
  .rx-r38-batch-row{grid-template-columns:minmax(0,1fr) minmax(60px,.55fr) minmax(55px,.5fr) auto!important;gap:3px!important;min-height:44px!important;padding:6px!important;font-size:12px!important}.rx-r38-batch-row>span:nth-of-type(3),.rx-r38-batch-row>span:nth-of-type(4),.rx-r38-batch-row>span:nth-of-type(5){display:none!important}
  .rx-r38-dialog .rx-r38-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))!important}.rx-r38-dialog .rx-r38-action{width:100%!important;min-height:38px!important;font-size:9px!important}

  /* One genuinely complete status line at 320px: abbreviated, not horizontally cut. */
  .rx-bottom-status.rx32-fixed-status{height:var(--rx42-mobile-status-h)!important;min-height:var(--rx42-mobile-status-h)!important;overflow:hidden!important}
  .rx32-status-track{display:grid!important;grid-template-columns:repeat(9,max-content)!important;align-items:center!important;justify-content:space-between!important;width:100%!important;min-width:0!important;height:100%!important;overflow:hidden!important;gap:1px!important;padding:0 3px!important}
  .rx32-status-track>span{display:flex!important;align-items:center!important;min-width:0!important;max-width:100%!important;padding:0 1px!important;font-size:clamp(4.9px,1.38vw,6.8px)!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:clip!important;border:0!important}
  .rx42-wide{display:none!important}.rx42-short{display:inline!important;font-size:inherit!important}.rx32-db-state i{width:4px!important;height:4px!important;margin-right:2px!important}
}

@media(max-width:360px){
  .rx41-topbar-brand{grid-template-columns:32px 28px minmax(0,1fr)!important}.rx-menu-toggle{width:32px!important;height:32px!important;min-width:32px!important}.rx41-brand-link{width:28px!important}.rx41-brand-link img{width:27px!important;height:27px!important}
  .rx41-page-context strong{font-size:9.6px!important}.rx41-page-context small{font-size:6.2px!important}.rx42-inline-context>span{font-size:5.3px!important;padding-inline:3px!important}.rx42-mobile-switch a{min-width:24px!important;font-size:5.7px!important}
  .rx30-primary-action{min-height:76px!important;padding:6px!important}.rx30-dashboard-partners img{max-height:76px!important}.rx30-kpi-grid article,.rx30-kpi-grid>a{min-height:63px!important;padding:4px!important}
  .rx-r38-title{grid-template-columns:minmax(0,.62fr) minmax(0,1.38fr)!important}.rx-r38-title h1{font-size:11px!important}.rx-r38-doc input{font-size:6.8px!important}
  .rx32-status-track>span{font-size:4.7px!important}
}

/* Final mobile geometry corrections — existing asset updated in place. */
@media(max-width:899px){
  :root{--rx42-mobile-status-h:34px;--rx42-mobile-action-h:88px}
  body{padding-bottom:calc(var(--rx42-mobile-status-h) + env(safe-area-inset-bottom,0px))!important}
  .rx-command-bar,.rx30-keyboard-strip,.rx42-mobile-switch{display:none!important}
  .rx-billing-stage{padding-bottom:calc(var(--rx42-mobile-status-h) + 8px)!important}
  .rx42-has-actionbar .rx-billing-stage{padding-bottom:calc(var(--rx42-mobile-status-h) + var(--rx42-mobile-action-h) + 12px)!important}
  .rx-r38-window{margin-bottom:calc(var(--rx42-mobile-action-h) + var(--rx42-mobile-status-h) + 12px)!important}
  .rx-r38-footer-actions{bottom:calc(var(--rx42-mobile-status-h) + env(safe-area-inset-bottom,0px))!important;height:var(--rx42-mobile-action-h)!important;min-height:var(--rx42-mobile-action-h)!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-auto-rows:minmax(36px,1fr)!important;gap:4px!important;padding:5px!important;overflow:hidden!important;border-top:1px solid #c9d9e6!important;box-shadow:0 -8px 22px rgba(19,53,86,.12)!important}
  .rx-r38-footer-actions>a,.rx-r38-footer-actions>button{display:flex!important;align-items:center!important;justify-content:center!important;gap:3px!important;width:100%!important;min-width:0!important;height:auto!important;min-height:36px!important;padding:4px!important;overflow:hidden!important;white-space:normal!important;text-align:center!important;font-size:12px!important;line-height:1.05!important}
  .rx-r38-footer-actions b{font-size:6.6px!important;white-space:nowrap!important}
  .rx41-opd-reopen{bottom:calc(var(--rx42-mobile-status-h) + 8px + env(safe-area-inset-bottom,0px))!important}.rx42-has-actionbar .rx41-opd-reopen{bottom:calc(var(--rx42-mobile-status-h) + var(--rx42-mobile-action-h) + 8px + env(safe-area-inset-bottom,0px))!important}
  .rx-bottom-status.rx32-fixed-status{height:calc(var(--rx42-mobile-status-h) + env(safe-area-inset-bottom,0px))!important;min-height:calc(var(--rx42-mobile-status-h) + env(safe-area-inset-bottom,0px))!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;overflow:hidden!important}
  .rx32-status-track{display:grid!important;grid-template-columns:minmax(0,.8fr) minmax(0,1.3fr) minmax(0,.85fr) minmax(0,.72fr) minmax(0,.58fr) minmax(0,.78fr)!important;align-items:stretch!important;width:100%!important;min-width:0!important;height:var(--rx42-mobile-status-h)!important;padding:0!important;gap:0!important;overflow:hidden!important}
  .rx32-status-track>span{display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;width:100%!important;padding:0 3px!important;border-right:1px solid #dce5ed!important;font-size:clamp(5.5px,1.55vw,7.2px)!important;line-height:1!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .rx-status-pos,.rx-status-time,.rx-status-keyboard{display:none!important}.rx-status-company{justify-content:flex-start!important}.rx-status-active{color:#12803e!important;font-weight:900!important}.rx-status-active::before{width:5px!important;height:5px!important;margin-right:2px!important}
  .rx42-short{display:inline!important}.rx42-wide{display:none!important}.rx32-db-state i{width:5px!important;height:5px!important;flex:0 0 5px!important;margin-right:2px!important}
  .rx-r38-results{bottom:calc(var(--rx42-mobile-status-h) + var(--rx42-mobile-action-h) + 10px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:380px){
  .rx32-status-track{grid-template-columns:minmax(0,.7fr) minmax(0,1.22fr) minmax(0,.8fr) minmax(0,.65fr) minmax(0,.55fr) minmax(0,.72fr)!important}.rx32-status-track>span{font-size:5.2px!important;padding-inline:2px!important}
}
@media(max-width:899px){
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-user,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-company,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-fy,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-db,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-date,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-active{display:flex!important}
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-pos,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-time,
  body.rx-v32 .rx-bottom-status.rx32-fixed-status .rx-status-keyboard{display:none!important}
}

/* 2026-07-19 logic correction: hamburger, logo and title occupy separate cells. */
@media (max-width:899px){
  body.rx-v32 .rx41-topbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 42px!important;
    align-items:center!important;
    column-gap:6px!important;
    min-height:58px!important;
    padding:5px 7px!important;
    overflow:visible!important;
  }
  body.rx-v32 .rx41-topbar-brand{
    display:grid!important;
    grid-template-columns:40px 40px minmax(0,1fr)!important;
    align-items:center!important;
    column-gap:6px!important;
    min-width:0!important;
    width:100%!important;
    overflow:hidden!important;
    isolation:isolate!important;
  }
  body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle{
    grid-column:1!important;
    grid-row:1!important;
    place-self:center!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    margin:0!important;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    z-index:1!important;
  }
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link{
    grid-column:2!important;
    grid-row:1!important;
    place-self:center!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    margin:0!important;
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    z-index:1!important;
  }
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link img{
    display:block!important;
    width:36px!important;
    height:36px!important;
    max-width:36px!important;
    max-height:36px!important;
    object-fit:contain!important;
    object-position:center!important;
    margin:auto!important;
    transform:none!important;
  }
  body.rx-v32 .rx41-topbar-brand>.rx41-page-context{
    grid-column:3!important;
    grid-row:1!important;
    min-width:0!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!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-dashboard>.rx41-dashboard-heading{display:none!important}
}


/* Authoritative mobile shell rules: keep existing asset, remove cascade ambiguity. */
@media(max-width:899px){
  body.rx-v32 .rx41-topbar-brand{grid-template-columns:44px 34px minmax(0,1fr)!important;column-gap:10px!important;overflow:visible!important}
  body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle{width:42px!important;height:42px!important;min-width:42px!important;max-width:42px!important;min-height:42px!important;max-height:42px!important;margin:0!important;transform:none!important}
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link{width:34px!important;height:42px!important;min-width:34px!important;max-width:34px!important;min-height:42px!important;max-height:42px!important;padding:4px 1px!important;border:1px solid #d9e5ef!important;border-radius:9px!important;background:#fff!important;box-shadow:none!important;overflow:hidden!important}
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link img{width:30px!important;height:34px!important;max-width:30px!important;max-height:34px!important;object-fit:contain!important}
  .rx41-module-switch-panel{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .rx41-module-switch-panel>a{display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;min-height:42px!important;margin:0!important}
  .rx-command-bar,.rx30-keyboard-strip,.rx41-dashboard-heading,.rx42-mobile-switch{display:none!important}
}
html.rx-mobile-client .rx-command-bar,html.rx-mobile-client .rx30-keyboard-strip,html.rx-mobile-client .rx41-dashboard-heading,html.rx-mobile-client .rx42-mobile-switch{display:none!important}

/* Authoritative mobile shell geometry: Live OPD starts below the app header and clears fixed bars. */
:root{--rx-live-opd-top:60px;--rx-mobile-statusbar-h:34px;--rx-mobile-actionbar-h:0px}
@media(max-width:899px){
  body.rx-v32 .rx41-topbar{z-index:300!important}
  body.rx-v32 .rx41-live-opd{position:fixed!important;inset:var(--rx-live-opd-top) 0 var(--rx-mobile-statusbar-h) auto!important;top:var(--rx-live-opd-top)!important;right:0!important;bottom:var(--rx-mobile-statusbar-h)!important;left:auto!important;width:min(94vw,420px)!important;height:auto!important;max-height:none!important;min-height:0!important;overflow:hidden!important;border-radius:16px 0 0 0!important;z-index:250!important}
  body.rx-v32 .rx41-opd-backdrop{inset:var(--rx-live-opd-top) 0 var(--rx-mobile-statusbar-h) 0!important;top:var(--rx-live-opd-top)!important;bottom:var(--rx-mobile-statusbar-h)!important;z-index:245!important}
  body.rx-v32 .rx41-opd-reopen{right:8px!important;bottom:calc(var(--rx-mobile-statusbar-h) + var(--rx-mobile-actionbar-h) + 8px)!important;z-index:235!important}
  body.rx-v32 .rx-r38-footer-actions{bottom:var(--rx-mobile-statusbar-h)!important;z-index:220!important;margin:0!important}
  body.rx-v32 .rx-bottom-status.rx32-fixed-status{bottom:0!important;z-index:230!important;height:var(--rx-mobile-statusbar-h)!important;min-height:var(--rx-mobile-statusbar-h)!important}
  body.rx-v32 .rx-r38-window{margin-bottom:calc(var(--rx-mobile-statusbar-h) + var(--rx-mobile-actionbar-h) + 16px)!important}
  body.rx-v32 .rx42-has-actionbar .rx-billing-stage{padding-bottom:calc(var(--rx-mobile-statusbar-h) + var(--rx-mobile-actionbar-h) + 14px)!important}
  body.rx-v32 #retailApp .rx-r38-footer-actions,body.rx-v32 #wholesaleApp .rx-r38-footer-actions{grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-template-rows:1fr!important;height:58px!important;min-height:58px!important;padding:5px!important}
  body.rx-v32 #retailApp .rx-r38-footer-actions>a,body.rx-v32 #retailApp .rx-r38-footer-actions>button,body.rx-v32 #wholesaleApp .rx-r38-footer-actions>a,body.rx-v32 #wholesaleApp .rx-r38-footer-actions>button{min-height:46px!important;height:46px!important;padding:4px 2px!important;white-space:normal!important;font-size:12px!important;line-height:1.05!important}
  body.rx-v32 #purchaseApp .rx-r38-footer-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(36px,1fr))!important;height:88px!important;min-height:88px!important}
  body.rx-v32 .rx-live-opd-head{position:sticky!important;top:0!important;z-index:5!important}
  body.rx-v32 .rx-live-opd-sessions{padding-bottom:18px!important}
}
@media(max-width:430px){
  body.rx-v32 #retailApp .rx-r38-footer-actions,body.rx-v32 #wholesaleApp .rx-r38-footer-actions{height:62px!important;min-height:62px!important}
  body.rx-v32 #retailApp .rx-r38-footer-actions>a,body.rx-v32 #retailApp .rx-r38-footer-actions>button,body.rx-v32 #wholesaleApp .rx-r38-footer-actions>a,body.rx-v32 #wholesaleApp .rx-r38-footer-actions>button{min-height:50px!important;height:50px!important;font-size:6.4px!important}
}

/* Authoritative mobile geometry: header, OPD drawer, action bar and status bar never overlap. */
:root{--rx-live-opd-gap:8px}
@media(max-width:899px){
  body.rx-v32 .rx41-live-opd{
    display:flex!important;
    flex-direction:column!important;
    top:calc(var(--rx-live-opd-top,60px) + var(--rx-live-opd-gap))!important;
    right:var(--rx-live-opd-gap)!important;
    bottom:calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-live-opd-gap))!important;
    left:auto!important;
    width:min(calc(100vw - 16px),420px)!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:hidden!important;
    border:1px solid #c7d9e8!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:-12px 16px 42px rgba(8,37,68,.28)!important;
  }
  body.rx-v32 .rx41-live-opd .rx-live-opd-head{display:flex!important;flex:0 0 auto!important;position:relative!important;top:auto!important;min-height:58px!important;padding:9px 11px!important;visibility:visible!important;opacity:1!important;z-index:8!important}
  body.rx-v32 .rx41-live-opd .rx-live-opd-health,
  body.rx-v32 .rx41-live-opd .rx-live-opd-filter,
  body.rx-v32 .rx41-live-opd .rx-live-doctor-filter,
  body.rx-v32 .rx41-live-opd .rx-live-opd-policy{flex:0 0 auto!important}
  body.rx-v32 .rx41-live-opd .rx-live-opd-sessions{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding-bottom:18px!important}
  body.rx-v32 .rx41-opd-backdrop{top:var(--rx-live-opd-top,60px)!important;bottom:var(--rx-mobile-statusbar-h,34px)!important}
  body.rx-v32 .rx41-opd-reopen{bottom:calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-actionbar-h,0px) + 10px)!important}

  body.rx-v32 .rx-r38-footer-actions{
    bottom:var(--rx-mobile-statusbar-h,34px)!important;
    left:0!important;
    right:0!important;
    margin:0!important;
    border-top:1px solid #c7d7e4!important;
    border-bottom:0!important;
    background:#fff!important;
    box-shadow:0 -8px 22px rgba(18,55,88,.10)!important;
  }
  body.rx-v32 #retailApp .rx-r38-footer-actions,
  body.rx-v32 #wholesaleApp .rx-r38-footer-actions{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-template-rows:58px!important;
    gap:4px!important;
    height:66px!important;
    min-height:66px!important;
    max-height:66px!important;
    padding:4px!important;
    overflow:hidden!important;
  }
  body.rx-v32 #retailApp .rx-r38-footer-actions>a,
  body.rx-v32 #retailApp .rx-r38-footer-actions>button,
  body.rx-v32 #wholesaleApp .rx-r38-footer-actions>a,
  body.rx-v32 #wholesaleApp .rx-r38-footer-actions>button{
    min-width:0!important;
    width:100%!important;
    height:58px!important;
    min-height:58px!important;
    max-height:58px!important;
    margin:0!important;
    padding:4px 2px!important;
    overflow:hidden!important;
    font-size:12px!important;
    line-height:1.08!important;
    white-space:normal!important;
  }
  body.rx-v32 #purchaseApp .rx-r38-footer-actions{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,42px)!important;
    gap:4px!important;
    height:94px!important;
    min-height:94px!important;
    max-height:94px!important;
    padding:4px!important;
    overflow:hidden!important;
  }
  body.rx-v32 .rx-bottom-status.rx32-fixed-status{
    display:block!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    overflow:hidden!important;
    border-top:1px solid #c6d6e3!important;
    background:#fff!important;
  }
  body.rx-v32 .rx-bottom-status .rx-status-pos,
  body.rx-v32 .rx-bottom-status .rx-status-time,
  body.rx-v32 .rx-bottom-status .rx-status-active,
  body.rx-v32 .rx-bottom-status .rx-status-keyboard{display:none!important}
  body.rx-v32 .rx-bottom-status .rx32-status-track{
    display:grid!important;
    grid-template-columns:minmax(0,.82fr) minmax(0,1.55fr) minmax(0,.78fr) minmax(0,.72fr) minmax(0,.72fr)!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    height:34px!important;
    gap:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.rx-v32 .rx-bottom-status .rx32-status-track>span{
    display:flex!important;
    min-width:0!important;
    height:34px!important;
    padding:0 3px!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
    border-right:1px solid #dbe5ed!important;
    font-size:clamp(5.5px,1.55vw,7px)!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.rx-v32 .rx-r38-window{margin-bottom:calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-actionbar-h,0px) + 12px)!important}
}

/* Production responsive contract: 320px–1920px */
@media (min-width:900px){
  body.rx-v32 .rx41-topbar{grid-template-columns:minmax(280px,1fr) auto auto!important}
  body.rx-v32 .rx41-desktop-module-switch{display:grid!important}
  body.rx-v32 .rx41-module-switch-panel{display:none!important}
  body.rx-v32 .rx-billing-stage{min-width:0!important;max-width:1920px!important;margin-inline:auto!important}
}
@media (max-width:899px){
  body.rx-v32 .rx41-desktop-module-switch{display:none!important}
  body.rx-v32 .rx41-module-switch-panel{display:grid!important}
  body.rx-v32 .rx41-topbar{grid-template-columns:minmax(0,1fr) auto!important;width:100%!important;min-width:0!important}
  body.rx-v32 .rx41-topbar-brand{display:grid!important;grid-template-columns:44px 42px minmax(0,1fr)!important;gap:7px!important;min-width:0!important}
  body.rx-v32 .rx41-topbar-brand>.rx-menu-toggle,
  body.rx-v32 .rx41-topbar-brand>.rx41-brand-link{position:relative!important;inset:auto!important;transform:none!important;margin:0!important}
  body.rx-v32 .rx41-page-context{min-width:0!important;overflow:hidden!important}
  body.rx-v32 .rx-command-bar,body.rx-v32 .rx30-keyboard-strip{display:none!important}
  body.rx-v32 .rx41-live-opd{top:calc(var(--rx-live-opd-top,60px) + 8px)!important;bottom:calc(var(--rx-mobile-statusbar-h,34px) + 8px)!important}
}
@media (min-width:431px) and (max-width:899px){
  body.rx-v32 #retailApp .rx-r38-footer-actions:has(a[href*="wholesale"]){grid-template-columns:repeat(6,minmax(0,1fr))!important}
}
@media (max-width:430px){
  body.rx-v32 #retailApp .rx-r38-footer-actions,
  body.rx-v32 #wholesaleApp .rx-r38-footer-actions{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,42px)!important;
    height:94px!important;min-height:94px!important;max-height:94px!important
  }
  body.rx-v32 #retailApp .rx-r38-footer-actions>a,
  body.rx-v32 #retailApp .rx-r38-footer-actions>button,
  body.rx-v32 #wholesaleApp .rx-r38-footer-actions>a,
  body.rx-v32 #wholesaleApp .rx-r38-footer-actions>button{
    height:42px!important;min-height:42px!important;max-height:42px!important;font-size:6.8px!important
  }
  body.rx-v32 .rx41-live-opd{right:4px!important;width:calc(100vw - 8px)!important;border-radius:13px!important}
  body.rx-v32 .rx-live-opd-filter{grid-template-columns:minmax(0,1fr) auto!important}
}
@media (max-width:340px){
  body.rx-v32 .rx41-topbar-brand{grid-template-columns:40px 38px minmax(0,1fr)!important;gap:4px!important}
  body.rx-v32 .rx41-page-context strong{font-size:9.5px!important}
  body.rx-v32 .rx41-page-context small{font-size:6.5px!important}
  body.rx-v32 .rx-bottom-status .rx32-status-track>span{font-size:5.2px!important;padding-inline:1px!important}
}

/* RX Billing R62: mobile transaction wizard. Desktop workstation flow remains unchanged. */
.rx-mobile-wizard-ui{display:none}
.rx-billing-mode-switch{
  display:none;
  position:absolute;
  top:5px;
  right:7px;
  z-index:30;
  align-items:center;
  gap:3px;
  padding:3px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:8px;
  background:rgba(4,38,67,.92);
  box-shadow:0 3px 12px rgba(1,20,38,.2);
}
html.rx-billing-hybrid-capable .rx-billing-mode-switch{display:flex}
.rx-billing-mode-switch>span{
  padding:0 4px;
  color:#dbeaf5;
  font-size:7px;
  font-weight:900;
  letter-spacing:.04em;
  white-space:nowrap;
}
.rx-billing-mode-switch>button{
  min-width:0!important;
  min-height:27px!important;
  height:27px!important;
  margin:0!important;
  padding:3px 6px!important;
  border:1px solid #8098aa!important;
  border-radius:5px!important;
  background:#f4f8fb!important;
  color:#244058!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1!important;
}
.rx-billing-mode-switch>button.is-selected{
  border-color:#50d5c7!important;
  background:#0a8178!important;
  color:#fff!important;
}

@media screen{
  :root{--rx-mobile-wizard-actions-h:74px}
  html.rx-billing-touch-mode,
  html.rx-billing-touch-mode body{max-width:100%;overflow-x:hidden!important}
  body.rx-v32:has(.rx-mobile-wizard-enabled){--rx-mobile-actionbar-h:var(--rx-mobile-wizard-actions-h)}
  body.rx-v32.rx-mobile-keyboard-open:has(.rx-mobile-wizard-enabled){--rx-mobile-actionbar-h:0px}

  .rx-mobile-wizard-enabled{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 0 calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-wizard-actions-h) + 14px)!important;
    overflow:visible!important;
    border-radius:12px!important;
  }
  .rx-mobile-wizard-enabled *{box-sizing:border-box}
  .rx-mobile-wizard-enabled .rx-mobile-wizard-ui{display:flex}
  .rx-mobile-wizard-enabled .rx-mobile-original-actions{display:none!important}
  body.rx-v32.rx-mobile-keyboard-open .rx-mobile-wizard-actions{display:none!important}
  body.rx-v32.rx-mobile-keyboard-open .rx-bottom-status{display:none!important}
  body.rx-v32.rx-mobile-keyboard-open .rx-mobile-wizard-enabled{margin-bottom:12px!important}

  .rx-mobile-wizard-enabled>.rx-legacy-menu{
    min-height:42px!important;
    height:auto!important;
    padding:10px 12px!important;
    border-radius:10px 10px 0 0!important;
  }
  .rx-mobile-wizard-enabled>.rx-legacy-menu b{font-size:15px!important;letter-spacing:.015em!important}
  .rx-mobile-wizard-enabled>.rx-legacy-menu small{display:none!important}
  .rx-mobile-wizard-enabled>.rx-legacy-menu .rx-interface-menu{display:none!important}

  .rx-mobile-wizard-nav{
    position:sticky;
    top:58px;
    z-index:145;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    width:100%;
    padding:7px;
    border-bottom:1px solid #cbd8e4;
    background:rgba(246,250,253,.98);
    box-shadow:0 5px 14px rgba(21,54,85,.08);
    backdrop-filter:blur(8px);
  }
  .rx-mobile-wizard-nav button{
    position:relative;
    display:grid;
    grid-template-columns:25px minmax(0,1fr);
    grid-template-rows:auto auto;
    align-items:center;
    gap:0 5px;
    min-width:0;
    min-height:48px;
    margin:0;
    padding:6px;
    border:1px solid #c8d4df;
    border-radius:9px;
    background:#fff;
    color:#30445a;
    text-align:left;
  }
  .rx-mobile-wizard-nav button>span{
    grid-row:1/3;
    display:grid;
    place-items:center;
    width:25px;
    height:25px;
    border-radius:50%;
    background:#e8eef4;
    color:#445970;
    font-size:11px;
    font-weight:900;
  }
  .rx-mobile-wizard-nav button>b{
    min-width:0;
    overflow:hidden;
    font-size:9px;
    line-height:1.05;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .rx-mobile-wizard-nav button>small{
    color:#718095;
    font-size:6.6px;
    font-weight:800;
    line-height:1;
  }
  .rx-mobile-wizard-nav button.is-active{
    border-color:#078b80;
    background:#e8faf7;
    color:#075f59;
    box-shadow:0 0 0 2px rgba(8,139,128,.12);
  }
  .rx-mobile-wizard-nav button.is-active>span{background:#087f75;color:#fff}
  .rx-mobile-wizard-nav button.is-complete>span{background:#236a59;color:#fff}

  .rx-mobile-step-heading{
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-height:58px;
    padding:9px 11px;
    border-bottom:1px solid #d2dde7;
    background:#fff;
  }
  .rx-mobile-step-heading>div{display:grid;gap:2px;min-width:0}
  .rx-mobile-step-heading [data-rx-mobile-step-number]{color:#087f75;font-size:7px;font-weight:950;letter-spacing:.08em}
  .rx-mobile-step-heading strong{color:#1f3146;font-size:15px;line-height:1.1}
  .rx-mobile-step-heading small{overflow:hidden;color:#66768a;font-size:8px;text-overflow:ellipsis;white-space:nowrap}
  .rx-mobile-step-heading>[data-rx-mobile-item-count]{
    flex:0 0 auto;
    padding:6px 8px;
    border:1px solid #bed3ce;
    border-radius:999px;
    background:#eff9f6;
    color:#126254;
    font-size:8px;
    white-space:nowrap;
  }

  .rx-mobile-wizard-alert{
    display:block!important;
    margin:7px 8px 0;
    padding:9px 10px;
    border:1px solid #e4b1b8;
    border-radius:8px;
    background:#fff2f4;
    color:#8b2030;
    font-size:9px;
    font-weight:800;
    line-height:1.35;
  }
  .rx-mobile-wizard-alert[hidden]{display:none!important}
  .rx-mobile-wizard-alert[data-tone="ok"]{border-color:#a9d6c9;background:#effaf6;color:#12634f}

  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="details"] .rx-mobile-panel-items,
  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="details"] .rx-mobile-panel-lines,
  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="details"] .rx-mobile-panel-review{display:none!important}
  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="items"] .rx-mobile-panel-details,
  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="items"] .rx-mobile-panel-review{display:none!important}
  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="review"] .rx-mobile-panel-details,
  html body :is(#retailApp,#purchaseApp,#wholesaleApp).rx-mobile-wizard-enabled[data-rx-mobile-step="review"] .rx-mobile-panel-items{display:none!important}

  /* Step 1: compact, readable bill header form. */
  .rx-mobile-wizard-enabled .rx44-retail-head,
  .rx-mobile-wizard-enabled .rx44-wholesale-head,
  .rx-mobile-wizard-enabled .rx44-purchase-head{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    padding:10px!important;
    overflow:visible!important;
    background:#f3f7fb!important;
  }
  .rx-mobile-wizard-enabled .rx44-retail-head>*,
  .rx-mobile-wizard-enabled .rx44-wholesale-head>*,
  .rx-mobile-wizard-enabled .rx44-purchase-head>*{
    grid-column:auto!important;
    grid-row:auto!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }
  .rx-mobile-wizard-enabled .rx44-retail-head .rx-customer-field,
  .rx-mobile-wizard-enabled .rx44-retail-head .rx-address-field,
  .rx-mobile-wizard-enabled .rx44-wholesale-head .rx-buyer-field,
  .rx-mobile-wizard-enabled .rx44-wholesale-head .rx-address-field,
  .rx-mobile-wizard-enabled .rx44-purchase-head .rx-supplier-field,
  .rx-mobile-wizard-enabled .rx44-purchase-head .rx-address-field{grid-column:1/-1!important}

  .rx-mobile-wizard-enabled .rx-mobile-panel-details label,
  .rx-mobile-wizard-enabled .rx-mobile-panel-details .rx-r38-search>label{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
    width:100%!important;
    min-width:0!important;
    align-items:start!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-details label>span{
    font-size:8px!important;
    line-height:1.1!important;
    white-space:normal!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-details input,
  .rx-mobile-wizard-enabled .rx-mobile-panel-details select{
    width:100%!important;
    min-width:0!important;
    height:42px!important;
    min-height:42px!important;
    padding:8px 9px!important;
    border-radius:7px!important;
    font-size:12px!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-details input[readonly]{background:#edf2f6!important;color:#4e5c6d!important}

  /* Step 2: product entry is a focused two-column form. */
  .rx-mobile-wizard-enabled .rx-mobile-panel-items{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    padding:10px!important;
    overflow:visible!important;
    border:0!important;
    background:#f5f9fc!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>*,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>label,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>.rx-r38-search{
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-items .product,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items .rx-purchase-product-search,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>.rx-r38-action,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>.rx42-scan-open{grid-column:1/-1!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-items label,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items .rx-r38-search>label{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
    width:100%!important;
    min-width:0!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-items label>span{font-size:8px!important;line-height:1.1!important;white-space:normal!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-items input,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items select{
    width:100%!important;
    min-width:0!important;
    height:44px!important;
    min-height:44px!important;
    padding:8px 9px!important;
    border-radius:7px!important;
    font-size:12px!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-items .product input,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items .rx-purchase-product-search input{
    height:50px!important;
    min-height:50px!important;
    font-size:13px!important;
    font-weight:800!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>.rx-r38-action,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items>.rx42-scan-open{
    width:100%!important;
    min-height:48px!important;
    margin:0!important;
    border-radius:8px!important;
    font-size:11px!important;
    font-weight:900!important;
  }
  .rx-mobile-wizard-enabled .rx-r38-results,
  .rx-mobile-wizard-enabled .rx44-batch-list,
  .rx-mobile-wizard-enabled .rx-purchase-inline-browser{
    position:fixed!important;
    inset:calc(58px + 62px) 6px auto 6px!important;
    width:auto!important;
    max-width:none!important;
    max-height:58dvh!important;
    overflow:auto!important;
    z-index:1200!important;
    border-radius:10px!important;
  }
  .rx-mobile-wizard-enabled .rx-r38-dialog[open],
  .rx-mobile-wizard-enabled dialog.rx-r38-dialog[open]{
    z-index:1400!important;
    width:min(94vw,720px)!important;
    max-width:94vw!important;
    max-height:88dvh!important;
    overflow:auto!important;
  }

  /* Products are mobile cards instead of a 920px horizontal grid. */
  .rx-mobile-wizard-enabled .rx-legacy-table-title{
    height:auto!important;
    min-height:38px!important;
    padding:10px 12px!important;
    border:0!important;
    background:#2d4359!important;
    font-size:11px!important;
    letter-spacing:.08em!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines.rx-r38-table-wrap{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    max-height:none!important;
    padding:8px!important;
    overflow:visible!important;
    border:0!important;
    background:#eaf0f5!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines table,
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines tbody,
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines tr,
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines table{min-width:0!important;border-collapse:separate!important;border-spacing:0!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines thead{display:none!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines tbody{display:grid!important;gap:9px!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines tr{
    padding:7px!important;
    overflow:hidden!important;
    border:1px solid #bdcad6!important;
    border-radius:10px!important;
    background:#fff!important;
    box-shadow:0 4px 12px rgba(26,57,86,.07)!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines tr.rx-line-selected{border-color:#078b80!important;box-shadow:0 0 0 2px rgba(8,139,128,.12)!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td{
    display:grid!important;
    grid-template-columns:minmax(92px,35%) minmax(0,65%)!important;
    align-items:center!important;
    gap:7px!important;
    min-height:34px!important;
    padding:5px 3px!important;
    border:0!important;
    border-bottom:1px solid #e3e9ef!important;
    background:#fff!important;
    color:#1e2d3d!important;
    font-size:10px!important;
    text-align:right!important;
    white-space:normal!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td:last-child{border-bottom:0!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td::before{
    content:attr(data-label);
    color:#607186;
    font-size:7.5px;
    font-weight:900;
    letter-spacing:.035em;
    text-align:left;
    text-transform:uppercase;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td[data-mobile-field="product-description"]{
    grid-template-columns:1fr!important;
    padding:7px 4px!important;
    color:#173149!important;
    font-size:12px!important;
    font-weight:900!important;
    text-align:left!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td[data-mobile-field="product-description"]::before{margin-bottom:2px}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td[data-mobile-field="sl"],
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td[data-mobile-field="field-1"]{display:none!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td:last-child button{
    width:100%!important;
    min-height:36px!important;
    border-radius:7px!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines td input{
    width:100%!important;
    min-width:0!important;
    height:36px!important;
    min-height:36px!important;
    padding:5px 7px!important;
    font-size:11px!important;
    text-align:right!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines .rx-mobile-empty-row{padding:0!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines .rx-mobile-empty-row td{
    display:block!important;
    min-height:80px!important;
    padding:28px 12px!important;
    color:#75869a!important;
    text-align:center!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-lines .rx-mobile-empty-row td::before{display:none!important}

  /* During rapid product entry only essential row fields are shown. Full detail returns in Review. */
  #retailApp[data-rx-mobile-step="items"] td[data-mobile-field="mrp"],
  #retailApp[data-rx-mobile-step="items"] td[data-mobile-field="rate"],
  #retailApp[data-rx-mobile-step="items"] td[data-mobile-field="dis"],
  #retailApp[data-rx-mobile-step="items"] td[data-mobile-field="gst"],
  #wholesaleApp[data-rx-mobile-step="items"] td[data-mobile-field="hsn"],
  #wholesaleApp[data-rx-mobile-step="items"] td[data-mobile-field="packing"],
  #wholesaleApp[data-rx-mobile-step="items"] td[data-mobile-field="mrp"],
  #wholesaleApp[data-rx-mobile-step="items"] td[data-mobile-field="dis"],
  #wholesaleApp[data-rx-mobile-step="items"] td[data-mobile-field="gst"],
  #purchaseApp[data-rx-mobile-step="items"] td[data-mobile-field="hsn"],
  #purchaseApp[data-rx-mobile-step="items"] td[data-mobile-field="net-rate"],
  #purchaseApp[data-rx-mobile-step="items"] td[data-mobile-field="sale-rate"],
  #purchaseApp[data-rx-mobile-step="items"] td[data-mobile-field="gst"],
  #purchaseApp[data-rx-mobile-step="items"] td[data-mobile-field="dis"]{display:none!important}

  /* Step 3: totals are large enough to verify before save. */
  .rx-mobile-wizard-enabled .rx-mobile-panel-review{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important;
    min-width:0!important;
    padding:10px!important;
    border:0!important;
    background:#f1f5f8!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-review>label,
  .rx-mobile-wizard-enabled .rx-mobile-panel-review>div{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    min-height:48px!important;
    margin:0!important;
    padding:8px!important;
    border:1px solid #c9d4de!important;
    border-radius:8px!important;
    background:#fff!important;
    color:#26394e!important;
    font-size:9px!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-review>label{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(90px,45%)!important}
  .rx-mobile-wizard-enabled .rx-mobile-panel-review input,
  .rx-mobile-wizard-enabled .rx-mobile-panel-review select{
    width:100%!important;
    min-width:0!important;
    height:36px!important;
    min-height:36px!important;
    font-size:10px!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-review .net{
    grid-column:1/-1!important;
    min-height:58px!important;
    background:#e9f7f3!important;
    color:#0f5e51!important;
    font-size:11px!important;
  }
  .rx-mobile-wizard-enabled .rx-mobile-panel-review .net b{font-size:17px!important}

  .rx-mobile-wizard-enabled .rx-mobile-panel-status{
    display:block!important;
    width:100%!important;
    min-height:36px!important;
    height:auto!important;
    padding:9px 10px!important;
    overflow:visible!important;
    border-top:1px solid #c6d7df!important;
    background:#eafaf7!important;
    color:#15594f!important;
    font-size:8px!important;
    line-height:1.35!important;
    white-space:normal!important;
  }

  .rx-mobile-wizard-actions{
    position:fixed;
    left:0;
    right:0;
    bottom:var(--rx-mobile-statusbar-h,34px);
    z-index:520;
    display:grid!important;
    grid-template-columns:minmax(74px,.8fr) minmax(150px,1.7fr) minmax(74px,.8fr);
    gap:5px;
    height:var(--rx-mobile-wizard-actions-h);
    padding:7px;
    border-top:1px solid #c5d3df;
    background:rgba(255,255,255,.98);
    box-shadow:0 -9px 24px rgba(19,49,78,.14);
    backdrop-filter:blur(10px);
  }
  .rx-mobile-wizard-actions.is-review{grid-template-columns:minmax(66px,.7fr) minmax(120px,1.35fr) minmax(72px,.75fr) minmax(62px,.65fr)}
  .rx-mobile-wizard-actions>button{
    min-width:0;
    min-height:54px;
    margin:0;
    padding:5px 6px;
    overflow:hidden;
    border:1px solid #9eb0c1;
    border-radius:9px;
    background:#eef3f7;
    color:#31475c;
    font-size:8px;
    font-weight:900;
    line-height:1.1;
    white-space:normal;
  }
  .rx-mobile-wizard-actions .rx-mobile-action-primary{border-color:#08776f;background:#078b80;color:#fff;font-size:9px}
  .rx-mobile-wizard-actions .rx-mobile-action-primary:active{background:#056d65}
  .rx-mobile-wizard-actions .rx-mobile-action-print{border-color:#44677f;background:#365c76;color:#fff}
  .rx-mobile-wizard-actions .rx-mobile-action-back:disabled{opacity:.42}
  .rx-mobile-more-menu{
    position:absolute;
    right:7px;
    bottom:calc(100% + 7px);
    display:grid;
    gap:5px;
    width:min(78vw,290px);
    padding:7px;
    border:1px solid #b6c6d4;
    border-radius:10px;
    background:#fff;
    box-shadow:0 16px 35px rgba(20,49,77,.25);
  }
  .rx-mobile-more-menu[hidden]{display:none!important}
  .rx-mobile-more-menu button{
    width:100%;
    min-height:42px;
    padding:7px 9px;
    border:1px solid #d0dae3;
    border-radius:7px;
    background:#f5f8fa;
    color:#2c4054;
    font-size:9px;
    font-weight:850;
    text-align:left;
  }

  body.rx-v32:has(.rx-mobile-wizard-enabled) .rx41-opd-reopen{
    bottom:calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-wizard-actions-h) + 10px)!important;
  }
  body.rx-v32.rx-mobile-keyboard-open:has(.rx-mobile-wizard-enabled) .rx41-opd-reopen{display:none!important}
  .rx-mobile-wizard-capable:not(.rx-mobile-wizard-enabled) .rx-mobile-wizard-ui{display:none!important}
  html.rx-billing-touch-mode body.rx-v32 #retailApp.rx-mobile-wizard-enabled > .rx-r38-footer-actions.rx-legacy-pc-actions,
  html.rx-billing-touch-mode body.rx-v32 #wholesaleApp.rx-mobile-wizard-enabled > .rx-r38-footer-actions.rx-legacy-pc-actions,
  html.rx-billing-touch-mode body.rx-v32 #purchaseApp.rx-mobile-wizard-enabled > .rx-r38-footer-actions.rx-legacy-pc-actions{display:none!important}
}

@media(max-width:380px){
  .rx-mobile-wizard-nav{gap:3px;padding:5px}
  .rx-mobile-wizard-nav button{grid-template-columns:22px minmax(0,1fr);min-height:44px;padding:4px}
  .rx-mobile-wizard-nav button>span{width:22px;height:22px;font-size:9px}
  .rx-mobile-wizard-nav button>b{font-size:8px}
  .rx-mobile-wizard-nav button>small{font-size:5.8px}
  .rx-mobile-wizard-enabled .rx44-retail-head,
  .rx-mobile-wizard-enabled .rx44-wholesale-head,
  .rx-mobile-wizard-enabled .rx-mobile-panel-items{gap:6px;padding:8px}
  .rx-mobile-wizard-actions{padding:5px;gap:3px}
  .rx-mobile-wizard-actions>button{font-size:7.2px;padding:4px}
}

/* RX Billing mobile action-bar R11 — reliable touch MORE menu. */
@media (max-width: 767px) {
  .rx-mobile-wizard-actions {
    overflow: visible !important;
    isolation: isolate !important;
  }

  .rx-mobile-wizard-actions.rx-mobile-more-open {
    z-index: 2147482500 !important;
  }

  .rx-mobile-more-menu {
    z-index: 2147482600 !important;
    display: grid !important;
    max-height: min(58svh, 420px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
  }

  .rx-mobile-more-menu[hidden] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .rx-mobile-more-menu:not([hidden]) {
    display: grid !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .rx-mobile-more-menu > button {
    touch-action: manipulation !important;
  }
}

/* R12 — transaction shell, tablet touch and menu stability. */
@media (min-width:900px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu{
    display:grid!important;
    grid-template-columns:minmax(145px,.8fr) minmax(0,1fr) auto auto!important;
    grid-template-areas:"title instruction interface mode"!important;
    align-items:center!important;
    gap:5px!important;
    min-height:34px!important;
    height:34px!important;
    padding:0 7px!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>b{
    grid-area:title!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-f4-instruction{
    grid-area:instruction!important;display:block!important;min-width:0!important;overflow:hidden!important;text-align:center!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-interface-menu{
    grid-area:interface!important;display:flex!important;min-width:300px!important;margin:0!important;justify-self:end!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-billing-mode-switch{
    position:static!important;inset:auto!important;grid-area:mode!important;align-self:center!important;justify-self:end!important;display:flex!important;z-index:1!important;box-shadow:none!important;
  }
}
@media (min-width:900px) and (max-width:1360px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu{
    grid-template-columns:minmax(125px,.72fr) minmax(280px,1fr) auto!important;
    grid-template-areas:"title interface mode"!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-f4-instruction{display:none!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-interface-menu{min-width:280px!important}
  body.rx-transaction-page .rx-interface-menu>div>button{padding-inline:6px!important;font-size:12px!important}
}
/* A manually selected TOUCH layout on a landscape tablet remains a single-page
   transaction workstation. It gets larger targets but never the handset wizard. */
html.rx-billing-tablet-touch-mode body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp){
  font-size:10px!important;
}
html.rx-billing-tablet-touch-mode body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(input,select,button){
  touch-action:manipulation;
}
html.rx-billing-tablet-touch-mode body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(input,select){
  min-height:28px!important;height:28px!important;font-size:9px!important;
}
html.rx-billing-tablet-touch-mode body.rx-transaction-page .rx-interface-menu>div>button{
  min-height:32px!important;height:32px!important;padding-inline:8px!important;
}
html.rx-billing-tablet-touch-mode .rx-mobile-wizard-ui{display:none!important}
html.rx-billing-tablet-touch-mode :is(#retailApp,#wholesaleApp,#purchaseApp).rx-mobile-wizard-enabled .rx-mobile-original-actions{
  display:grid!important;
}
html.rx-billing-tablet-touch-mode :is(#retailApp,#wholesaleApp,#purchaseApp).rx-mobile-wizard-enabled{
  margin-bottom:0!important;border-radius:8px!important;
}
/* Keep dropdowns above the fixed transaction canvas without converting them to
   handset full-screen sheets on landscape tablets. */
html.rx-billing-tablet-touch-mode .rx-r27-portaled-supplier-list,
html.rx-billing-tablet-touch-mode #buyerResults,
html.rx-billing-tablet-touch-mode #wholesaleSalesmanResults{
  z-index:14000!important;
}


/* R14 — mobile sidebar, tablet transaction header and notification repair. */
body.rx-transaction-page .rx-sidebar-scrim{
  background:rgba(7,24,38,.22)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
body.rx-transaction-page .rx-sidebar-scrim[hidden]{
  display:none!important;
  pointer-events:none!important;
}
@media (min-width:900px) and (max-width:1280px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu{
    grid-template-columns:minmax(130px,.9fr) auto!important;
    grid-template-rows:34px 34px!important;
    grid-template-areas:
      "title mode"
      "interface interface"!important;
    align-items:center!important;
    min-height:70px!important;
    height:auto!important;
    padding:4px 7px!important;
    row-gap:4px!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-f4-instruction{
    display:none!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-interface-menu{
    grid-area:interface!important;
    display:flex!important;
    min-width:0!important;
    width:100%!important;
    justify-self:stretch!important;
    overflow-x:auto!important;
    scrollbar-width:none!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-interface-menu::-webkit-scrollbar{display:none!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-billing-mode-switch{
    grid-area:mode!important;
    justify-self:end!important;
    max-width:100%!important;
  }
  body.rx-transaction-page .rx-interface-menu>div>button{
    padding-inline:6px!important;
    font-size:12px!important;
    white-space:nowrap!important;
  }
}
@media (min-width:900px) and (max-width:1080px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-billing-mode-switch{
    gap:2px!important;
    padding:2px!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-billing-mode-switch>span{
    font-size:6.5px!important;
    padding-inline:3px!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-billing-mode-switch>button{
    min-height:25px!important;
    height:25px!important;
    padding:2px 5px!important;
    font-size:6.5px!important;
  }
}


/* R13 — phone action-bar clearance and safe bottom spacing. */
@media (max-width: 767px) {
  :root { --rx-mobile-wizard-actions-h: 86px; --rx-mobile-wizard-safe-gap: 8px; }
  .rx-mobile-wizard-enabled {
    margin-bottom: calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-wizard-actions-h) + var(--rx-mobile-wizard-safe-gap) + 16px) !important;
  }
  .rx-mobile-wizard-actions {
    bottom: calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-wizard-safe-gap)) !important;
    height: auto !important;
    min-height: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* R17 — action bar and status footer never overlap while scrolling. */
@media (max-width: 767px) {
  :root {
    --rx-mobile-wizard-actions-h: 72px;
    --rx-mobile-wizard-safe-gap: 0px;
  }

  .rx-mobile-wizard-enabled {
    margin-bottom: calc(var(--rx-mobile-statusbar-h,34px) + var(--rx-mobile-wizard-actions-h) + 14px) !important;
    padding-bottom: 0 !important;
  }

  .rx-mobile-wizard-actions {
    bottom: calc(var(--rx-mobile-statusbar-h,34px) + env(safe-area-inset-bottom,0px)) !important;
    height: var(--rx-mobile-wizard-actions-h) !important;
    min-height: var(--rx-mobile-wizard-actions-h) !important;
    padding: 6px !important;
    padding-bottom: 6px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #fff !important;
  }

  .rx-mobile-wizard-actions > button {
    min-height: 58px !important;
    height: 58px !important;
  }

  body.rx-v32 .rx-bottom-status.rx32-fixed-status {
    bottom: 0 !important;
    z-index: 530 !important;
  }
}


/* R16 targeted UI hotfix: remove R15 regression visually and restore stable shell on tablet widths. */
@media (min-width:900px){
  .rx30-dashboard-partners{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:12px!important;
    align-items:stretch!important;
    margin-top:10px!important;
  }
  .rx30-dashboard-partners > a,
  .rx30-dashboard-partners > span{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-height:96px!important;
    padding:10px 12px!important;
    border:1px solid #d7e3ed!important;
    border-radius:16px!important;
    background:#fff!important;
    box-shadow:0 4px 14px rgba(24,52,84,.05)!important;
    overflow:hidden!important;
  }
  .rx30-dashboard-partners img{
    width:100%!important;
    height:58px!important;
    object-fit:contain!important;
    object-position:center!important;
  }
}

@media (min-width:900px) and (max-width:1240px){
  body.rx-v32 .rx41-topbar,
  body.rx-v36 .rx41-topbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    row-gap:8px!important;
    column-gap:10px!important;
    min-height:auto!important;
    height:auto!important;
    padding:8px 12px!important;
  }
  body.rx-v32 .rx41-topbar-brand,
  body.rx-v36 .rx41-topbar-brand{
    min-width:0!important;
    width:100%!important;
  }
  body.rx-v32 .rx41-page-context strong,
  body.rx-v36 .rx41-page-context strong{font-size:13px!important;line-height:1.1!important}
  body.rx-v32 .rx41-page-context small,
  body.rx-v36 .rx41-page-context small{font-size:8.5px!important;line-height:1.1!important}
  body.rx-v32 .rx42-inline-context,
  body.rx-v36 .rx42-inline-context{display:flex!important;align-items:center!important;gap:5px!important;flex-wrap:wrap!important;margin-top:4px!important}
  body.rx-v32 .rx42-inline-context > span,
  body.rx-v36 .rx42-inline-context > span{display:inline-flex!important;align-items:center!important;gap:4px!important;min-height:18px!important;padding:1px 6px!important;border:1px solid #d6e2ed!important;border-radius:999px!important;background:#f7fbff!important;color:#315676!important;font-size:9px!important;font-weight:900!important;line-height:1!important}
  body.rx-v32 .rx42-inline-context .is-connected,
  body.rx-v36 .rx42-inline-context .is-connected{border-color:#bde3c9!important;background:#effaf3!important;color:#087a36!important}
  body.rx-v32 .rx42-inline-context .is-disconnected,
  body.rx-v36 .rx42-inline-context .is-disconnected{border-color:#edbec2!important;background:#fff1f2!important;color:#a61e28!important}
  body.rx-v32 .rx42-inline-context i,
  body.rx-v36 .rx42-inline-context i{width:6px!important;height:6px!important;border-radius:50%!important;background:currentColor!important;box-shadow:0 0 5px currentColor!important}
  body.rx-v32 .rx41-runtime-context,
  body.rx-v36 .rx41-runtime-context{grid-column:1 / -1!important;grid-row:2!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;overflow-x:auto!important;padding-top:6px!important;border-top:1px solid #e7eef5!important;scrollbar-width:none!important}
  body.rx-v32 .rx41-runtime-context::-webkit-scrollbar,
  body.rx-v36 .rx41-runtime-context::-webkit-scrollbar{display:none!important}
  body.rx-v32 .rx41-topbar-actions,
  body.rx-v36 .rx41-topbar-actions{grid-column:2!important;grid-row:1!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;min-width:0!important;flex-wrap:wrap!important}
  body.rx-v32 .rx41-desktop-module-switch,
  body.rx-v36 .rx41-desktop-module-switch{min-width:170px!important}
  body.rx-v32 .rx41-desktop-module-switch > a,
  body.rx-v36 .rx41-desktop-module-switch > a{font-size:10px!important;padding:0 8px!important;min-height:32px!important}
  body.rx-v32 .rx-topbar-quick,
  body.rx-v36 .rx-topbar-quick{min-height:34px!important;padding:0 10px!important;font-size:10px!important}
  body.rx-v32 .rx-user-copy,
  body.rx-v36 .rx-user-copy{max-width:110px!important}
}

@media (min-width:900px) and (max-width:1080px){
  body.rx-v32 .rx41-quick-actions,
  body.rx-v36 .rx41-quick-actions{display:none!important}
  body.rx-v32 .rx-user-copy,
  body.rx-v36 .rx-user-copy{display:none!important}
  body.rx-v32 .rx-user-button,
  body.rx-v36 .rx-user-button{padding-right:6px!important}
}

/* Intermediate-width transaction contract.
   1280px+ keeps the approved workstation layout; <=899px keeps the touch/wizard
   layout. The 900–1279px range is fluid and must never inherit hard desktop
   minimum widths that clip Sale / Wholesale / Purchase content. */
@media (min-width:900px) and (max-width:1279px){
  html,body{max-width:100%;overflow-x:hidden!important}
  body.rx-transaction-page .rx-billing-app,
  body.rx-transaction-page .rx-billing-stage,
  body.rx-transaction-page .rx-billing-stage-main,
  body.rx-transaction-page .rx-billing-content,
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp,#billingManageApp){
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.rx-transaction-page .rx-billing-content{padding:3px!important;overflow-x:hidden!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-header,.rx-legacy-pc-entry){
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-field,.rx-r38-search,.rx44-batch-cell),
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(label,input,select,textarea,button){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}

  /* Keep the title/interface lane inside the current viewport. */
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu{
    width:100%!important;min-width:0!important;max-width:100%!important;
    grid-template-columns:minmax(118px,1fr) auto!important;
    grid-template-areas:"title interface"!important;
    gap:4px!important;padding:3px 6px!important;overflow:hidden!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-f4-instruction{display:none!important}
  body.rx-transaction-page .rx-billing-mode-switch{position:static!important;inset:auto!important;justify-self:end!important;max-width:100%!important}
  body.rx-transaction-page .rx-billing-mode-switch>span{display:none!important}
  body.rx-transaction-page .rx-billing-mode-switch>button{min-height:26px!important;height:26px!important;padding-inline:5px!important}

  /* Readable compact controls without one-pixel/half-clipped rows. */
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-header,.rx-legacy-pc-entry) label>span,
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-header,.rx-legacy-pc-entry) .rx-field>span{
    display:block!important;min-height:10px!important;margin:0 0 2px!important;
    font-size:clamp(7px,.68vw,8.5px)!important;line-height:1.1!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-header,.rx-legacy-pc-entry) :is(input,select,textarea){
    width:100%!important;height:28px!important;min-height:28px!important;
    padding:3px 5px!important;font-size:clamp(8.5px,.78vw,10px)!important;line-height:1.1!important;
  }

  /* Retail stays visually identical, but all tracks are fluid. */
  body.rx-transaction-page #retailApp .rx-retail-document-grid{
    grid-template-columns:minmax(120px,1.45fr) minmax(70px,.78fr) minmax(52px,.48fr) minmax(66px,.65fr) minmax(170px,2.55fr)!important;
    gap:3px 4px!important;
  }
  body.rx-transaction-page #retailApp .rx-retail-entry-grid{
    grid-template-columns:.55fr 2.45fr .86fr .74fr .74fr .62fr .58fr .48fr .62fr .62fr .84fr .52fr .82fr .68fr!important;
    gap:3px!important;
  }

  /* Override legacy fixed-pixel wholesale tracks loaded earlier. */
  body.rx-transaction-page #wholesaleApp .rx-r24-wholesale-document-grid{
    min-width:0!important;
    grid-template-columns:.62fr 1.28fr .72fr .82fr .86fr 2.18fr .68fr .92fr .52fr 1.08fr!important;
    grid-template-areas:
      "mode bill date orderno orderdate buyer oldbal salesman discount gstin"
      "address address dl dl creditlimit creditdays currentdue loss loss loss"!important;
    gap:3px!important;
  }
  body.rx-transaction-page #wholesaleApp .rx-wholesale-entry-grid{
    min-width:0!important;
    grid-template-columns:2.9fr .8fr .8fr .68fr .62fr .52fr .64fr .64fr .8fr .58fr .64fr .96fr!important;
    gap:3px!important;
  }

  /* Purchase keeps all fields in the canvas with fractional tracks. */
  body.rx-transaction-page #purchaseApp .rx-purchase-document-grid{
    min-width:0!important;
    grid-template-columns:.72fr 1.65fr 1.28fr 1.1fr .6fr .68fr 1fr .78fr .78fr!important;
    grid-template-areas:
      "entryno supplier address gstin pan type invoiceno invoicedate receiveddate"
      ". . . . . orderno orderdate netinvoice discount"!important;
    gap:3px!important;
  }
  body.rx-transaction-page #purchaseApp .rx-purchase-entry-grid,
  body.rx-transaction-page #purchaseApp .rx-purchase-entry-grid.retail-only{
    min-width:0!important;
    grid-template-columns:2.8fr .72fr .64fr .58fr .66fr .68fr .66fr .68fr .58fr .58fr .86fr .58fr .9fr!important;
    gap:3px!important;
  }

  /* Tables belong to their own scroll/fit region, never to the page viewport. */
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-r38-table-wrap,.rx-legacy-pc-table,.rx-purchase-legacy-table){
    width:100%!important;min-width:0!important;max-width:100%!important;overflow-x:auto!important;overflow-y:auto!important;overscroll-behavior-inline:contain!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-r38-table,.rx-r20-lines-table,.rx-purchase-lines-table){
    width:100%!important;min-width:0!important;table-layout:fixed!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(th,td){min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important}

  /* Totals and actions shrink as a group instead of escaping the canvas. */
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-totals,.rx-r24-wholesale-totals,.rx-purchase-legacy-totals,.rx-r38-footer-actions){
    width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;gap:3px!important;padding-inline:4px!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) .rx-r38-footer-actions>*{min-width:0!important;padding-inline:3px!important;font-size:clamp(7px,.7vw,8.5px)!important}

  /* When OPD Live is open in this range it remains docked, but its width is
     bounded so the billing canvas still receives the majority of the viewport. */
  body.rx-transaction-page.rx-opd-panel-open .rx-billing-stage{
    grid-template-columns:minmax(0,1fr) clamp(248px,24vw,300px)!important;
    gap:5px!important;
  }
  body.rx-transaction-page.rx-opd-panel-open .rx-billing-stage-main{min-width:0!important;overflow:hidden!important}
}

/* 900–1099px: controlled reflow. This is still desktop/tablet workstation UI,
   not the phone wizard. More rows are preferable to clipped controls. */
@media (min-width:900px) and (max-width:1099px){
  body.rx-transaction-page #retailApp .rx-retail-document-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-areas:
      "bill date member card"
      "reference reference reference reference"
      "customer mobile address gstin"!important;
  }
  body.rx-transaction-page #retailApp .rx-retail-entry-grid{
    grid-template-columns:repeat(7,minmax(0,1fr))!important;grid-auto-flow:row!important;
  }
  body.rx-transaction-page #retailApp .rx-retail-entry-grid .rx-product-search{grid-column:span 2!important}
  body.rx-transaction-page #retailApp .rx-retail-entry-grid .rx-rate-field{grid-column:span 2!important}

  body.rx-transaction-page #wholesaleApp .rx-r24-wholesale-document-grid{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-areas:
      "mode bill date orderno orderdate buyer"
      "address address dl creditlimit creditdays oldbal"
      "salesman discount gstin currentdue loss loss"!important;
  }
  body.rx-transaction-page #wholesaleApp .rx-wholesale-entry-grid{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;grid-auto-flow:row!important;
  }
  body.rx-transaction-page #wholesaleApp .rx-wholesale-entry-grid .rx-product-search{grid-column:span 2!important}

  body.rx-transaction-page #purchaseApp .rx-purchase-document-grid{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-areas:
      "entryno supplier supplier address gstin pan"
      "type invoiceno invoicedate receiveddate orderno orderdate"
      ". . netinvoice discount discount discount"!important;
  }
  body.rx-transaction-page #purchaseApp .rx-purchase-entry-grid,
  body.rx-transaction-page #purchaseApp .rx-purchase-entry-grid.retail-only{
    grid-template-columns:repeat(7,minmax(0,1fr))!important;grid-auto-flow:row!important;
  }
  body.rx-transaction-page #purchaseApp .rx-purchase-entry-grid .rx-purchase-product-search{grid-column:span 2!important}
  body.rx-transaction-page #purchaseApp .rx-purchase-entry-grid .rx-scheme-field{grid-column:span 2!important}

  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-header,.rx-legacy-pc-entry){padding:4px 5px!important;gap:3px 4px!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(.rx-legacy-pc-header,.rx-legacy-pc-entry) :is(input,select,textarea){height:27px!important;min-height:27px!important}

  body.rx-transaction-page.rx-opd-panel-open .rx-billing-stage{
    grid-template-columns:minmax(0,1fr) clamp(230px,23vw,270px)!important;
  }
}

/* Generic Billing screens: cards stay within the content lane; wide data tables
   scroll inside their own region rather than forcing a whole-page breakpoint. */
@media (min-width:768px) and (max-width:1279px){
  body.rx-authenticated .rx-content,
  body.rx-authenticated .rx-billing-content{min-width:0!important;max-width:100%!important}
  body.rx-authenticated :is(.rx-card,.rx-panel,.rx-data-panel,.rx-table-wrap,.rx-r38-table-wrap){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  body.rx-authenticated :is(.rx-table-wrap,.rx-r38-table-wrap){overflow-x:auto!important;overscroll-behavior-inline:contain!important}
}

/* RXOPD Billing line-item viewport repair.
   Retail / Wholesale / Purchase keep all entered medicines reachable when the
   workstation viewport is short or narrow. This is presentation-only. */
body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
  .rx-r38-table-wrap,
  .rx-legacy-pc-table,
  .rx-purchase-legacy-table
){
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  min-height:120px!important;
  max-height:clamp(180px,38dvh,430px)!important;
  overflow-x:auto!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
  scrollbar-gutter:stable both-edges;
  scrollbar-width:thin;
  touch-action:pan-x pan-y!important;
}
body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
  .rx-r38-table-wrap,
  .rx-legacy-pc-table,
  .rx-purchase-legacy-table
)::-webkit-scrollbar{width:10px;height:10px}
body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
  .rx-r38-table-wrap,
  .rx-legacy-pc-table,
  .rx-purchase-legacy-table
)::-webkit-scrollbar-thumb{background:#9fb3c8;border:2px solid #eef4f8;border-radius:999px}
body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
  .rx-r38-table-wrap,
  .rx-legacy-pc-table,
  .rx-purchase-legacy-table
)::-webkit-scrollbar-track{background:#eef4f8}

/* Keep column labels visible while scrolling through long bills. */
body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) .rx-r38-table thead th{
  position:sticky!important;
  top:0!important;
  z-index:6!important;
}

/* Short screens need an internal list sooner because totals/actions occupy a
   fixed part of the viewport. */
@media (max-height:760px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
    .rx-r38-table-wrap,
    .rx-legacy-pc-table,
    .rx-purchase-legacy-table
  ){
    max-height:clamp(150px,31dvh,300px)!important;
  }
}

/* Mobile/card mode remains card-based, but the cards scroll inside one bounded
   region instead of disappearing underneath the fixed action/status bars. */
@media (max-width:899px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
    .rx-r38-table-wrap,
    .rx-legacy-pc-table,
    .rx-purchase-legacy-table,
    .rx-mobile-panel-lines.rx-r38-table-wrap
  ){
    min-height:150px!important;
    max-height:clamp(210px,42dvh,420px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-bottom:8px!important;
  }
}

/* Intermediate split-screen/tablet workstation widths keep horizontal access
   for dense columns and vertical access for many entered medicines. */
@media (min-width:900px) and (max-width:1279px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) :is(
    .rx-r38-table-wrap,
    .rx-legacy-pc-table,
    .rx-purchase-legacy-table
  ){
    max-height:clamp(180px,34dvh,360px)!important;
    overflow:auto!important;
  }
}

/* Intermediate desktop transaction toolbar repair.
   Keep the title, interface menus and view-mode selector on one compact row
   across laptop/split-screen desktop widths. Phone/touch wizard rules below
   900px remain unchanged. */
@media (min-width:900px) and (max-width:1399px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu{
    display:grid!important;
    grid-template-columns:minmax(118px,1fr) auto auto!important;
    grid-template-rows:34px!important;
    grid-template-areas:"title interface mode"!important;
    align-items:center!important;
    column-gap:5px!important;
    row-gap:0!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:34px!important;
    height:34px!important;
    padding:0 7px!important;
    overflow:visible!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>b{
    grid-area:title!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-f4-instruction{
    display:none!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-interface-menu{
    grid-area:interface!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:stretch!important;
    justify-content:flex-end!important;
    justify-self:end!important;
    align-self:center!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:31px!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    scrollbar-width:none!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-interface-menu::-webkit-scrollbar{
    display:none!important;
  }
  body.rx-transaction-page .rx-interface-menu>div{
    flex:0 0 auto!important;
    min-width:clamp(58px,6.15vw,86px)!important;
  }
  body.rx-transaction-page .rx-interface-menu>div>button{
    height:31px!important;
    min-height:31px!important;
    padding:0 clamp(3px,.45vw,7px)!important;
    font-size:clamp(7px,.62vw,9px)!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu>.rx-billing-mode-switch{
    position:static!important;
    inset:auto!important;
    grid-area:mode!important;
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-end!important;
    justify-self:end!important;
    align-self:center!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:31px!important;
    height:31px!important;
    gap:2px!important;
    padding:2px!important;
    margin:0!important;
    box-shadow:none!important;
    z-index:3!important;
  }
  body.rx-transaction-page .rx-billing-mode-switch>span{
    display:inline-flex!important;
    align-items:center!important;
    padding:0 3px!important;
    font-size:clamp(6px,.52vw,7px)!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.rx-transaction-page .rx-billing-mode-switch>button{
    min-height:27px!important;
    height:27px!important;
    padding:2px clamp(4px,.42vw,6px)!important;
    font-size:clamp(6px,.52vw,7px)!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
}

/* Very narrow workstation widths still stay on one row, but compress the
   non-essential label before allowing the transaction toolbar to wrap. */
@media (min-width:900px) and (max-width:1039px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp)>.rx-legacy-menu{
    grid-template-columns:minmax(96px,1fr) auto auto!important;
    column-gap:3px!important;
    padding-inline:5px!important;
  }
  body.rx-transaction-page .rx-interface-menu>div{
    min-width:55px!important;
  }
  body.rx-transaction-page .rx-interface-menu>div>button{
    padding-inline:3px!important;
    font-size:6.8px!important;
  }
  body.rx-transaction-page .rx-billing-mode-switch>span{
    font-size:5.8px!important;
    padding-inline:2px!important;
  }
  body.rx-transaction-page .rx-billing-mode-switch>button{
    padding-inline:3px!important;
    font-size:5.8px!important;
  }
}

/* Final legacy Billing line-item viewport authority.
   The EXISTING ENTRIES wrapper is the scroll viewport itself on desktop/laptop.
   This works with the legacy grid row instead of relying only on max-height. */
@media (min-width:900px){
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) > :is(
    .rx-r38-table-wrap.rx-legacy-pc-table,
    .rx-r38-table-wrap.rx-purchase-legacy-table
  ){
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    max-height:100%!important;
    overflow-x:auto!important;
    overflow-y:scroll!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-gutter:stable!important;
    scrollbar-width:auto!important;
    touch-action:pan-x pan-y!important;
  }
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) > :is(
    .rx-r38-table-wrap.rx-legacy-pc-table,
    .rx-r38-table-wrap.rx-purchase-legacy-table
  )::-webkit-scrollbar{width:12px!important;height:10px!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) > :is(
    .rx-r38-table-wrap.rx-legacy-pc-table,
    .rx-r38-table-wrap.rx-purchase-legacy-table
  )::-webkit-scrollbar-thumb{background:#7892aa!important;border:2px solid #eef4f8!important;border-radius:999px!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) > :is(
    .rx-r38-table-wrap.rx-legacy-pc-table,
    .rx-r38-table-wrap.rx-purchase-legacy-table
  )::-webkit-scrollbar-track{background:#e8f0f5!important}
  body.rx-transaction-page :is(#retailApp,#wholesaleApp,#purchaseApp) > .rx-r38-table-wrap .rx-r38-table thead th{
    position:sticky!important;top:0!important;z-index:8!important;
    box-shadow:0 1px 0 #8da6b7!important;
  }
}


@media screen and (max-width:899px){
 html.rx-billing-touch-mode body.rx-legacy-final #wholesaleApp .rx-r24-wholesale-document-grid{min-width:0!important;width:100%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:none!important;grid-template-areas:none!important;height:auto!important;gap:8px!important}
 html.rx-billing-touch-mode body.rx-legacy-final #wholesaleApp .rx-r24-wholesale-document-grid>*{grid-area:auto!important;min-width:0!important;width:100%!important;max-width:100%!important;height:auto!important}
 html.rx-billing-touch-mode body.rx-legacy-final #wholesaleApp .rx-r24-wholesale-document-grid :is(input,select){min-width:0!important;max-width:100%!important}
 html body .rx-mobile-wizard-alert{font-size:14px!important;line-height:1.45!important}
}
