/* B chrome only. Both themes resolve through the approved --ub-* tokens. */
body[data-ui="b"] { --shell-b-header-h:56px; --shell-b-header-bottom:calc(var(--shell-envbar-h,0px) + var(--shell-b-header-h)); --shell-b-areas-width:180px; --shell-b-panel-width:240px; --shell-b-width:var(--shell-b-areas-width); background:var(--ub-bg); color:var(--ub-text); }
body[data-ui="b"].shell-b-rail { --shell-b-areas-width:64px; --shell-b-width:64px; }
[data-ui="b"] .sb, [data-ui="b"] .topbar, [data-ui="b"] #site-hdr, [data-ui="b"] #portal-hdr, [data-ui="b"] .branch-crumb { display:none; }
/* Show details retains the existing handler and fields, without repeating identity/actions. */
[data-ui="b"] #site-hdr:has(.sc-fields), [data-ui="b"] #portal-hdr:has(.sc-fields) { display:block; background:var(--ub-surface-raised); border-color:var(--ub-border); }
[data-ui="b"] #site-hdr .sc-top, [data-ui="b"] #portal-hdr .sc-top { display:none; }
[data-ui="b"] :is(#site-hdr,#portal-hdr):has(.sc-fields) .sc-top { display:block; }
[data-ui="b"] :is(#site-hdr,#portal-hdr) .sc-top :is(.sc-name), [data-ui="b"] :is(#site-hdr,#portal-hdr) .sc-top > div:last-child, [data-ui="b"] :is(#site-hdr,#portal-hdr) .sc-meta > span:first-child { display:none; }
[data-ui="b"] :is(#site-hdr,#portal-hdr) .sc-addr { color:var(--ub-text-secondary); font:var(--ub-fs-body) var(--ub-font-sans); }
[data-ui="b"] :is(#site-hdr,#portal-hdr) .sc-meta .bx { background:var(--ub-surface); border-color:var(--ub-border); color:var(--ub-text-secondary); }
[data-ui="b"] #main-area, [data-ui="b"] #main-area.sb-collapsed { margin-left:var(--shell-b-width); transition:none; }
[data-ui="b"] #shell-b-sidebar { position:fixed; inset:var(--shell-envbar-h,0px) auto 0 0; width:var(--shell-b-areas-width); z-index:150; display:flex; flex-direction:column; background:var(--ub-surface); border-right:1px solid var(--ub-border); font:var(--ub-fs-body) var(--ub-font-sans); color:var(--ub-text-secondary); }
[data-ui="b"] .sb-b-brand { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:56px; flex:none; padding:6px 12px; box-sizing:border-box; }
[data-ui="b"] .sb-b-logo { display:flex; flex-direction:column; align-items:flex-start; gap:4px; min-width:0; background:none; border:0; padding:4px; margin:0; color:inherit; cursor:pointer; border-radius:var(--ub-radius-sm); text-align:left; }
[data-ui="b"] .sb-b-logo:focus-visible { outline:2px solid var(--ub-focus-ring); outline-offset:2px; }
[data-ui="b"] .sb-b-logo .brand-lockup { gap:9px; }
[data-ui="b"] .sb-b-logo .brand-text { font-size:14px; letter-spacing:3px; color:var(--ub-text); }
[data-ui="b"] .sb-b-logo .brand-tm { font-size:9px; }
[data-ui="b"] .sb-b-button { display:inline-flex; align-items:center; justify-content:space-between; gap:8px; min-height:max(var(--ub-control-h),var(--ub-target-min)); padding:4px 8px; border:0; border-radius:var(--ub-radius-sm); background:transparent; color:var(--ub-text-secondary); font:var(--ub-fs-body) var(--ub-font-sans); text-align:left; cursor:pointer; box-sizing:border-box; }
[data-ui="b"] .sb-b-button:hover { background:var(--ub-surface-hover); color:var(--ub-text); }
[data-ui="b"] .sb-b-scroll { flex:1; min-height:0; overflow:auto; padding:4px 8px; }
[data-ui="b"] .sb-b-heading { padding:8px; margin:0; font:500 var(--ub-fs-label) var(--ub-font-sans); color:var(--ub-text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-ui="b"] #shell-b-sidebar .ni { position:relative; min-height:max(var(--ub-control-h),var(--ub-target-min)); display:flex; align-items:center; width:100%; gap:8px; margin:0; padding:4px 8px; border:0; border-radius:var(--ub-radius-sm); background:transparent; color:var(--ub-text-secondary); font:var(--ub-fs-body) var(--ub-font-sans); text-align:left; cursor:pointer; }
[data-ui="b"] #shell-b-sidebar .ni:hover { background:var(--ub-surface-hover); color:var(--ub-text); }
[data-ui="b"] #shell-b-sidebar .ni::before { display:none; }
[data-ui="b"] #shell-b-sidebar .ni-ic { display:flex; width:24px; flex:none; justify-content:center; align-items:center; color:inherit; }
[data-ui="b"] #shell-b-sidebar .ni-lbl { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-ui="b"] .sb-b-empty { padding:8px; color:var(--ub-text-muted); font-size:var(--ub-fs-label); }
[data-ui="b"] #shell-b-sidebar .sfoot { border-color:var(--ub-border); padding:8px 12px; }
[data-ui="b"] #shell-b-tenant { padding:0 8px; }
[data-ui="b"] #shell-b-sidebar .tsw { width:100%; background:var(--ub-surface-raised); border-color:var(--ub-border); color:var(--ub-text-secondary); min-height:max(var(--ub-control-h),var(--ub-target-min)); }
[data-ui="b"] #shell-b-sidebar .tsw-name, [data-ui="b"] #shell-b-sidebar .su-name { color:var(--ub-text); }
[data-ui="b"] #shell-b-sidebar .su-email, [data-ui="b"] #shell-b-sidebar .tsw-lbl { color:var(--ub-text-muted); }
[data-ui="b"] #shell-b-context { position:sticky; top:var(--shell-envbar-h,0px); z-index:110; background:var(--ub-surface); border-bottom:1px solid var(--ub-border); padding:5px 16px; height:var(--shell-b-header-h); box-sizing:border-box; }
[data-ui="b"] .sb-b-context-row { display:flex; align-items:center; gap:8px; min-width:0; height:44px; flex-wrap:nowrap; }
[data-ui="b"] .sb-b-identity { flex:1; min-width:0; }
[data-ui="b"] #shell-b-crumbs { display:flex; align-items:center; gap:4px; min-width:0; white-space:nowrap; font-size:var(--ub-fs-body); }
[data-ui="b"] #shell-b-crumbs > .sb-b-button, [data-ui="b"] #shell-b-crumbs > span:not([aria-hidden]), [data-ui="b"] .sb-b-customers { min-width:0; max-width:240px; }
[data-ui="b"] #shell-b-crumbs > span:not([aria-hidden]) { overflow:hidden; text-overflow:ellipsis; }
[data-ui="b"] #shell-b-crumbs [data-ub-action="site-picker"] { height:44px; font-weight:600; }
[data-ui="b"] #shell-b-crumbs .ub-btn-label { display:block; text-overflow:ellipsis; white-space:nowrap; }
[data-ui="b"] #shell-b-meta { display:block; font:var(--ub-fs-label) var(--ub-font-sans); color:var(--ub-text-muted); font-weight:400; line-height:16px; overflow:hidden; text-overflow:ellipsis; }
[data-ui="b"] #shell-b-context .tb-title { order:-1; flex:none; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 var(--ub-fs-heading) var(--ub-font-sans); color:var(--ub-text); }
[data-ui="b"] #shell-b-context:is([data-page="site"],[data-page="portal"]) .tb-title { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
[data-ui="b"] #shell-b-context-actions { display:flex; align-items:center; gap:8px; flex:none; }
[data-ui="b"] #shell-b-context :is(.btn,.ub-btn) { font:var(--ub-fs-body) var(--ub-font-sans) !important; letter-spacing:0 !important; min-height:max(var(--ub-control-h),var(--ub-target-min)); color:var(--ub-text-secondary); background:transparent; border-color:var(--ub-border-strong); }
[data-ui="b"] #shell-b-context #btn-add { background:var(--ub-primary); color:var(--ub-on-primary); border-color:var(--ub-primary); }
[data-ui="b"] #shell-b-site-menu { flex:none; }
[data-ui="b"] #shell-b-site-menu > summary, [data-ui="b"] .sb-b-customers > summary { box-sizing:border-box; display:flex; align-items:center; min-height:max(var(--ub-control-h),var(--ub-target-min)); padding:4px 8px; border-radius:var(--ub-radius-sm); cursor:pointer; font-size:var(--ub-fs-body); color:var(--ub-text-secondary); white-space:nowrap; list-style:none; }
[data-ui="b"] #shell-b-site-menu > summary:hover, [data-ui="b"] .sb-b-customers > summary:hover { background:var(--ub-surface-hover); }
[data-ui="b"] .sb-b-customers > summary { max-width:180px; overflow:hidden; text-overflow:ellipsis; }
[data-ui="b"] .sb-b-menu { position:absolute; z-index:200; padding:8px; min-width:200px; max-width:min(360px,85vw); max-height:65vh; overflow:auto; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-md); background:var(--ub-surface-raised); color:var(--ub-text); }
[data-ui="b"] #shell-b-site-menu .sb-b-menu { right:16px; top:calc(100% - 2px); }
[data-ui="b"] .sb-b-menu .sb-b-button, [data-ui="b"] #shell-b-tools-slot :is(.btn,.ub-btn) { width:100%; justify-content:flex-start; text-align:left; white-space:normal; border:0; }
[data-ui="b"] #shell-b-tools-slot .tb-r { display:flex; flex-direction:column; align-items:stretch; gap:0; margin:0; }
[data-ui="b"] #shell-b-tools-slot #btn-cols-wrap { width:100%; }
[data-ui="b"] #shell-b-tools-slot #col-panel { position:static !important; min-width:0 !important; box-shadow:none !important; background:var(--ub-surface) !important; color:var(--ub-text); }
[data-ui="b"] #shell-b-command { width:min(600px,calc(100vw - 32px)); max-height:80vh; box-sizing:border-box; padding:16px; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-lg); background:var(--ub-surface-raised); color:var(--ub-text); font:var(--ub-fs-body) var(--ub-font-sans); }
[data-ui="b"] #shell-b-command::backdrop { background:var(--ub-bg); opacity:.75; }
[data-ui="b"] .sb-b-command-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
[data-ui="b"] .sb-b-command-head h2 { margin:0; font-size:var(--ub-fs-heading); }
[data-ui="b"] #shell-b-search-slot .srch { display:block; width:100%; }
[data-ui="b"] #shell-b-search-slot input { box-sizing:border-box; width:100%; min-height:max(var(--ub-control-h),var(--ub-target-min)); padding:8px; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); background:var(--ub-surface); color:var(--ub-text); font:var(--ub-fs-body) var(--ub-font-sans); }
[data-ui="b"] #shell-b-command-results { margin-top:8px; }
[data-ui="b"] #shell-b-command-results > .sb-b-button { width:100%; }
[data-ui="b"] #shell-b-search-box { min-width:0; }
[data-ui="b"] #shell-b-search-slot .srch { position:relative; margin:0; max-width:none; }
[data-ui="b"] #shell-b-search-slot input { padding-right:44px; height:40px; }
[data-ui="b"] #shell-b-search-slot [data-b-scan] { position:absolute; right:2px; top:2px; display:flex; align-items:center; justify-content:center; width:36px; height:36px; min-height:36px; padding:6px; border:0; }
[data-ui="b"] #shell-b-search-slot .srch > :is(svg,.srch-ic) { display:none; }
[data-ui="b"] #shell-b-search-slot .srch::before { content:none; }
[data-ui="b"] #shell-b-help { position:relative; }
[data-ui="b"] #shell-b-help > summary { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:36px; min-height:36px; cursor:pointer; list-style:none; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); color:var(--ub-text-secondary); font-size:18px; }
[data-ui="b"] #shell-b-help > summary::-webkit-details-marker { display:none; }
[data-ui="b"] #shell-b-help .sb-b-menu { right:0; top:calc(100% + 8px); }
[data-ui="b"] #shell-b-help-dialog { width:min(520px,calc(100vw - 24px)); box-sizing:border-box; padding:20px; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-md); background:var(--ub-surface); color:var(--ub-text); font:var(--ub-fs-body)/1.5 var(--ub-font-sans); }
[data-ui="b"] #shell-b-feedback { position:fixed; inset:0; margin:auto; width:min(520px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; box-sizing:border-box; padding:20px; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-md); background:var(--ub-surface); color:var(--ub-text); font:var(--ub-fs-body)/1.5 var(--ub-font-sans); }
[data-ui="b"] #shell-b-feedback::backdrop { background:var(--ub-bg); opacity:.75; }
[data-ui="b"] #shell-b-feedback textarea { display:block; box-sizing:border-box; width:100%; margin:8px 0 12px; padding:10px; resize:vertical; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); background:var(--ub-bg); color:var(--ub-text); font:inherit; }
[data-ui="b"] #shell-b-feedback button { min-height:var(--ub-target-min); padding:8px 12px; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); background:var(--ub-surface); color:var(--ub-text); font:inherit; cursor:pointer; }
[data-ui="b"] .sb-b-feedback-page { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
[data-ui="b"] #shell-b-feedback [data-feedback-error] { color:var(--ub-danger); }
@media (max-width:640px) {
  [data-ui="b"] #shell-b-context-actions > [data-feedback-entry] { display:none; }
  [data-ui="b"] #shell-b-help[open] .sb-b-menu { position:fixed; inset:auto 0 0; width:100%; box-sizing:border-box; max-height:80dvh; padding:16px 16px calc(16px + env(safe-area-inset-bottom)); overflow:auto; }
}
@media (min-width:641px) {
  [data-ui="b"] .sb-b-context-row { display:grid; grid-template-columns:minmax(160px,1fr) minmax(200px,44%) minmax(max-content,1fr); } /* actions never slide under the search box (pinned dock at 1440 hid Site ⋯) */
  [data-ui="b"] #shell-b-search-box { width:100%; max-width:480px; justify-self:center; }
  [data-ui="b"] #shell-b-context-actions { justify-self:end; gap:4px; }
  [data-ui="b"] #shell-b-context-actions > [data-ub-action="search"] { display:none; }
  [data-ui="b"] #shell-b-command { position:fixed; margin:0; z-index:200; padding:12px; overflow-y:auto; box-shadow:var(--ub-shadow-floating); }
}
@media (max-width:640px) {
  [data-ui="b"] #shell-b-search-box { display:none; }
  [data-ui="b"] #shell-b-command { position:fixed; inset:0; margin:0; width:100% !important; height:100dvh; max-width:none; max-height:none !important; padding:16px; border:0; border-radius:0; }
  [data-ui="b"] #shell-b-command #shell-b-search-slot input { min-height:48px; }
  [data-ui="b"] #shell-b-command [data-b-scan] { display:flex; width:44px; min-height:44px; height:44px; }
}
[data-ui="b"] #shell-b-lenses { display:flex; gap:4px; padding:4px 16px; background:var(--ub-surface); border-bottom:1px solid var(--ub-border); overflow-x:auto; }
[data-ui="b"] #shell-b-lenses .sb-b-button { white-space:nowrap; flex:none; }
[data-ui="b"] #shell-b-lenses .ub-chip { position:relative; }
[data-ui="b"] #shell-b-lenses [aria-pressed="true"], [data-ui="b"] #shell-b-mode [aria-pressed="true"] { color:var(--ub-text); background:var(--ub-surface-selected); font-weight:600; }
[data-ui="b"] #shell-b-strip { display:flex; align-items:center; gap:8px; padding:0 16px; min-width:0; background:var(--ub-surface); }
[data-ui="b"] #site-tabs { flex:1; min-width:0; margin:0; padding:0; border:0; min-height:var(--ub-control-h); display:flex; flex-wrap:nowrap; gap:0; overflow:visible; }
[data-ui="b"] #site-tabs .tab, [data-ui="b"] #site-tabs .disc-btn { box-sizing:border-box; display:inline-flex; align-items:center; gap:8px; flex:none; white-space:nowrap; font:var(--ub-fs-body) var(--ub-font-sans); color:var(--ub-text-secondary); min-height:max(var(--ub-control-h),var(--ub-target-min)); padding:8px 12px; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; cursor:pointer; }
[data-ui="b"] #site-tabs .tab.on, [data-ui="b"] #site-tabs .disc-btn.has-active { color:var(--ub-text); border-bottom-color:var(--ub-primary); }
[data-ui="b"] #shell-b-mode { display:flex; flex:none; gap:2px; padding:2px; border-radius:var(--ub-radius-md); background:var(--ub-surface-raised); }
[data-ui="b"] .sb-b-discipline > summary { list-style:none; }
[data-ui="b"] .sb-b-discipline .sb-b-menu .tab { display:flex; width:100%; white-space:normal; }
[data-ui="b"] .sb-b-muted { color:var(--ub-text-muted); }
[data-ui="b"] :is(#shell-b-sidebar,#shell-b-context,#shell-b-lenses,#shell-b-strip) :focus-visible { outline:var(--ub-focus-ring-w) solid var(--ub-focus-ring); outline-offset:-2px; }
body[data-ui="b"].shell-b-rail .sb-b-brand { justify-content:center; padding:6px; }
body[data-ui="b"].shell-b-rail .sb-b-scroll { padding:4px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .ni { padding:4px 8px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sfoot { padding:8px 4px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sfoot-row { flex-direction:column; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sprof > div:not(.sav) { display:none; }
body[data-ui="b"].shell-b-rail #shell-b-tenant { padding:0 4px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .tsw { justify-content:center; padding:4px; }
@media (max-width:1024px) {
  [data-ui="b"], [data-ui="b"][data-density] { --ub-target-min:44px; }
  [data-ui="b"] #shell-b-context { padding:5px 8px; }
  [data-ui="b"] #shell-b-crumbs > .sb-b-button { max-width:180px; }
  [data-ui="b"] #shell-b-sidebar :is(button,summary) { min-height:44px; }
}
@media (max-width:640px) {
  body[data-ui="b"] { --shell-b-width:64px; }
  [data-ui="b"] .sb-b-context-row, [data-ui="b"] #shell-b-context-actions { gap:2px; }
  [data-ui="b"] #shell-b-context-actions [data-ub-action="search"] { min-width:44px; }
  [data-ui="b"] #shell-b-context-actions [data-ub-action="search"] .ub-btn-label { font-size:0; }
  [data-ui="b"] #shell-b-context-actions [data-ub-action="search"] .ub-btn-label::after { content:'⌘K'; font-size:var(--ub-fs-body); }
  [data-ui="b"] #shell-b-context #btn-add { max-width:80px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  [data-ui="b"] #shell-b-crumbs > span:not(:last-child), [data-ui="b"] .sb-b-customers { display:none; }
  [data-ui="b"] #shell-b-lenses, [data-ui="b"] #shell-b-strip { padding-left:8px; padding-right:8px; }
}
[data-ui="b"] #site-tabs { overflow-x:auto; }
[data-ui="b"] .sb-b-discipline .sb-b-menu { position:fixed; min-width:224px; }
[data-ui="b"] #shell-b-crumbs [data-ub-action="site-picker"] { line-height:16px; }
@media (max-width:1024px) {
  [data-ui="b"] #shell-b-sidebar button { min-width:44px; }
}
/* Collapsed rail: all controls share the x=32px axis and one row pitch. */
[data-ui="b"] .sb-b-icon { display:block; width:16px; height:16px; flex:none; }
body[data-ui="b"].shell-b-rail .sb-b-icon { width:18px; height:18px; }
[data-ui="b"] .sb-b-footer-icon { display:none; }
body[data-ui="b"] :is(#shell-b-sidebar,#shell-b-account) :is(.theme-btn,.slo) { color:var(--ub-text-secondary) !important; }
[data-ui="b"] #shell-b-sidebar .ni-bdg, [data-ui="b"] #shell-b-rail-flyout .ni-bdg { background:var(--ub-error); color:var(--ub-on-danger); box-shadow:none; }
[data-ui="b"] #shell-b-sidebar .ni-bdg-warning { background:var(--ub-warning); }
[data-ui="b"] #shell-b-sidebar .ni-bdg-info { background:var(--ub-info); }
body[data-ui="b"].shell-b-rail { --sb-b-rail-pitch:40px; }
body[data-ui="b"].shell-b-rail .sb-b-scroll { padding:0 6px; scrollbar-width:none; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar :is(.ni,summary) > .ni-bdg { display:block; position:absolute; top:calc(50% - 12px); right:9px; width:6px; min-width:6px; height:6px; padding:0; margin:0; overflow:hidden; font-size:0; border-radius:var(--ub-radius-full); }
body[data-ui="b"].shell-b-rail .sb-b-brand { justify-content:center; padding:0 6px; }
body[data-ui="b"].shell-b-rail .sb-b-logo { align-items:center; justify-content:center; width:44px; padding:0; }
body[data-ui="b"].shell-b-rail .sb-b-logo .brand-lockup { gap:0; }
body[data-ui="b"].shell-b-rail #shell-b-tenant { padding:0 6px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sfoot { padding:0 6px; gap:0; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sfoot-row { align-items:center; gap:0; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar :is(.sav,.tsw-ic) { display:none; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar :is(.theme-btn,.slo) { font-size:0 !important; padding:0 !important; color:var(--ub-text-secondary) !important; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar :is(.theme-btn,.slo):hover { color:var(--ub-text) !important; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sb-b-footer-icon { display:flex; }
[data-ui="b"] #shell-b-rail-flyout {
  position:fixed; z-index:201; box-sizing:border-box; padding:8px; min-width:120px; max-width:calc(100vw - 72px);
  max-height:calc(100vh - 16px); overflow:auto; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-md);
  background:var(--ub-surface-raised); color:var(--ub-text); font:var(--ub-fs-body)/1.5 var(--ub-font-sans);
  box-shadow:var(--ub-shadow-floating);
}
[data-ui="b"] #shell-b-rail-flyout[hidden] { display:none; }
[data-ui="b"] #shell-b-rail-flyout[role="menu"] { width:240px; }
[data-ui="b"] .sb-b-flyout-title { padding:4px 8px 8px; color:var(--ub-text-muted); font-size:var(--ub-fs-label); border-bottom:1px solid var(--ub-border); }
[data-ui="b"] #shell-b-rail-flyout .sb-b-flyout-row { display:flex; flex-direction:row-reverse; justify-content:flex-end; width:100%; gap:8px; min-height:max(40px,var(--ub-target-min)); }
[data-ui="b"] #shell-b-rail-flyout [aria-current="page"] { color:var(--ub-text); background:var(--ub-surface-selected); }
@media (pointer:coarse) { body[data-ui="b"].shell-b-rail { --sb-b-rail-pitch:44px; } }
/* Adopted site-wide controls retain their original handlers and visibility gates. */
[data-ui="b"] .sb-b-admin-tabs { justify-content:flex-start; }
[data-ui="b"] .sb-b-admin-tabs [aria-current="page"] { background:var(--ub-surface-selected); color:var(--ub-text); }
[data-ui="b"] .sb-b-menu .sb-b-heading { font:500 var(--ub-fs-label) var(--ub-font-sans); color:var(--ub-text-muted); padding:8px 8px 2px; pointer-events:none; }
[data-ui="b"] .sb-b-menu .sb-b-heading ~ .sb-b-heading { margin-top:6px; border-top:1px solid var(--ub-border); padding-top:10px; }

/* Token bridge (JP 2026-10-31: "the colours are now off"). While B is mounted, the classic page content
   (tables, cards, chips, buttons) keeps its markup but reads its CSS variables from the Ledger tokens, so
   shell and content share one palette. Content screens migrate to B components lens by lens; until then
   this keeps them visually consistent. Hard-coded hex in classic content is not covered (tracked separately). */
body[data-ui="b"] {
  --bg: var(--ub-bg); --s1: var(--ub-surface); --s2: var(--ub-surface-raised); --s3: var(--ub-surface-hover);
  --s4: var(--ub-surface-selected);
  --b0: color-mix(in srgb, var(--ub-border) 70%, var(--ub-surface)); --b1: var(--ub-border);
  --b2: color-mix(in srgb, var(--ub-border) 50%, var(--ub-border-strong)); --b3: var(--ub-border-strong);
  --t0: var(--ub-text); --t1: var(--ub-text-secondary); --t2: var(--ub-text-muted); --t3: var(--ub-text-muted);
  --t4: var(--ub-text-disabled);
  --g: var(--ub-primary);
  --gd: color-mix(in srgb, var(--ub-primary) 8%, transparent);
  --g2: color-mix(in srgb, var(--ub-primary) 16%, transparent);
  --g3: color-mix(in srgb, var(--ub-primary) 30%, transparent);
  --c: var(--ub-accent); --cd: color-mix(in srgb, var(--ub-accent) 9%, transparent);
  --o: var(--ub-warning); --od: color-mix(in srgb, var(--ub-warning) 9%, transparent);
  --r: var(--ub-error); --rd: color-mix(in srgb, var(--ub-error) 9%, transparent);
  --sel: color-mix(in srgb, var(--ub-primary) 10%, transparent);
  background: var(--ub-bg); color: var(--ub-text);
}
body[data-ui="b"] .btn-g { color: var(--ub-on-primary); }

/* Keep sidebar geometry independent of scrollbars, hover and selection. */
[data-ui="b"] .sb-b-scroll { scrollbar-gutter:stable; }
[data-ui="b"] #shell-b-sidebar :is(.ni:hover,.ni.on,.sb-b-button:hover,[aria-current]) { font-weight:400; }
[data-ui="b"] .sb-b-issue-dot { width:6px; height:6px; flex:none; border-radius:var(--ub-radius-full); background:var(--ub-warning); }
[data-ui="b"] .sb-b-issue-dot--error { background:var(--ub-error); }
[data-ui="b"] #shell-b-library-tabs { justify-content:flex-start; }
[data-ui="b"] #shell-b-library-tabs[hidden] { display:none; }
[data-ui="b"] .sb-b-sites { padding:24px; }
[data-ui="b"] .sb-b-sites header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
[data-ui="b"] .sb-b-sites h1 { font:600 var(--ub-fs-heading) var(--ub-font-sans); }
[data-ui="b"] .sb-b-sites h2 { font:500 var(--ub-fs-body) var(--ub-font-sans); }
[data-ui="b"] .sb-b-sites form { display:grid; gap:8px; max-width:600px; margin:16px 0 24px; }
[data-ui="b"] .sb-b-sites input { padding:8px 12px; min-height:var(--ub-control-h); color:var(--ub-text); background:var(--ub-surface); border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); font:var(--ub-fs-body) var(--ub-font-sans); }
[data-ui="b"] .sb-b-sites table { width:100%; border-collapse:collapse; text-align:left; }
[data-ui="b"] .sb-b-sites :is(th,td) { padding:10px 8px; vertical-align:middle; border-bottom:1px solid var(--ub-border); }
[data-ui="b"] .sb-b-sites th { color:var(--ub-text-muted); font-weight:400; }
[data-ui="b"] .sb-b-sites td:nth-child(2) { font-variant-numeric:tabular-nums; }
[data-ui="b"] .sb-b-sites-section { margin-bottom:24px; overflow-x:auto; }
[data-ui="b"] #shell-b-lenses [aria-pressed], [data-ui="b"] #shell-b-mode [aria-pressed] { font-weight:500; }
[data-ui="b"] #shell-b-context[data-site-context="true"] .tb-title { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }

/* Only an explicit pin reserves space. Opening an overlay never changes the page. */
body[data-ui="b"].shell-b-tools-pinned { --shell-b-width:calc(var(--shell-b-areas-width) + var(--shell-b-panel-width)); }
[data-ui="b"] #shell-b-sidebar .ni { box-sizing:border-box; height:32px; min-height:32px; font-weight:400; }
[data-ui="b"] #shell-b-sidebar .ni.is-focused { background:var(--ub-surface-selected); color:var(--ub-text); box-shadow:none; }
[data-ui="b"] #shell-b-sidebar .ni.is-overlay-open:not(.is-focused) { background:transparent; box-shadow:inset 0 0 0 1px var(--ub-border-strong); }
[data-ui="b"] .sb-b-overlay-scrim { display:none; position:fixed; top:calc(var(--shell-envbar-h,0px) + 56px); left:var(--shell-b-areas-width); right:0; bottom:0; padding:0; border:0; border-radius:0; background:var(--ub-scrim); cursor:default; }
body[data-ui="b"].shell-b-tools-open:not(.shell-b-tools-pinned) .sb-b-overlay-scrim { display:block; }
[data-ui="b"] .sb-b-area-summary { display:none; }
[data-ui="b"] #shell-b-sidebar .sb-b-area-dot { margin-left:auto; width:6px; height:6px; flex:none; background:var(--ub-text-muted); border-radius:var(--ub-radius-full); }
[data-ui="b"] #shell-b-sidebar .sb-b-issue-dot--error { background:var(--ub-error); }
[data-ui="b"] #shell-b-sidebar .sb-b-issue-dot--warning { background:var(--ub-warning); }
[data-ui="b"] #shell-b-tools {
  position:absolute; left:100%; top:56px; bottom:auto; max-height:calc(100% - 56px); width:var(--shell-b-panel-width); box-sizing:border-box;
  padding:8px; overflow:auto; scrollbar-gutter:stable; background:var(--ub-surface-raised); border:1px solid var(--ub-border-strong); box-shadow:var(--ub-shadow-overlay); z-index:1;
  visibility:hidden; opacity:0; transform:translateX(-8px); pointer-events:none;
  transition:none;
}
body[data-ui="b"].shell-b-tools-open #shell-b-tools { visibility:visible; opacity:1; transform:translateX(0); pointer-events:auto; }
[data-ui="b"] .sb-b-tools-heading { display:flex; gap:4px; align-items:center; min-height:40px; }
[data-ui="b"] [data-ub-action="pin-tools"] { gap:6px; }
[data-ui="b"] [data-ub-action="pin-tools"][aria-pressed="true"] { color:var(--ub-accent); background:var(--ub-surface-selected); }
[data-ui="b"] [data-ub-action="pin-tools"] .sb-b-icon { order:-1; }
[data-ui="b"] .sb-b-tools-heading h2 { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0; padding:0 8px; font:600 var(--ub-fs-body) var(--ub-font-sans); color:var(--ub-text); }
[data-ui="b"] .sb-b-site-switcher { margin:0 0 8px; }
[data-ui="b"] .sb-b-site-switcher > button { width:100%; height:40px; min-height:40px; gap:6px; background:var(--ub-surface); }
[data-ui="b"] .sb-b-site-switcher .ub-btn-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-ui="b"] .sb-b-switch-action { flex:none; font-size:var(--ub-fs-label); }
[data-ui="b"] #shell-b-sidebar .sb-b-tool { display:flex; justify-content:flex-start; gap:8px; height:32px; min-height:32px; width:100%; padding:4px 8px; }
[data-ui="b"] #shell-b-sidebar .sb-b-tool > .sb-b-icon { order:-1; }
[data-ui="b"] #shell-b-sidebar .sb-b-tool .ub-btn-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-ui="b"] #shell-b-sidebar .sb-b-tool.on { background:var(--ub-surface-selected); color:var(--ub-text); box-shadow:none; }
[data-ui="b"] #shell-b-strip { flex-wrap:wrap; }
[data-ui="b"] #shell-b-strip #site-tabs { order:0; }
[data-ui="b"] #shell-b-mode { order:1; }
[data-ui="b"] .sb-b-doc-filters { order:2; width:100%; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:4px 0; font:var(--ub-fs-body) var(--ub-font-sans); }
[data-ui="b"] .sb-b-doc-filters label { display:flex; gap:8px; align-items:center; }
[data-ui="b"] .sb-b-doc-filters select { max-width:260px; min-height:32px; padding:4px 8px; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); color:var(--ub-text); background:var(--ub-surface); font:inherit; }
[data-ui="b"] #shell-b-doc-actions { margin-left:auto; }
[data-ui="b"] #shell-b-sidebar .sb-b-tool { white-space:nowrap; }
body[data-ui="b"].shell-b-rail :is(.sb-b-logo .brand-text,.sb-b-logo .brand-tm,.sb-b-logo .srole,#shell-b-nav .ni-lbl,.tsw-box,.tsw-cv) { display:none; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sb-b-scroll { padding:0 10px; }
body[data-ui="b"].shell-b-rail .sb-b-brand, body[data-ui="b"].shell-b-rail #shell-b-tenant, body[data-ui="b"].shell-b-rail #shell-b-sidebar .sfoot { padding-left:10px; padding-right:10px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .ni { width:44px; height:40px; min-height:40px; justify-content:center; padding:0; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .ni-ic { width:18px; height:18px; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sb-b-area-dot { position:absolute; right:7px; top:8px; margin:0; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sb-b-tool .sb-b-icon { width:16px; height:16px; }
@media (max-width:1024px) {
  [data-ui="b"] #shell-b-sidebar :is(.ni,.sb-b-tool) { height:44px; min-height:44px; }
  [data-ui="b"] .sb-b-doc-filters select { max-width:180px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-ui="b"] #shell-b-tools { transition:none; transform:none; }
}

body[data-ui="b"].shell-b-rail #shell-b-sidebar :is(.tsw,.sprof,.theme-btn,.slo) { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:44px; height:40px; min-height:40px; margin:0; padding:0; gap:0; }
[data-ui="b"] .sb-b-site-switcher [aria-current="page"] { color:var(--ub-text); background:var(--ub-surface-selected); }
@media (pointer:coarse) { body[data-ui="b"].shell-b-rail #shell-b-sidebar :is(.ni,.sb-b-tool,.tsw,.sprof,.theme-btn,.slo) { height:44px; min-height:44px; } }

/* Author display rules must not override native hidden state. */
[data-ui="b"] :is(#shell-b-strip,#shell-b-lenses,.sb-b-doc-filters,.sb-b-doc-filters label)[hidden] { display:none; }
[data-ui="b"] .sb-b-doc-filters .sb-b-select { position:relative; gap:6px; padding-left:10px; min-width:0; border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); color:var(--ub-text-secondary); background:var(--ub-surface); }
[data-ui="b"] .sb-b-doc-filters .sb-b-select select { appearance:none; min-width:0; border:0; background:transparent; padding:4px 24px 4px 0; cursor:pointer; }
[data-ui="b"] .sb-b-select > span { position:absolute; right:8px; pointer-events:none; }
[data-ui="b"] .sb-b-select:focus-within { outline:var(--ub-focus-ring-w) solid var(--ub-focus-ring); outline-offset:2px; }
[data-ui="b"] #shell-b-sidebar .sprof { display:flex; align-items:center; min-width:0; width:100%; gap:8px; white-space:nowrap; overflow:hidden; }
[data-ui="b"] #shell-b-sidebar .sprof > div { display:none; }
[data-ui="b"] #shell-b-sidebar .sprof .sav { display:flex; flex:none; }
[data-ui="b"] #shell-b-sidebar .sb-b-first-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body[data-ui="b"].shell-b-rail #shell-b-sidebar .sprof :is(.sav,.sb-b-first-name) { display:none; }
body[data-ui="b"]:not(.shell-b-rail) #shell-b-sidebar .sprof > .sb-b-footer-icon { display:none; }

[data-ui="b"] #shell-b-tools { max-width:calc(100vw - var(--shell-b-areas-width)); display:flex; flex-direction:column; }
body[data-ui="b"].shell-b-tools-pinned #shell-b-tools { top:0; bottom:0; max-height:none; padding-top:0; box-shadow:none; border:0; border-right:1px solid var(--ub-border); }
body[data-ui="b"].shell-b-tools-pinned #shell-b-tools .sb-b-tools-heading { height:56px; min-height:56px; flex:none; box-sizing:border-box; border-bottom:1px solid var(--ub-border); }
[data-ui="b"] #shell-b-sidebar .sb-b-tool:hover:not(.on) { background:var(--ub-surface-hover); }
[data-ui="b"] #shell-b-sidebar .sb-b-tool.on { background:var(--ub-surface-selected); box-shadow:inset 3px 0 0 var(--ub-primary); }
[data-ui="b"] #shell-b-sidebar .sb-b-tool:has(.sb-b-description) { height:auto; min-height:48px; white-space:normal; }
[data-ui="b"] .sb-b-tool-copy { flex:1; min-width:0; }
[data-ui="b"] .sb-b-tool-title { display:flex; align-items:center; gap:8px; min-width:0; }
[data-ui="b"] .sb-b-tool-title > span:first-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
[data-ui="b"] .sb-b-tool-title .ni-bdg { margin-left:auto; flex:none; }
[data-ui="b"] .sb-b-description { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--ub-text-muted); font:var(--ub-fs-label) var(--ub-font-sans); line-height:1.4; }
[data-ui="b"] .sb-b-new { font:var(--ub-fs-label) var(--ub-font-sans); color:var(--ub-accent); }
[data-ui="b"] #shell-b-sidebar #shell-b-tools.is-compact .sb-b-description { display:none; }
[data-ui="b"] #shell-b-sidebar #shell-b-tools.is-compact .sb-b-tool { height:32px; min-height:32px; }
[data-ui="b"] .sb-b-tools-footer { margin-top:auto; padding-top:16px; }
[data-ui="b"] [data-ub-action="descriptions"] { width:100%; }
[data-ui="b"] [data-ub-action="descriptions"]::after { content:'Off'; color:var(--ub-text-muted); }
[data-ui="b"] [data-ub-action="descriptions"][aria-checked="true"]::after { content:'On'; }
[data-ui="b"] #shell-b-context .tb-title { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
[data-ui="b"] #shell-b-tool-switcher { position:relative; min-width:0; }
[data-ui="b"] #shell-b-tool-switcher > summary { cursor:pointer; padding:8px; border-radius:var(--ub-radius-sm); color:var(--ub-text); overflow:hidden; text-overflow:ellipsis; list-style:none; }
[data-ui="b"] #shell-b-tool-switcher > summary::-webkit-details-marker { display:none; }
[data-ui="b"] #shell-b-tool-options { left:0; top:100%; box-sizing:border-box; box-shadow:var(--ub-shadow-floating); max-height:calc(100dvh - var(--shell-b-header-bottom) - 16px); overflow-y:auto; overflow-x:hidden; width:260px; }
[data-ui="b"] #shell-b-tool-options .sb-b-crumb-heading { display:block; width:100%; margin:8px 0 2px; padding:4px 8px; box-sizing:border-box; font:500 var(--ub-fs-label) var(--ub-font-sans); color:var(--ub-text-muted); }
[data-ui="b"] #shell-b-tool-options .sb-b-crumb-tool { display:flex; box-sizing:border-box; width:100%; min-width:0; gap:8px; padding:8px; white-space:normal; justify-content:flex-start; }
[data-ui="b"] #shell-b-tool-options .sb-b-crumb-tool > .sb-b-icon { order:-1; flex:none; width:16px; height:16px; }
[data-ui="b"] #shell-b-tool-options .ub-btn-label { white-space:normal; flex:1; min-width:0; text-align:left; overflow-wrap:anywhere; }
[data-ui="b"] #shell-b-tool-options .sb-b-crumb-attention { flex:none; color:var(--ub-warning); }
[data-ui="b"] #shell-b-tool-options .sb-b-crumb-tool.on { background:var(--ub-surface-selected); color:var(--ub-text); }
@media (pointer:coarse) { [data-ui="b"] #shell-b-sidebar #shell-b-tools.is-compact .sb-b-tool { height:44px; min-height:44px; } }

/* Guidance uses B's existing tokens; the page stays readable behind each step. */
[data-ui="b"] .sb-b-panel-hint { margin:0 0 var(--ub-space-3); color:var(--ub-text-muted); font-size:var(--ub-fs-label); }
[data-ui="b"] .sb-b-panel-hint[hidden] { display:none; }
[data-ui="b"] .sb-b-tour { overflow:auto; margin:0; position:fixed; z-index:10020; box-sizing:border-box; padding:var(--ub-space-4); background:var(--ub-surface); border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-md); color:var(--ub-text); font:var(--ub-fs-body)/1.5 var(--ub-font-sans); }
[data-ui="b"] .sb-b-tour h2 { margin:0; font-size:var(--ub-fs-heading); }
[data-ui="b"] .sb-b-tour p { margin:var(--ub-space-2) 0 var(--ub-space-3); }
[data-ui="b"] .sb-b-tour .sb-b-guide-count { color:var(--ub-text-muted); font-size:var(--ub-fs-label); }
[data-ui="b"] .sb-b-tour > div { display:flex; flex-wrap:wrap; gap:var(--ub-space-2); }
[data-ui="b"] .sb-b-tour button { padding:var(--ub-space-2) var(--ub-space-3); border:1px solid var(--ub-border-strong); border-radius:var(--ub-radius-sm); background:var(--ub-surface); color:var(--ub-text); font:inherit; cursor:pointer; }
[data-ui="b"] .sb-b-tour-target { outline:2px solid var(--ub-primary); outline-offset:2px; }
[data-ui="b"] .sb-b-tour button:focus-visible { outline:2px solid var(--ub-primary); outline-offset:2px; }

[data-ui="b"] .sb-b-empty-action { display:block; margin:var(--ub-space-3) auto 0; }

[data-ui="b"].shell-b-rail .sb-b-replay-label { display:none; }

@media (max-width:640px) {
  body[data-ui="b"] { max-width:100%; overflow-x:clip; }
  [data-ui="b"] :is(button,summary,.dr-tab) { min-height:44px; min-width:44px; }
  [data-ui="b"] .cm-item { min-height:44px; }
  body[data-ui="b"] #shell-b-sidebar :is(.sb-b-tool,.sb-b-button) { min-height:44px; height:auto; }
  [data-ui="b"] #shell-b-context { padding:4px 12px; width:100%; min-width:0; }
  [data-ui="b"] #shell-b-context #btn-add { display:none; }
  [data-ui="b"] #shell-b-crumbs > .sb-b-button { max-width:42vw; flex-shrink:1; }
  [data-ui="b"] #shell-b-tool-switcher { flex:1; overflow:visible; }
  [data-ui="b"] #shell-b-tool-switcher > summary { min-height:44px; padding:12px 4px; box-sizing:border-box; max-width:34vw; }
  [data-ui="b"] #shell-b-tool-options { position:fixed; left:12px; right:12px; width:auto; top:56px; max-height:70dvh; }
  [data-ui="b"] #shell-b-site-menu > summary { font-size:0; min-width:44px; min-height:44px; box-sizing:border-box; padding:12px; }
  [data-ui="b"] #shell-b-site-menu > summary::after { content:'⋯'; font-size:18px; }
  [data-ui="b"] #shell-b-context-actions [data-ub-action="search"] { min-width:44px; min-height:44px; font-size:0; justify-content:center; padding:0; }
  [data-ui="b"] #shell-b-context-actions [data-ub-action="search"] .ub-btn-label { display:none; }
  [data-ui="b"] #shell-b-strip { flex-wrap:wrap; padding:8px 12px; min-width:0; }
  [data-ui="b"] :is(#site-tabs,#shell-b-lenses,#shell-b-mode) { max-width:100%; min-width:0; overflow-x:auto; }
  [data-ui="b"] .sb-b-doc-filters { flex-wrap:wrap; min-width:0; width:100%; }
  [data-ui="b"] .sb-b-doc-filters .sb-b-select { flex:1; max-width:100%; }
  [data-ui="b"] .sb-b-doc-filters select { width:100%; min-height:44px; }
  [data-ui="b"] #site-body { min-width:0; max-width:100%; overflow-wrap:anywhere; }
  [data-ui="b"] #site-body .tw { max-width:100%; overflow-x:auto; }
  body[data-ui="b"] #drawer, body.light[data-ui="b"] #drawer.inspector-b { position:fixed; inset:0; width:100%; max-width:none; max-height:none; height:100dvh; box-sizing:border-box; }
  [data-ui="b"] #drawer :is(button,input,select,summary,.dr-tab) { min-height:44px; }
  [data-ui="b"] #drawer :is(.ib-heading-actions,.ib-actions,.ib-footer) { flex-wrap:wrap; }
  [data-ui="b"] #drawer :is(.dr-bd,.ib-overview) { min-width:0; overflow-x:auto; }
}

@media(max-width:640px) {
  [data-ui="b"] #shell-b-tool-options { position:fixed; left:12px; right:12px; width:auto; top:var(--shell-b-header-bottom); max-height:calc(100dvh - var(--shell-b-header-bottom) - 16px); }
}

/* Search owns its text inset at every width; scanning lives in the final 40px. */
body[data-ui="b"] #shell-b-search-slot .srch > :is(span,i,svg):not([data-b-scan]) { display:none !important; }
body[data-ui="b"] #shell-b-search-slot .srch::before,
body[data-ui="b"] #shell-b-search-slot .srch::after,
body[data-ui="b"] #shell-b-search-slot input::before,
body[data-ui="b"] #shell-b-search-slot input::after { content:none !important; display:none !important; }
body[data-ui="b"] #shell-b-search-slot #gsearch { width:100%; min-width:0; box-sizing:border-box; padding:8px 44px 8px 12px !important; background-image:none !important; text-indent:0; }
body[data-ui="b"] #shell-b-search-slot [data-b-scan] { left:auto !important; right:2px !important; }

/* Closed navigation is absent immediately, including during mount/refresh.
   Never leave a fading copy of the tools over the page's left edge. */
[data-ui="b"] #shell-b-sidebar { transition:none; animation:none; }
[data-ui="b"] #shell-b-tools[aria-hidden="true"] { display:none; }

/* Page content supplies the single phone heading; the top bar keeps context. */
@media (max-width:640px) {
  body[data-ui="b"] { --shell-b-header-h:56px; }
  body[data-ui="b"] #shell-b-context .sb-b-context-row { height:auto; flex-wrap:wrap; gap:var(--ub-space-1) 2px; }
  body[data-ui="b"] #shell-b-context #tb-t.tb-title { display:none; }
  body[data-ui="b"] #shell-b-crumbs > :is(.sb-b-route-crumb,[aria-hidden],#shell-b-tool-switcher) { display:none; }
}

@media (max-width:640px), (pointer:coarse) {
  [data-ui="b"] #drawer :is(.ib-title-row h2,.ib-product,.ib-context,.ib-copy-value,.ib-evidence dd) { white-space:normal; overflow-wrap:anywhere; min-width:0; }
  [data-ui="b"] #drawer :is(.ib-evidence > div,.ib-evidence dd) { flex-wrap:wrap; }
  [data-ui="b"] #drawer .ib-evidence > div { grid-template-columns:1fr; }
  [data-ui="b"] #drawer :is(.ib-copy,.ib-evidence-actions button) { min-width:44px; min-height:44px; }
  [data-ui="b"] #drawer :is(input,select,textarea) { font-size:1rem; max-width:100%; box-sizing:border-box; }
  [data-ui="b"] #drawer .ib-footer { max-height:40dvh; }
  [data-ui="b"] #drawer .ib-record-tabs { flex-wrap:wrap; }
  [data-ui="b"] #drawer .ib-record-tabs button { white-space:normal; min-height:44px; }
  [data-ui="b"] #drawer .drow2 { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:640px), (pointer:coarse) {
  body[data-ui="b"] #ticket-ws .ticket-ws-body { display:flex; flex-direction:column; overflow:auto; }
  body[data-ui="b"] #ticket-ws .ticket-ws-main { order:1; overflow:visible; flex:none; }
  body[data-ui="b"] #ticket-ws .ticket-ws-side { order:2; flex:none; min-width:0; width:100%; box-sizing:border-box; }
}

/* Discipline navigation owns a full row. Scroll hints leave fixed menus unmasked. */
body[data-ui="b"] #shell-b-strip { position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; row-gap:4px; padding-bottom:8px; }
body[data-ui="b"] #shell-b-strip #site-tabs { grid-column:1 / -1; grid-row:1; width:100%; min-width:0; overflow-x:auto; mask-image:none; padding-right:24px; box-sizing:border-box; }
body[data-ui="b"] #site-tabs > * { flex:none; }
body[data-ui="b"] #shell-b-strip::after { content:""; position:absolute; top:0; right:16px; width:24px; height:var(--ub-control-h); pointer-events:none; background:linear-gradient(to right,transparent,var(--ub-surface)); }
body[data-ui="b"] #shell-b-strip > .ub-phone-filters { grid-column:1; grid-row:2; min-width:0; }
body[data-ui="b"] #shell-b-strip #shell-b-mode { grid-column:2; grid-row:2; }
body[data-ui="b"] #site-body .sh .sa :is(.btn,.ub-btn,.section-search-input) { box-sizing:border-box; height:32px; min-height:32px; font:500 var(--ub-fs-body)/1.4 var(--ub-font-sans); }
body[data-ui="b"] #site-body .site-row-select { display:inline-flex; justify-content:center; align-items:center; min-width:24px; min-height:24px; padding:4px; cursor:pointer; box-sizing:border-box; }
body[data-ui="b"] #site-body .site-row-select input[type="checkbox"] { width:16px !important; height:16px !important; min-width:16px !important; min-height:16px !important; margin:0; padding:0; cursor:pointer; }
@media(max-width:640px), (pointer:coarse) {
  body[data-ui="b"] #site-body .site-row-select { min-width:44px; min-height:44px; }
}
@media(max-width:640px) {
  body[data-ui="b"] #shell-b-crumbs > [data-ub-action="site-picker"] { max-width:58vw; }
  body[data-ui="b"] #site-body .sh .sa :is(.btn,.ub-btn,.section-search-input) { min-height:44px; height:auto; }
}

/* One hover / keyboard-focus state for every shell menu and drop-down item
   (sidebar areas, area tools, rail flyout, site/tool switchers, Site ⋯, Help,
   discipline menus, command results). --ub-surface-hover is nearly identical to
   --ub-surface-raised, the background every menu uses, so hover was invisible
   (JP 2026-11-15). Selected items keep their selected fill and darken slightly. */
[data-ui="b"] :is(#shell-b-sidebar .ni,#shell-b-sidebar .sb-b-tool,#shell-b-rail-flyout .sb-b-flyout-row,.sb-b-site-switcher > button,.sb-b-menu .sb-b-button,.sb-b-menu .tab,#shell-b-tools-slot :is(.btn,.ub-btn),#shell-b-command .sb-b-button,#shell-b-crumbs > .sb-b-button,#shell-b-tool-switcher > summary,#shell-b-site-menu > summary,.sb-b-customers > summary,#shell-b-help > summary,.sb-b-discipline > summary):is(:hover,:focus-visible):not(:disabled,.on,.is-focused,[aria-current="page"],[aria-selected="true"]) { background:var(--ub-menu-hover); color:var(--ub-text); }
[data-ui="b"] :is(#shell-b-sidebar .ni,#shell-b-sidebar .sb-b-tool,#shell-b-rail-flyout .sb-b-flyout-row,.sb-b-site-switcher > button,.sb-b-menu .sb-b-button,.sb-b-menu .tab):is(.on,.is-focused,[aria-current="page"]):hover { background:color-mix(in srgb, var(--ub-surface-selected), var(--ub-text) 7%); }
[data-ui="b"] [data-ask-mondo-entry][hidden] { display:none; }

/* Inspection page header on a phone (JP 2026-11-18): no keyboard hints, the scan
   field fills its row, five counts in one row with percent complete beneath, and
   the actions as two rows of equal-width buttons. */
body[data-ui="b"] #pg-insp_detail .insp-acts { display: flex; align-items: center; gap: 8px; }
@media (pointer: coarse) { body[data-ui="b"] #pg-insp_detail .insp-kbd-hints { display: none; } }
@media (max-width: 720px) {
  body[data-ui="b"] #pg-insp_detail .insp-kbd-hints { display: none; }
  body[data-ui="b"] #pg-insp_detail .insp-acts { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  body[data-ui="b"] #pg-insp_detail .insp-acts > .ub-btn { width: 100%; min-width: 0; }
  body[data-ui="b"] #pg-insp_detail .insp-scan-row #id-scan-status { min-width: 0 !important; }
  body[data-ui="b"] #pg-insp_detail .insp-scan-row #id-scan-status:empty { display: none; }
  body[data-ui="b"] #pg-insp_detail .insp-kpis { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px !important; padding: 8px 12px !important; }
  body[data-ui="b"] #pg-insp_detail .insp-kpi { min-width: 0 !important; }
  body[data-ui="b"] #pg-insp_detail .insp-kpi-sep { display: none; }
  body[data-ui="b"] #pg-insp_detail .insp-pct { grid-column: 1 / -1; margin-left: 0 !important; text-align: center; }
}
