/* video-ui.css — XMM AI new look. Loaded last. The sidebar (#sideChat) is NOT touched here. */
body.vui{--v-bg:#000;--v-card:#1c1c1e;--v-card2:#262628;--v-bd:rgba(255,255,255,.09);--v-mu:#8e8e93;--v-tx:#fff;--v-ez:cubic-bezier(.32,.72,0,1);--v-sp:cubic-bezier(.2,.9,.25,1.12);--v-w:760px}
html body.vui{background:#000}
body.vui .aurora{display:none!important}
body.vui #mainChat,body.vui #viewChat{background:#000!important}
body.vui #mainChat{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display",Inter,system-ui,sans-serif}

/* ---------- top bar ---------- */
html body.vui #mainChat .topbar{position:absolute!important;top:0;left:0;right:0;height:auto!important;min-height:0!important;padding:calc(10px + env(safe-area-inset-top,0px)) 14px 8px!important;display:block!important;background:linear-gradient(#000 55%,rgba(0,0,0,0))!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;z-index:30;pointer-events:none}
html body.vui #mainChat .topbar>*:not(.vtop){display:none!important}
body.vui .vtop{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;pointer-events:none;max-width:1100px;margin:0 auto}
body.vui .vtop>*{pointer-events:auto}
body.vui .vc,body.vui .vgl{height:40px;border-radius:999px;background:rgba(255,255,255,.1);border:0;color:#fff;display:flex;align-items:center;justify-content:center;-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5);box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);transition:transform .35s var(--v-sp),background .2s}
body.vui .vc{width:40px;justify-self:start;padding:0;cursor:pointer}
body.vui .vc svg,body.vui .vgl svg{width:21px;height:21px;display:block}
body.vui .vright{justify-self:end;display:flex}
body.vui .vgl{padding:0 4px;gap:2px;min-width:40px}
body.vui .vgl button{background:none;border:0;color:#fff;width:36px;height:36px;border-radius:999px;display:grid;place-items:center;padding:0;cursor:pointer;transition:transform .35s var(--v-sp),background .2s}
body.vui .vgl button.open,body.vui .vgl button:hover{background:rgba(255,255,255,.09)}
body.vui .vgl button svg{width:20px;height:20px}
body.vui .vp{transform:scale(.88)!important}
body.vui .vseg{position:relative;display:flex;align-items:center;gap:0;padding:0}
body.vui .vseg button{position:relative;z-index:1;background:none;border:0;color:#d4d4d8;font:600 15px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",Inter,system-ui,sans-serif;padding:10px 14px;border-radius:999px;cursor:pointer;transition:color .25s,transform .35s var(--v-sp)}
body.vui .vseg button.on{color:#fff}
body.vui .vseg-pill{position:absolute;left:0;top:50%;height:36px;margin-top:-18px;border-radius:999px;background:rgba(255,255,255,.14);transition:transform .45s var(--v-sp),width .45s var(--v-sp);z-index:0}
/* the same switch inside the Images screen */
body.vui #studio .sv-top{display:flex;justify-content:center;padding:calc(14px + env(safe-area-inset-top,0px)) 14px 0!important}
body.vui #studio .sv-top .vseg{margin:0 auto}
/* entrance */
body.v-in .vtop>*{animation:vin .7s var(--v-ez) both}
body.v-in .vtop>*:nth-child(2){animation-delay:.06s}body.v-in .vtop>*:nth-child(3){animation-delay:.12s}
@keyframes vin{from{opacity:0;transform:translateY(-14px) scale(.9)}to{opacity:1;transform:none}}

/* ---------- empty state: faint app icon ---------- */
html body.vui .greeting{display:flex!important;align-items:center;justify-content:center}
html body.vui .greeting .xg,html body.vui .greeting .g-d,html body.vui .greeting .g-m{display:none!important}
body.vui .vlogo{display:grid;place-items:center;animation:vlogo 1.1s .1s var(--v-ez) both}
body.vui .vlogo img{width:76px;height:76px;object-fit:contain;opacity:.2}
@keyframes vlogo{from{opacity:0;transform:scale(.7)}to{opacity:1;transform:none}}
body.vui:not(.v-empty) .vlogo{display:none}

/* ---------- messages ---------- */
html body.vui #mainChat .chatview .convo{padding-top:calc(72px + env(safe-area-inset-top,0px))!important}
html body.vui #msgs{max-width:var(--v-w);margin:0 auto;padding:0 16px 24px;width:100%;box-sizing:border-box}
html body.vui .m-uw{display:flex;flex-direction:column;align-items:flex-end;margin:10px 0 14px!important;gap:6px;background:none!important}
html body.vui #mainChat .m-user{background:#2a2a2c!important;border:0!important;box-shadow:none!important;color:#fff;font-size:15.5px;line-height:1.45;padding:9px 16px!important;border-radius:20px!important;max-width:min(82%,560px);width:fit-content;margin:0!important;word-break:break-word;overflow:hidden}
html body.vui .m-user .mu-t{white-space:pre-wrap;overflow-wrap:anywhere}
html body.vui .m-user.clamped:not(.expanded) .mu-t{max-height:calc(1.45em*5);overflow:hidden;-webkit-mask-image:linear-gradient(#000 calc(100% - 1.3em),transparent);mask-image:linear-gradient(#000 calc(100% - 1.3em),transparent)}
html body.vui .m-user.clamped.expanded .mu-t{max-height:none}
html body.vui .m-user .mu-t{transition:max-height .35s var(--v-ez)}
html body.vui .mu-more{background:none;border:0;color:#9aa0ff;font:600 13px/1 -apple-system,system-ui,sans-serif;padding:4px 8px 0;cursor:pointer;transition:transform .3s var(--v-sp),opacity .2s}
html body.vui .mu-more:hover{opacity:.8}
html body.vui .m-bot{margin:18px 0 22px!important;padding:0 4px;background:none!important}
html body.vui .m-bot .body{font-size:15.5px;line-height:1.55;color:#fff;background:none!important}
html body.vui .m-acts{display:flex!important;align-items:center;gap:2px;opacity:1!important;margin-top:10px;padding:0!important;background:none!important}
html body.vui .m-acts .icon-btn{width:30px!important;height:30px!important;min-height:0!important;color:#8e8e93!important;background:none!important;border:0!important;box-shadow:none!important;border-radius:8px;transition:transform .35s var(--v-sp),color .2s,background .2s}
html body.vui .m-acts .icon-btn:hover{color:#fff!important;background:rgba(255,255,255,.07)!important}
html body.vui .m-acts .icon-btn svg{width:17px!important;height:17px!important}
html body.vui .m-acts .icon-btn.on{color:#fff!important}
html body.vui .m-acts .sp{flex:1}
html body.vui .m-acts small{color:#6e6e73;font-size:11px;padding-right:4px;font-variant-numeric:tabular-nums}
body.v-in .m-bot .m-acts .icon-btn{animation:vin2 .5s var(--v-ez) both}
body.v-in .m-bot .m-acts .icon-btn:nth-child(2){animation-delay:.04s}body.v-in .m-bot .m-acts .icon-btn:nth-child(3){animation-delay:.08s}body.v-in .m-bot .m-acts .icon-btn:nth-child(4){animation-delay:.12s}body.v-in .m-bot .m-acts .icon-btn:nth-child(5){animation-delay:.16s}body.v-in .m-bot .m-acts .icon-btn:nth-child(6){animation-delay:.2s}body.v-in .m-bot .m-acts .icon-btn:nth-child(7){animation-delay:.24s}
@keyframes vin2{from{opacity:0;transform:translateY(6px) scale(.8)}to{opacity:1;transform:none}}
/* typing / thinking: small spinning dots */
html body.vui .think{display:inline-flex;align-items:center;gap:10px;color:#8e8e93;font-size:14px}

/* ---------- dock + composer ---------- */
html body.vui #mainChat .dock{background:none!important;padding:0 max(16px,env(safe-area-inset-left,0px)) calc(10px + env(safe-area-inset-bottom,0px))!important;border:0!important;box-shadow:none!important}
html body.vui #mainChat .dock::before,html body.vui #mainChat .dock::after{display:none!important}
html body.vui #mainChat .dock>*{max-width:var(--v-w);margin-left:auto!important;margin-right:auto!important;width:100%;box-sizing:border-box}
html body.vui #mainChat .dock .foot,html body.vui #mainChat .foot{display:none!important}
html body.vui #mainChat .composer{display:flex!important;flex-direction:column!important;gap:6px;align-items:stretch!important;grid-template-columns:none!important;padding:14px 12px 10px 16px!important;min-height:0!important;height:auto!important;border-radius:26px!important;background:#1c1c1e!important;border:1px solid rgba(255,255,255,.1)!important;box-shadow:0 10px 40px rgba(0,0,0,.5)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;transition:border-color .3s,box-shadow .3s,transform .5s var(--v-sp);transform:none!important;overflow:visible!important}
html body.vui #mainChat .composer.focus{border-color:rgba(255,255,255,.2)!important}
html body.vui #mainChat .composer::before,html body.vui #mainChat .composer::after{display:none!important}
body.v-in .composer{animation:vrise .8s .1s var(--v-sp) both}
@keyframes vrise{from{opacity:0;transform:translateY(40px)}to{opacity:1;transform:none}}
html body.vui #mainChat .composer>.vrow-t,html body.vui #mainChat .composer>.vrow-b{width:100%!important;max-width:none!important;margin:0!important;box-sizing:border-box;flex:none;position:static!important;transform:none!important}
html body.vui .vrow-t{display:block;min-width:0;padding:0 4px 0 0}
html body.vui #mainChat .composer #msg{display:block;width:100%!important;min-height:0!important;max-height:calc(1.5em*5)!important;height:auto;font:400 16px/1.5 -apple-system,BlinkMacSystemFont,"SF Pro Text",Inter,system-ui,sans-serif!important;color:#fff!important;background:none!important;border:0!important;outline:0!important;box-shadow:none!important;padding:0!important;margin:0!important;resize:none!important;overflow-y:hidden;-webkit-appearance:none;scrollbar-width:thin;scrollbar-color:#555 transparent;caret-color:#7b8cff}
html body.vui #msg::placeholder{color:#8e8e93!important;opacity:1}
html body.vui .vrow-b{display:flex;align-items:center;gap:8px;min-height:38px}
html body.vui .vgrow{flex:1}
html body.vui #mainChat .composer .icon-btn#attBtn{width:34px!important;height:34px!important;min-height:0!important;border-radius:50%!important;background:none!important;border:0!important;box-shadow:none!important;color:#d4d4d8!important;display:grid;place-items:center;padding:0!important;position:static!important;transition:transform .45s var(--v-sp),background .2s,color .2s}
html body.vui #attBtn.open{transform:rotate(45deg);background:rgba(255,255,255,.1)!important;color:#fff!important}
html body.vui #attBtn svg{width:21px!important;height:21px!important}
html body.vui #mainChat .composer #modeBtn{height:34px!important;min-height:0!important;padding:0 13px 0 10px!important;border-radius:999px!important;background:rgba(255,255,255,.07)!important;border:0!important;box-shadow:none!important;color:#e4e4e7!important;font:600 14px/1 -apple-system,system-ui,sans-serif!important;display:inline-flex;align-items:center;gap:6px;position:static!important;margin:0!important;flex:none}
html body.vui #modeBtn svg{width:16px!important;height:16px!important}
html body.vui .vmic{width:34px;height:34px;border-radius:50%;border:0;background:none;color:#a1a1a6;display:grid;place-items:center;padding:0;cursor:pointer;transition:transform .35s var(--v-sp),color .2s,background .2s;flex:none}
html body.vui .vmic svg{width:19px;height:19px}
html body.vui .vmic:hover{color:#fff}
html body.vui .vmic.on{color:#fff;background:#ff453a;animation:vpulse 1.1s ease-in-out infinite}
@keyframes vpulse{50%{box-shadow:0 0 0 7px rgba(255,69,58,.18)}}
/* send arrow / stop (white circle) and the Speak pill (white) */
html body.vui #mainChat .composer #sendBtn{display:none!important;width:36px!important;height:36px!important;min-height:0!important;border-radius:50%!important;background:#fff!important;color:#000!important;border:0!important;box-shadow:none!important;padding:0!important;place-items:center;position:static!important;margin:0!important;flex:none;transform:none}
html body.vui #mainChat .composer #sendBtn[data-has]:not([data-has=""]){display:grid!important;animation:vpop .45s var(--v-sp) both}
@keyframes vpop{from{opacity:0;transform:scale(.4) rotate(-40deg)}to{opacity:1;transform:none}}
html body.vui #sendBtn svg{width:19px!important;height:19px!important;stroke:#000!important;stroke-width:2.4}
html body.vui #speakBtn{height:36px;border:0;border-radius:999px;background:#fff;color:#000;font:600 15px/1 -apple-system,system-ui,sans-serif;padding:0 15px 0 12px;display:inline-flex;align-items:center;gap:7px;cursor:pointer;flex:none;transition:transform .35s var(--v-sp),background .2s}
html body.vui #speakBtn svg{width:18px;height:18px}
html body.vui #speakBtn.on{background:#ff453a;color:#fff}
html body.vui #sendBtn[data-has]:not([data-has=""])~#speakBtn{display:none}
/* chips */
html body.vui .vchips{display:none;margin-bottom:10px!important;overflow:hidden;position:relative;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
html body.vui.v-empty .vchips{display:block;animation:vrise .8s .2s var(--v-sp) both}
html body.vui.v-empty.v-typing .vchips{opacity:0;transform:translateY(10px);pointer-events:none;transition:opacity .25s,transform .25s}
html body.vui .vchips-in{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px 24px 2px 0}
html body.vui .vchips-in::-webkit-scrollbar{display:none}
html body.vui .vchips button{flex:none;display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 15px 0 12px;border-radius:999px;background:#1c1c1e;border:1px solid rgba(255,255,255,.06);color:#fff;font:600 14px/1 -apple-system,system-ui,sans-serif;cursor:pointer;transition:transform .35s var(--v-sp),background .2s}
html body.vui .vchips button:hover{background:#262628}
html body.vui .vchips button i{display:grid;place-items:center}
html body.vui .vchips button svg{width:17px;height:17px}

/* ---------- popovers (+ menu, ... menu) ---------- */
.vpop{position:fixed;z-index:200;min-width:210px;padding:7px;border-radius:24px;background:rgba(36,36,38,.78);-webkit-backdrop-filter:blur(30px) saturate(1.8);backdrop-filter:blur(30px) saturate(1.8);border:1px solid rgba(255,255,255,.09);box-shadow:0 18px 60px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.06);will-change:transform,opacity,filter;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",Inter,system-ui,sans-serif}
.vpop button{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:none;border:0;color:#fff;font-weight:600;font-size:15px;padding:0 14px 0 12px;height:44px;border-radius:16px;cursor:pointer;transition:background .15s,transform .3s var(--v-sp)}
.vpop button:hover,.vpop button:active{background:rgba(255,255,255,.08)}
.vpop button svg{width:20px;height:20px;flex:none;color:#b4b4ba}
.vpop button.red,.vpop button.red svg{color:#ff5a63}
.vpop .vsep{display:block;height:1px;margin:5px 12px;background:rgba(255,255,255,.1)}
.vmenu-pop{min-width:244px}

/* ---------- desktop ---------- */
@media(min-width:900px){
 html body.vui #msgs{padding-left:14px;padding-right:14px}
 html body.vui #mainChat .topbar{padding-left:18px!important;padding-right:18px!important}
}
/* ---------- phones ---------- */
@media(max-width:899px){
 html body.vui .vseg button{padding:10px 12px;font-size:14.5px}
 html body.vui #mainChat .dock{padding-left:14px!important;padding-right:14px!important}
 html body.vui .bnav-wrap{display:none!important}
}
@media(max-width:380px){html body.vui .vseg button{padding:10px 9px;font-size:13.5px}}
@media(prefers-reduced-motion:reduce){body.vui *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* build mode chips */
html body.vui .vchips button.vrefresh{width:38px;padding:0;justify-content:center;background:transparent;border:1px dashed rgba(255,255,255,.28);color:#b4b4ba}
html body.vui .vchips button.vrefresh svg{width:18px;height:18px}
html body.vui .vchips button.vrefresh.spin svg{animation:vrot .6s var(--v-ez)}
@keyframes vrot{to{transform:rotate(360deg)}}
@keyframes vchip{from{opacity:0;transform:translateY(10px) scale(.9)}to{opacity:1;transform:none}}
html body.vui.v-build #mainChat .composer{border-color:rgba(120,140,255,.28)!important}
html body.vui #attBtn::before,html body.vui #attBtn::after,html body.vui #modeBtn::before,html body.vui #modeBtn::after,html body.vui .vmic::before,html body.vui .vmic::after{display:none!important;content:none!important}
html body.vui #mainChat .composer #attBtn{border:0!important;outline:0!important;box-shadow:none!important;background:none!important}
html body.vui .vlogo img{border-radius:20px;opacity:.28}

/* ---- X <-> / animation back (fast), on the thinking label and on the stop button ---- */
html body.vui .think .think-x{display:inline-block!important;color:#fff}
html body.vui .think .think-x i:first-child{animation:xmmXArmA .9s cubic-bezier(.45,.05,.25,1) infinite!important}
html body.vui .think .think-x i:last-child{animation:xmmXArmB .9s cubic-bezier(.45,.05,.25,1) infinite!important}
html body.vui #sendBtn .stop-x{display:block!important;color:#000}
html body.vui #sendBtn.long-think .stop-x i:first-child{animation:xmmXArmA .9s cubic-bezier(.45,.05,.25,1) infinite!important}
html body.vui #sendBtn.long-think .stop-x i:last-child{animation:xmmXArmB .9s cubic-bezier(.45,.05,.25,1) infinite!important}
/* ---- app icon on the home screen: full brightness ---- */
html body.vui .vlogo img{opacity:1!important;filter:none!important;width:92px;height:92px;border-radius:22px;box-shadow:none}
/* ---- coding: the preview panel must always show (the phone layout hid it) ---- */
html body #code.preview-only .cd-r{display:flex!important;flex-direction:column}
html body #code.preview-only .cd-l{display:none!important}
html body #code.preview-only .cd-body{flex:1 1 auto;min-height:0}
html body #code.preview-only .cd-pv,html body #code.preview-only .cd-pv iframe{width:100%;height:100%;min-height:0}
html body #code.preview-only .cd-pv iframe{background:#fff;border:0;display:block}
/* ---- listening state ---- */
html body.vui #speakBtn.on{background:#ff453a;color:#fff;animation:vpulse 1.2s ease-in-out infinite}
/* ---- snappier, springier motion ---- */
html body.vui .vc,html body.vui .vgl button,html body.vui .vchips button,html body.vui .vpop button{transition-duration:.28s}
html body.vui .vseg-pill{transition:transform .38s cubic-bezier(.3,1.4,.4,1),width .38s cubic-bezier(.3,1.4,.4,1)}

html body.vui .vlogo img,html body.vui .vlogo{box-shadow:none!important;filter:none!important;text-shadow:none!important}
