/* v3.66.2 Device Pages & Menus. Layout only: no behavior, data or permission changes.
   Loaded last (inc/layout.php) so it is the single home for these shell repairs.
   Customer View / present-mode stay isolated through :not(.present-mode).
   Header-search anchoring lives in ux032.css (C6); the old D1 rule here was removed in the merge.
   The phantom tab-bar offset (old D2) is gone at its source with the tab-bar retirement (P4). */

/* P5 (was D3). Phone account cluster is one button: More. Profile and Sign out stay in the
   More sheet's "You" group (inc/layout.php more_sheet_html). Also fixes the 320-360px overflow. */
@media(max-width:767px){
 body.bt-shell:not(.present-mode) .bt-universal-header :is(.acct-profile,.acct-signout){display:none}
 body.bt-shell:not(.present-mode) .bt-universal-header .acct-cluster{padding-right:6px}
}

/* D4. View-as preview banner (inline z-index:2000, inc/layout.php:268) covered the phone menu
   drawer (z 400), its Hide sidebar button, the More sheet (z 600) and Command Center modals (z 1300). */
[data-portal-preview-banner]{z-index:390!important}
/* In standalone mode the banner already takes the status-bar clearance (ux032.css:162);
   the header below it must not add a second, empty clearance band. */
html.bt-standalone body.bt-shell:not(.present-mode):has([data-portal-preview-banner]) .bt-universal-header{padding-top:0}

/* D5. Command Center (admin/index.php) full bleed. command-center.css:4 sets main.wrap padding:0,
   but guided-flow.css:21/142 override it with !important, framing the navy hero in a white strip. */
body.bt-shell.od-command-mockup:not(.present-mode) main.wrap{padding:0!important}
body.bt-shell.od-command-mockup:not(.present-mode) main.wrap>:is(.flash,.pay-alert,.page-return){margin:12px 16px!important}

/* D6. Command Center touch targets below 44px (command-center.css:29,33,63,142,145,156). */
body.bt-shell.od-command-mockup .cc-r01 :is(.cc-shortcuts a,.cc-new-job,.cc-small-action,.cc-related a,.cc-modal-actions a){min-height:44px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}
body.bt-shell.od-command-mockup .cc-r01 .cc-modal-close{width:44px;height:44px;right:10px;top:8px}
body.bt-shell.od-command-mockup .cc-r01 .cc-modal :is(h2,.cc-modal-eyebrow){margin-right:52px}

/* P2. One header on the phone Command Center. The hero's brand row repeated the portal header's
   logo and name; on phones it is dropped and + New Job / clock move into the greeting row.
   Every control stays (admin/index.php:114-122 markup unchanged). */
@media(max-width:767px){
 body.bt-shell.od-command-mockup .cc-r01 .cc-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"greet actions" "short short";gap:10px 12px;padding:13px 15px 15px}
 body.bt-shell.od-command-mockup .cc-r01 :is(.cc-hero-top,.cc-welcome){display:contents}
 body.bt-shell.od-command-mockup .cc-r01 .cc-brand{display:none}
 body.bt-shell.od-command-mockup .cc-r01 .cc-welcome>div{grid-area:greet;min-width:0;align-self:center}
 body.bt-shell.od-command-mockup .cc-r01 .cc-hero-actions{grid-area:actions;flex-direction:column;align-items:flex-end;gap:6px}
 body.bt-shell.od-command-mockup .cc-r01 .cc-shortcuts{grid-area:short;width:auto}
}

/* M1 (Muse, revised by Claude). Collapsed rail, now from 1024px landscape (P1):
   - needs-reply badge becomes a small dot on the Communications icon (signal kept, no pill);
   - stale-sync dot hidden (status card / open rail still show it);
   - brand reduced to its centred mark (podium-design.css:8-10 forced a 104px left-aligned block). */
@media(min-width:1024px) and (orientation:landscape){
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .sidenav-link{position:relative}
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .sidenav-link .p1-nav-badge{display:block!important;position:absolute;top:9px;right:9px;width:9px;height:9px;padding:0;margin:0;font-size:0;border:2px solid #1e3a5f;box-sizing:content-box}
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .p1-stale-dot{display:none!important}
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .sidenav-brand.p1-sidebar-brand{min-height:64px!important;align-items:center!important;padding:10px 0!important}
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .p1-sidebar-brand>span{font-size:0;gap:0}
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .p1-sidebar-brand small{display:none!important}
}

/* M2 (Muse) · Issue pill over the Communications composer: same static-flow treatment
   the estimate builder uses (ux032.css :has(#eb)). On thread pages the pill
   leaves the overlay and sits in flow below the content instead of floating
   over the reply textarea. */
body.bt-shell:not(.present-mode):has(.p1-composer) .issue-fab:not(.is-away){
  position:static;inset:auto;display:flex;min-height:44px;width:max-content;max-width:calc(100% - 32px);
  margin:12px 16px calc(24px + env(safe-area-inset-bottom,0px));
}

/* === v3.66.3 · Sidebar rail completeness + invisible menu scrollbar =======
   R1 · Two sidenav children never got a collapsed-rail treatment: the Podium
   connection card (inc/layout.php:155) and the admin finder link
   (inc/layout.php:125). Both rendered at natural width inside the 66px rail
   and were clipped into vertical text (Dustin's screenshot, Oct 18). Hide
   both in the rail; both remain available in the expanded sidebar. */
@media(min-width:1024px) and (orientation:landscape){
  html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .p1-connection-card,
  html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .r02-finder-link{display:none!important}
}
/* R2 · The menu list (.sidenav-links, guided-flow.css:30) scrolls without a
   visible scrollbar, in both sidebar states. Scroll behavior is unchanged. */
body.bt-shell:not(.present-mode) .sidenav-links{scrollbar-width:none;-ms-overflow-style:none}
body.bt-shell:not(.present-mode) .sidenav-links::-webkit-scrollbar{display:none;width:0;height:0}

/* v3.69.1: collapsed rail retains only the large brand mark. */
@media(min-width:1024px) and (orientation:landscape){
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .p1-sidebar-brand .bt-side-lockup{display:none!important}
 html:not(.bt-sidebar-open) body.bt-shell:not(.present-mode) .p1-sidebar-brand .bt-side-logo{display:block;width:40px;height:40px;flex:0 0 40px}
}
