@media (min-width:768px){
  html body.xb .xb-tab,html body.xb .xbd-tabbar,html body .xb-shell-nav{display:none!important}
  body.xb,body.xb-shell-native{padding-bottom:0!important}
}
/* XBLUEMAN platform polish (pp1). Loaded LAST. Surface/finish only: no font-size, width or grid changes. Scoped to body.xb. */
body.xb{--pp-blue:#1f5bd8;--pp-blue-d:#1748b0;--pp-ink:#1f2633;--pp-sub:#5d6878;--pp-line:#e6eaf0;--pp-bg:#f6f7f9;--pp-card:#fdfdfe;--pp-r:12px;--pp-sh:0 1px 2px rgba(22,34,58,.04)}
.xbd-tags{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0;color:#456695;font-size:calc(12px * var(--rs,1));line-height:1.6}
.xbd-tags span{background:#f0f4fb;border-radius:5px;padding:1px 5px;overflow-wrap:anywhere}

/* calm neutral canvas instead of ambient gradients */
html body.xb,html body.xb:has(.xb-home){background:radial-gradient(1100px 520px at 10% -8%,rgba(214,228,250,.55),transparent 62%),var(--pp-bg)!important}

/* masthead: flat brand blue, no glass sheen or heavy shadow */
html body.xb #xb-top.xb-mast,html body.xb:has(.xb-home) #xb-top.xb-mast{background:var(--pp-blue)!important;background-image:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:0 1px 0 rgba(10,30,80,.12)!important}
/* Discover mobile drawer stays light (discover-app.css owns it) */
@media (max-width:767px){html body.xb.xbd-page #xb-top.xb-mast,html body.xb.xbd-page.xbda-open #xb-top.xb-mast{background:#fdfeff!important;background-image:none!important;box-shadow:none!important}html body.xb.xbd-page.xbda-open #xb-top.xb-mast{box-shadow:8px 0 30px rgba(20,40,80,.16)!important}}

/* header search magnifier (shown only when enhancer JS active) */
body.xb .xb-ps-trigger{display:none}
html.xb-ps-on body.xb #xb-top .xb-util>.xb-search{display:none!important}
html.xb-ps-on body.xb #xb-top .xb-ps-trigger{display:inline-grid;place-items:center;width:38px;height:38px;flex:none;border:1px solid rgba(255,255,255,.32);border-radius:50%;background:rgba(255,255,255,.1);color:#fff;cursor:pointer;justify-self:end;transition:background .15s}
html.xb-ps-on body.xb #xb-top .xb-ps-trigger:hover{background:rgba(255,255,255,.2)}
body.xb .xb-ps-trigger:focus-visible,body.xb .xb-ps-close:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* search dialog */
.xb-ps-layer{position:fixed;inset:0;z-index:1200;display:flex;justify-content:center;align-items:flex-start;padding:max(12px,env(safe-area-inset-top)) 12px 12px}
.xb-ps-layer[hidden]{display:none}
.xb-ps-back{position:absolute;inset:0;background:rgba(18,26,42,.36);opacity:0;transition:opacity .2s}
.xb-ps-dialog{position:relative;width:min(560px,100%);margin-top:8vh;background:var(--pp-card,#fdfdfe);border:1px solid #e6eaf0;border-radius:16px;box-shadow:0 18px 48px rgba(18,32,64,.18);padding:14px 16px 18px;opacity:0;transform:translateY(-8px);transition:opacity .2s,transform .2s}
.xb-ps-layer.is-in .xb-ps-back{opacity:1}
.xb-ps-layer.is-in .xb-ps-dialog{opacity:1;transform:none}
.xb-ps-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.xb-ps-head h2{margin:0;font-size:16px;font-weight:600;color:#1f2633}
.xb-ps-close{width:34px;height:34px;display:grid;place-items:center;border:0;border-radius:50%;background:#f1f3f6;color:#1f2633;cursor:pointer}
.xb-ps-dialog .xb-search{display:flex!important;align-items:center;width:100%!important;max-width:none!important;height:44px;margin:0!important;background:#f3f5f8!important;border:1px solid #e1e6ee!important;border-radius:22px!important;box-shadow:none!important;overflow:hidden}
.xb-ps-dialog .xb-search:focus-within{border-color:#1f5bd8!important;box-shadow:0 0 0 3px rgba(31,91,216,.14)!important}
.xb-ps-dialog .xb-search input[type=search]{flex:1;min-width:0;height:42px!important;border:0!important;background:none!important;padding:0 16px!important;color:#1f2633;outline:0}
.xb-ps-dialog .xb-search button{width:48px;height:42px;flex:none;border:0;background:#1f5bd8;color:#fff;display:grid;place-items:center;cursor:pointer}
body.xb-ps-open{overflow:hidden}
@media (prefers-reduced-motion:reduce){.xb-ps-back,.xb-ps-dialog{transition:none}}

/* surfaces: white cards, thin lines, balanced corners, no blur */
html body.xb :is(.xh-quick ul,.xh-card,.xb-home .xh-right>section,.qq-side>section,.qq-svc .svc-panel,.qq-rail>section,.qq-rail>nav,.qq-hot,.bm,#ct .mn>.bm,.xbm,.xb-panel,.xb-card,.xb-tcard,.xb-post,.xb-forum,.xb-notice){background:var(--pp-card)!important;border:1px solid var(--pp-line)!important;box-shadow:var(--pp-sh)!important;border-radius:var(--pp-r)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html body.xb :is(.xb-daily,.qq-strip,.xw-panel){background:var(--pp-card)!important;background-image:none!important;border-bottom:1px solid var(--pp-line)!important}
html body.xb .xw-day{background:#f7f8fa!important;border:1px solid var(--pp-line)!important;box-shadow:none!important;border-radius:10px!important}
html body.xb .xw-now-icon{background:#f3f6fb!important;box-shadow:none!important}
html body.xb :is(.xb-home .xh-slider,.qq-mid .ed-slider){border-radius:var(--pp-r)!important;box-shadow:none!important}
html body.xb :is(.xh-boards a,.qq-boards nav a){background:#f6f7f9!important;box-shadow:none!important;border-radius:10px!important}
html body.xb :is(.xh-chips a,.qq-tags a){background:#eef3fc!important;box-shadow:none!important;color:var(--pp-blue)}
/* primary buttons: solid restrained blue */
html body.xb :is(.xh-publish,.xh-q-p,.xb-home .xh-right .svc-btn-p){background:var(--pp-blue)!important;box-shadow:none!important;border-radius:10px!important}
html body.xb :is(.xh-publish,.xh-q-p):hover{background:var(--pp-blue-d)!important}
/* native buttons & inputs: neutral, thin */
html body.xb :is(.pn,.pnc){border-radius:8px!important;box-shadow:none!important;background-image:none!important}
html body.xb .pnc{background:var(--pp-blue)!important;border-color:var(--pp-blue)!important;color:#fff!important}
html body.xb :is(.px,.pt,.xb-home select,.xb-home input[type=text],.xb-home input[type=number]){background:#fdfdfe!important;border:1px solid #dde2ea!important;border-radius:8px!important;box-shadow:none!important}
html body.xb :is(.px,.pt):focus{border-color:var(--pp-blue)!important;box-shadow:0 0 0 3px rgba(31,91,216,.12)!important}

/* bottom nav: white bar, line icons */
html body.xb :is(.xb-tab,.xbd-tabbar){background:var(--pp-card)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;border-top:1px solid var(--pp-line)!important;box-shadow:none!important}
html body.xb .xb-tab a{position:relative;color:#7a8494}
html body.xb .xb-tab a[aria-current]{color:var(--pp-blue);font-weight:600}
html body.xb :is(.xb-tab,.xbd-tabbar) svg{fill:none!important;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
html body.xb .xbd-tabbar .xbd-pub svg{stroke:#fff}
html body.xb .xb-tab .xb-dot{position:absolute;top:6px;left:calc(50% + 8px);width:7px;height:7px;border-radius:50%;background:#e5484d;border:1.5px solid var(--pp-card)}

/* discover: news category link sits with feed tabs */
html body.xb .xbd-feeds .xbd-newslink{white-space:nowrap}

/* phone: one compact header row; secondary tools live in the existing menu */
@media (max-width:767px){
 html body.xb:not(.xbd-page) #xb-top.xb-mast .xb-top-in{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px!important;padding-top:6px!important;padding-bottom:6px!important;min-height:0!important;height:auto!important}
 html body.xb:not(.xbd-page) #xb-top .xb-brand{flex:0 1 auto;min-width:0;margin-right:auto}
 html body.xb:not(.xbd-page) #xb-top .xb-brand img{width:38px!important;height:38px!important;object-fit:contain}
 html body.xb:not(.xbd-page) #xb-top .xb-util{display:flex!important;align-items:center;gap:4px!important;order:2;flex-wrap:nowrap;width:auto!important;margin:0!important;position:static!important}
 html body.xb:not(.xbd-page) #xb-top .xb-user{display:flex!important;align-items:center;gap:2px;flex-wrap:nowrap}
 html body.xb:not(.xbd-page) #xb-top .xb-user .xb-uname{max-width:5.5em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html body.xb:not(.xbd-page) #xb-top .xb-menu{order:3;flex:none}
 html body.xb:not(.xbd-page) #xb-top .xb-navrow{order:4;flex-basis:100%}
 html.xb-ps-on body.xb:not(.xbd-page):not(.xb-tools-open) #xb-top :is(.xb-font,.xb-lang-d,.xb-hide-s,.xb-uname){display:none!important}
 html.xb-ps-on body.xb:not(.xbd-page):not(.xb-tools-open) #xb-top .xb-user>a[href*="view=chat"],html.xb-ps-on body.xb:not(.xbd-page):not(.xb-tools-open) #xb-top .xb-user>a[href*="do=pm"],html.xb-ps-on body.xb:not(.xbd-page):not(.xb-tools-open) #xb-top .xb-user>[data-xb-i18n="register"]{display:none!important}
 html body.xb.xb-tools-open:not(.xbd-page) #xb-top .xb-util{flex-wrap:wrap;order:5;flex-basis:100%;padding:6px 0;border-top:1px solid rgba(255,255,255,.16)}
 html body.xb.xb-tools-open:not(.xbd-page) #xb-top :is(.xb-font,.xb-lang-d,.xb-hide-s,.xb-uname){display:inline-flex!important}
 html.xb-ps-on body.xb:not(.xbd-page) #xb-top .xb-ps-trigger{width:36px;height:36px}
 /* Discover owns its own mobile search; no duplicate portal trigger in its drawer */
 html.xb-ps-on body.xb.xbd-page #xb-top .xb-ps-trigger{display:none!important}
 .xb-ps-dialog{margin-top:0}
 html body.xb .qq-rail>section,html body.xb .qq-rail>nav{border-radius:0!important;border-left:0!important;border-right:0!important}
}
@media (forced-colors:active){html body.xb #xb-top.xb-mast{background:Canvas!important}.xb-ps-dialog{border-color:CanvasText}}

/* desktop: shared nav as restrained floating bottom pill (no !important display, so existing hidden/fullscreen chat states still win) */
@media (min-width:768px){
 body.xb .xb-tab{display:grid;grid-template-columns:repeat(5,minmax(64px,1fr));position:fixed;left:50%;right:auto;bottom:16px;transform:translateX(-50%);z-index:310;width:auto;padding:4px 6px;border:1px solid var(--pp-line)!important;border-radius:999px;box-shadow:0 6px 20px rgba(22,34,58,.10)!important}
 body.xb .xb-tab a{display:flex;flex-direction:column;align-items:center;gap:1px;padding:5px 14px;border-radius:999px;font-size:calc(12px * var(--rs,1));text-decoration:none}
 body.xb .xb-tab svg{width:20px;height:20px}
 body.xb .xb-tab a:hover{color:var(--pp-blue)}
 body.xb .xb-foot{padding-bottom:84px}
 body.xb.xbd-page .xb-tab{display:none}
}

/* navscroll1: open shared mobile menu is viewport-bounded and scrolls on its own */
@media(max-width:860px){
  #xb-nav.xb-open.xb-nav-fit{box-sizing:border-box;max-height:var(--xb-nav-max,70vh)!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  #xb-nav.xb-open.xb-nav-fit li:last-child{margin-bottom:4px}
}
/* Discover drawer (<=767): drawer itself scrolls; keep last link clear of tabbar, no nested scroll in #xb-nav */
@media(max-width:767px){
  body.xbd-page.xbda-open #xb-top{overscroll-behavior:contain;padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}
  body.xbd-page #xb-top #xb-nav.xb-nav-fit{max-height:none!important;overflow:visible!important}
}
@media(max-width:860px) and (prefers-reduced-transparency:reduce){#xb-nav.xb-open.xb-nav-fit{background:#f7f9fd!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}}
@media(max-width:860px) and (forced-colors:active){#xb-nav.xb-open.xb-nav-fit{background:Canvas!important;border:1px solid CanvasText}}
