/* Build 16.2.1 — stable branded header and shared floating Samuga AI */
:root{--settings-header-bg:#29b8fe;--settings-footer-bg:#062a3b}
.site-header.settings-sticky-header,.article-header.settings-sticky-header{position:sticky!important;top:0!important;z-index:320!important;background:var(--settings-header-bg,#29b8fe)!important;isolation:isolate;filter:none!important;perspective:none!important}
.site-header.settings-sticky-header::before,.article-header.settings-sticky-header::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--settings-header-bg,#29b8fe);border-bottom:1px solid rgba(255,255,255,.22);box-shadow:0 7px 22px rgba(0,72,106,.13);pointer-events:none}
body.settings-header-static .site-header,body.settings-header-static .article-header{position:relative!important;top:auto!important}
.site-footer.v3-footer{background:var(--settings-footer-bg,#062a3b)!important}
.settings-announcement{display:block;position:relative;z-index:310;width:100%;padding:9px 16px;text-align:center;background:var(--brand,#29b8fe);color:#001621;font-size:12px;font-weight:800;text-decoration:none}

/* The AI controls are direct body children. This prevents footer/grid/transform ancestors from trapping the button. */
body>.chat-fab[data-floating-layer="true"],body>.chat-fab{position:fixed!important;right:max(16px,env(safe-area-inset-right))!important;left:auto!important;top:auto!important;bottom:calc(18px + env(safe-area-inset-bottom))!important;z-index:2147483000!important;margin:0!important;transform:none!important;translate:none!important;float:none!important;clear:none!important;inset-block-start:auto!important;inset-inline-start:auto!important;contain:layout style;isolation:isolate}
body>.chat-fab[data-position="bottom-left"]{right:auto!important;left:max(16px,env(safe-area-inset-left))!important}
body>.chat-panel[data-floating-layer="true"],body>.chat-panel{position:fixed!important;right:max(16px,env(safe-area-inset-right))!important;left:auto;top:auto;bottom:calc(82px + env(safe-area-inset-bottom))!important;z-index:2147483010!important;margin:0!important;width:min(390px,calc(100vw - 32px));height:min(570px,calc(100dvh - 116px));max-height:calc(100dvh - 116px);display:grid;visibility:hidden;opacity:0;pointer-events:none;transform:translate3d(0,14px,0) scale(.985);transform-origin:bottom right;transition:opacity .2s ease,transform .24s cubic-bezier(.2,.75,.25,1),visibility 0s linear .24s;isolation:isolate}
body>.chat-fab[hidden],body>.chat-panel[hidden]{display:none!important}
.v3-ai-drawer-btn{display:flex;text-decoration:none}
.settings-custom-social{font-size:10px;font-weight:900;text-decoration:none}
body.settings-ai-mobile-hidden>.chat-fab{display:none!important}


@media(max-width:760px){
  body>.chat-fab[data-floating-layer="true"],body>.chat-fab{right:max(12px,env(safe-area-inset-right))!important;bottom:calc(14px + env(safe-area-inset-bottom))!important}
  body>.chat-fab[data-position="bottom-left"]{right:auto!important;left:max(12px,env(safe-area-inset-left))!important}
  body>.chat-panel[data-floating-layer="true"],body>.chat-panel{left:10px!important;right:10px!important;top:auto!important;bottom:calc(72px + env(safe-area-inset-bottom))!important;width:auto!important;height:min(560px,72dvh)!important;min-height:340px;max-height:calc(100dvh - 96px)!important;border-radius:18px!important;transform-origin:bottom center}
  body.chat-open{overflow:hidden!important;overscroll-behavior:none}
}

body>.chat-panel.open{visibility:visible;opacity:1;pointer-events:auto;transform:translate3d(0,0,0) scale(1);transition-delay:0s}
body>.chat-panel.closing{pointer-events:none}
body>.chat-fab{transition:opacity .18s ease,transform .18s ease,box-shadow .18s ease}
body>.chat-fab:hover{transform:translateY(-2px)!important}
body.chat-open>.chat-fab{opacity:.72}
