/* GB controls V5: consistent positioning, with footer as a hard visual boundary. */
html body.gb-controls-v5 .gb-theme-toggle,
html body.gb-controls-v5 footer .gb-theme-toggle,
html body.gb-controls-v5 .detail-bottom .gb-theme-toggle,
html body.gb-controls-v5 .home-footer .gb-theme-toggle {
 position:fixed!important;top:auto!important;left:auto!important;
 right:max(18px,env(safe-area-inset-right,0px) + 18px)!important;
 bottom:max(18px,env(safe-area-inset-bottom,0px) + 18px)!important;
 margin:0!important;float:none!important;display:inline-flex!important;
 visibility:visible!important;opacity:1!important;z-index:998!important;
 transform:translate3d(0,calc(-1px * var(--gb-theme-lift,0)),0)!important;
 transition:background-color .2s ease,color .2s ease!important;
 pointer-events:auto!important;
}
html body.gb-controls-v5 .gb-v5-back {
 box-sizing:border-box;position:fixed!important;left:auto!important;
 right:var(--gb-back-right,160px)!important;top:40vh!important;bottom:auto!important;
 min-width:46px;min-height:46px;display:flex;align-items:center;justify-content:center;
 border:1px solid #bba16d;border-radius:999px;padding:8px 15px;
 color:#f0e4c9;background:#151714;font:13px Arial,sans-serif;
 box-shadow:0 4px 14px #0008;cursor:pointer;z-index:997;
 transform:translate3d(0,calc(-1px * var(--gb-back-lift,0)),0)!important;
 transition:background-color .2s ease,color .2s ease!important;
}
html[data-gb-theme="light"] body.gb-controls-v5 .gb-v5-back {color:#4e421f;background:#faf6ee}
html body.gb-controls-v5 .gb-v5-back[hidden] {display:none!important}
html body.gb-controls-v5 .gb-v5-back:hover {background:#29362b}
html[data-gb-theme="light"] body.gb-controls-v5 .gb-v5-back:hover{background:#e9dfca}
html body.gb-controls-v5 .gb-v5-back:focus-visible,
html body.gb-controls-v5 .gb-theme-toggle:focus-visible{outline:3px solid #cba867!important;outline-offset:3px!important}
/* Keep existing footer text link only as a non-sticky fallback with JavaScript disabled. */
html body.gb-controls-v5 .gb-page-end-top{display:none!important}
/* Flatten only the second overlay, never darken V5 WebP pixels again. */
html body .sp-ai-visual .sp-ai-shade{display:none!important;background:transparent!important}
html body .sp-ai-visual .sp-ai-copy{display:none!important}
html body .sp-card.sp-card-ai .sp-thumb::after,
html body .sp-card.sp-card-ai .sp-ai-card-copy{display:none!important}
html body .sp-card.sp-card-ai .sp-image-credit{display:none!important}
html body .sp-ai-visual img{display:block}
@media(max-width:1099px){
 html body.gb-controls-v5 .gb-v5-back{
  top:auto!important;right:auto!important;left:max(14px,env(safe-area-inset-left,0px) + 14px)!important;
  bottom:max(14px,env(safe-area-inset-bottom,0px) + 14px)!important;
  min-width:48px;min-height:48px;padding:0 13px;
 }
 html body.gb-controls-v5 .gb-theme-toggle,
 html body.gb-controls-v5 footer .gb-theme-toggle{
  right:max(14px,env(safe-area-inset-right,0px) + 14px)!important;
  bottom:max(14px,env(safe-area-inset-bottom,0px) + 14px)!important;
 }
}
@media(max-width:500px){
 html body.gb-controls-v5 .gb-v5-back{width:48px!important;font-size:0!important;padding:0!important}
 html body.gb-controls-v5 .gb-v5-back::before{content:'↑';font:27px Georgia,serif}
}
@media(prefers-reduced-motion:reduce){html body.gb-controls-v5 .gb-theme-toggle,html body.gb-controls-v5 .gb-v5-back{transition:none!important}}
