/* STEP465 UI fixes (CSS-only). Loaded after every other stylesheet; no JS or data changes.
   QA findings: #3 phone overlaps, #4 occluded legacy controls, #5 funding banner covering content. */

/* ---- #3a: the sticky phone-mode bar (z-index 1000) covered the first row of the fixed
   page shell. Same technique the Recycle shell already uses (STEP437): reserve the bar's height. */
#main-app:has(>#lotdesk-phone-mode) #lotdesk-phone-mode{min-height:65px;box-sizing:border-box}
#main-app:has(>#lotdesk-phone-mode) .ld166-shell:not(.ld437-recycle-shell){top:65px}

/* ---- #3b: SCAN VIN and the reminder bell were both pinned to right:17px/bottom:18px (right:10/bottom:11 on
   phones), so the bell sat on top of the SCAN VIN button. Shift SCAN VIN left of the 58px bell. */
html body #vehicle-scan-launch{right:84px;bottom:calc(18px + env(safe-area-inset-bottom))}
html body.lotdesk-phone-inventory-mode #vehicle-scan-launch{right:78px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important}
@media(max-width:600px){html body #vehicle-scan-launch{right:78px;bottom:calc(11px + env(safe-area-inset-bottom))}}

/* ---- #3c/#5: floating controls (bell, SCAN VIN, funding banner) must never hide the last rows of a page.
   Reserve scroll space at the end of every shell page; more while the banner is showing. */
@media screen{html body #main-app .ld166-shell .ld166-page{padding-bottom:96px!important}}
@media screen{html body:has(#ld457-banner:not(.ld459-modal-suppressed)) #main-app .ld166-shell .ld166-page{padding-bottom:124px!important}}
body:has(#ld457-banner:not(.ld459-modal-suppressed)) #content:not(:has(.ld166-shell)){padding-bottom:124px}

/* ---- #5: compact the Dynamic Funding reminder strip (was 112px desktop / 146px tablet / 238px phone tall). */
html body .ld457-banner{bottom:14px;width:min(1040px,calc(100vw - 180px));padding:8px 16px;gap:6px 12px;border-radius:10px;flex-wrap:wrap}
html body .ld457-banner .ld457-banner-icon{width:30px;height:30px;font-size:19px;flex:none}
html body .ld457-banner .ld457-banner-copy{gap:2px;min-width:150px}
html body .ld457-banner .ld457-banner-copy strong{font-size:13px}
html body .ld457-banner small{font-size:11px;line-height:1.25}
html body .ld457-banner .ld457-banner-total{font-size:22px;line-height:1.1;white-space:nowrap}
html body .ld457-banner button{padding:7px 10px}
html body .ld457-banner .ld457-banner-actions button{padding:6px 8px}
@media(min-width:1200px){html body .ld457-banner{flex-wrap:nowrap}}
/* Below 900px the SCAN VIN button is visible, so the strip sits above that button row. */
@media screen and (max-width:899px){
 html body .ld457-banner{bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100vw - 20px);padding:8px 10px;gap:6px 8px}
 html body .ld457-banner .ld457-banner-icon{display:none}
 html body .ld457-banner .ld457-banner-copy{flex:1 1 0;min-width:0;flex-basis:0}
 html body .ld457-banner .ld457-banner-copy small{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
 html body .ld457-banner .ld457-banner-total{font-size:18px}
 html body .ld457-banner button{font-size:11px;padding:7px 8px}
 html body .ld457-banner .ld457-banner-actions{flex:1 1 auto}
 html body .ld457-banner .ld457-banner-actions button{font-size:10px;padding:6px 7px}
 html body:has(#ld457-banner:not(.ld459-modal-suppressed)) #main-app .ld166-shell .ld166-page{padding-bottom:196px!important}
}
@media screen and (max-width:899px){html body #main-app .ld166-shell .ld166-page{padding-bottom:96px!important}}
@media screen and (max-width:599px){html body .ld457-banner .ld457-banner-copy small{display:none}html body:has(#ld457-banner:not(.ld459-modal-suppressed)) #main-app .ld166-shell .ld166-page{padding-bottom:224px!important}}

/* ---- #4: the legacy sidebar and top bar (#logout-btn, #new-stock-top, ...) stay in the DOM underneath the
   full-screen page shell. They were invisible but still focusable and announced, and the shell's command bar
   sat on top of them. While a shell page is showing, take them out of hit-testing, tab order and the
   accessibility tree. Scripts can still call .click() on them (the command bar's Add Vehicle does). */
body:has(#content .ld166-shell) #main-app>aside.sidebar,
body:has(#content .ld166-shell) #main-app>main.main>header.topbar{visibility:hidden}
