/* ===== orange glow background (ambient, breathing) ===== */
.shell::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
 background:radial-gradient(60% 45% at 50% 108%,rgba(255,132,40,.34),rgba(255,110,30,.12) 45%,transparent 72%),radial-gradient(40% 30% at 12% 100%,rgba(255,170,90,.14),transparent 70%);animation:xglow 7s ease-in-out infinite alternate}
@keyframes xglow{from{opacity:.75;transform:scale(1)}to{opacity:1;transform:scale(1.06)}}
html body .main{background:transparent!important}
html body #sideChat{z-index:40}

/* ===== top bar: no black bars, floating glass controls ===== */
html body .main>.topbar,html body #mainChat>header.topbar{position:relative!important;background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;margin:10px 14px 0!important;padding:0!important;min-height:48px}
html body .main>.topbar::before,html body .main>.topbar::after,html body header.topbar::before,html body header.topbar::after{content:none!important;display:none!important}
html body .topbar .xtog,html body .topbar .xnew,html body .topbar #tbPreview{background:rgba(255,255,255,.1)!important;border:1px solid rgba(255,255,255,.2)!important;-webkit-backdrop-filter:blur(22px) saturate(1.8)!important;backdrop-filter:blur(22px) saturate(1.8)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 6px 20px rgba(0,0,0,.25)!important;color:#fff!important;width:44px!important;height:44px!important;border-radius:50%!important;transition:transform .25s cubic-bezier(.3,1.4,.4,1),background .2s}
html body .topbar #tbPreview{display:grid!important;place-items:center;margin-right:8px!important}
html body .topbar .xtog:active,html body .topbar .xnew:active,html body .topbar #tbPreview:active{transform:scale(.88)}
html body .topbar #tbPreview svg{width:22px;height:22px}

/* ===== pill: Chat | Build, liquid glass + sliding thumb ===== */
html body .topbar .xpill{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;display:flex!important;align-items:center;gap:0!important;padding:4px!important;margin:0!important;border-radius:999px!important;pointer-events:auto!important;visibility:visible!important;
 background:rgba(255,255,255,.1)!important;border:1px solid rgba(255,255,255,.2)!important;-webkit-backdrop-filter:blur(26px) saturate(1.9)!important;backdrop-filter:blur(26px) saturate(1.9)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 10px 30px rgba(0,0,0,.3)!important;animation:xpin .7s cubic-bezier(.2,1.2,.3,1) both}
@keyframes xpin{from{opacity:0;transform:translate(-50%,-90%) scale(.85)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
html body .topbar .xp-b{position:relative;z-index:2;display:flex!important;align-items:center;justify-content:center;gap:7px;width:92px!important;height:38px!important;padding:0!important;border:0!important;border-radius:999px!important;background:transparent!important;color:#fff!important;font:600 14.5px/1 inherit;font-family:inherit;pointer-events:auto!important;opacity:.62;transition:opacity .3s,transform .25s cubic-bezier(.3,1.4,.4,1)}
html body .topbar .xp-b svg{width:18px!important;height:18px!important}
html body .topbar .xp-b:active{transform:scale(.92)}
html body:not(.code-on) .topbar .xp-b.n,html body.code-on .topbar .xp-b.c{opacity:1}
html body .topbar .xp-thumb{display:block!important;position:absolute!important;z-index:1;left:4px!important;top:4px!important;width:92px!important;height:38px!important;border-radius:999px!important;pointer-events:none!important;
 background:linear-gradient(180deg,rgba(255,255,255,.34),rgba(255,255,255,.14))!important;box-shadow:inset 0 0 0 .75px rgba(255,255,255,.55),inset 0 1px 1px rgba(255,255,255,.5),0 3px 12px rgba(0,0,0,.25)!important;transform:none;transition:transform .55s cubic-bezier(.3,1.25,.4,1)!important}
html body.code-on .topbar .xp-thumb{transform:translateX(92px)!important}
@media(max-width:480px){html body .topbar .xp-b{width:78px!important;font-size:13.5px}html body .topbar .xp-thumb{width:78px!important}html body.code-on .topbar .xp-thumb{transform:translateX(78px)!important}}

/* ===== liquid-glass morph panel (+ button and ... button) ===== */
.mg-panel{position:fixed;z-index:200;min-width:230px;padding:6px;border-radius:26px;display:flex;flex-direction:column;gap:2px;
 background:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,.07));-webkit-backdrop-filter:blur(30px) saturate(2);backdrop-filter:blur(30px) saturate(2);
 border:1px solid rgba(255,255,255,.24);box-shadow:inset 0 1px 0 rgba(255,255,255,.38),inset 0 -1px 0 rgba(255,255,255,.06),0 24px 70px rgba(0,0,0,.55),0 0 0 .5px rgba(0,0,0,.4)}
.mg-panel[hidden]{display:none}
.mg-i{display:flex;align-items:center;gap:14px;padding:13px 16px;border:0;border-radius:20px;background:transparent;color:#f4f3ee;font:500 16px/1 inherit;font-family:inherit;text-align:left;cursor:pointer;transition:background .18s}
.mg-i svg{width:22px;height:22px;flex:none}
.mg-i:hover,.mg-i:active{background:rgba(255,255,255,.14)}

/* ===== polish ===== */
html body .composer{-webkit-backdrop-filter:blur(26px) saturate(1.8)!important;backdrop-filter:blur(26px) saturate(1.8)!important;background:rgba(255,255,255,.09)!important;border:1px solid rgba(255,255,255,.18)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 14px 44px rgba(0,0,0,.4)!important}
html body .composer #attBtn{transition:none}
html body #sideChat{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;box-sizing:border-box}
html body .msgs .m-bot,html body .msgs .m-user{animation:xrise .45s cubic-bezier(.22,1,.36,1) both}
@keyframes xrise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ===== pill sits next to the ... button (Ask | Build) ===== */
html body .topbar .xpill{position:relative!important;left:auto!important;top:auto!important;transform:none!important;margin:0 10px 0 0!important;animation:xpin2 .6s cubic-bezier(.2,1.2,.3,1) both}
@keyframes xpin2{from{opacity:0;transform:scale(.85)}to{opacity:1;transform:none}}
html body .topbar .xpill~#tbPreview{margin-right:8px!important}

/* ===== rainbow glow on the input in Build (code) mode ===== */
@keyframes xrb{to{background-position:300% 0}}
html body.code-on .composer,html body.code-on #code .cd-in{position:relative;border-color:transparent!important}
html body.code-on .composer::before,html body.code-on #code .cd-in::before{content:"";position:absolute;inset:-2px;border-radius:inherit;z-index:-1;pointer-events:none;
 background:linear-gradient(90deg,#ff3b30,#ff9500,#ffd60a,#34c759,#00c7be,#0a84ff,#bf5af2,#ff2d55,#ff3b30);background-size:300% 100%;animation:xrb 4s linear infinite}
html body.code-on .composer::after,html body.code-on #code .cd-in::after{content:"";position:absolute;inset:-2px;border-radius:inherit;z-index:-2;pointer-events:none;filter:blur(16px);opacity:.75;
 background:linear-gradient(90deg,#ff3b30,#ff9500,#ffd60a,#34c759,#00c7be,#0a84ff,#bf5af2,#ff2d55,#ff3b30);background-size:300% 100%;animation:xrb 4s linear infinite}
html body.code-on .composer,html body.code-on #code .cd-in{background:#1f1f22!important}

/* ===== floating 3-way pill: Ask | Imagine | Build (centered on top) ===== */
html body .topbar .xpill{position:absolute!important;left:50%!important;top:2px!important;transform:translateX(-50%)!important;margin:0!important;padding:4px!important;animation:xpin3 .6s cubic-bezier(.2,1.2,.3,1) both;z-index:5}
@keyframes xpin3{from{opacity:0;transform:translateX(-50%) translateY(-14px) scale(.9)}to{opacity:1;transform:translateX(-50%)}}
html body .topbar .xp-b{width:88px!important;height:38px!important;opacity:.7;font:600 15px/1 inherit;font-family:inherit}
html body .topbar .xp-b:hover{opacity:1}
html body .topbar .xp-thumb{width:88px!important;height:38px!important;transform:translateX(0)!important}
html body .topbar .xpill[data-pos="1"] .xp-thumb{transform:translateX(88px)!important}
html body .topbar .xpill[data-pos="2"] .xp-thumb{transform:translateX(176px)!important}
html body .topbar .xpill[data-pos="0"] .xp-b:nth-of-type(1),html body .topbar .xpill[data-pos="1"] .xp-b:nth-of-type(2),html body .topbar .xpill[data-pos="2"] .xp-b:nth-of-type(3){opacity:1}
html body:not(.code-on) .topbar .xp-b.n,html body.code-on .topbar .xp-b.c{opacity:.7}
html body.code-on .topbar .xp-thumb{transform:translateX(176px)!important}
@media(max-width:520px){
 html body .topbar .xp-b,html body .topbar .xp-thumb{width:66px!important;font-size:14px}
 html body .topbar .xpill[data-pos="1"] .xp-thumb{transform:translateX(66px)!important}
 html body .topbar .xpill[data-pos="2"] .xp-thumb,html body.code-on .topbar .xp-thumb{transform:translateX(132px)!important}
 html body .topbar .xnew{display:none!important}
}
