/* Chat-first iPhone beta. Scope every rule to the opt-in native body class. */
body.shuton-chat-first-ios #stage.shuton-conversation-stage{
 position:relative!important;isolation:isolate;
 width:100%!important;display:block!important;
 height:min(57dvh,610px)!important;min-height:340px!important;
 overflow:hidden!important;padding:0!important;
 background:linear-gradient(145deg,#041b34,#092c5b)!important;border:1px solid #286ab2!important;
 border-radius:22px!important;
}
body.shuton-chat-first-ios #stage.shuton-conversation-stage.shuton-history-visible
 :is(.avatar-motion,.scene-backdrop,.ambient-field,.presence-glow,.shade,.avatar-caption,.voice-orbit,.presence-topbar,.presence-controls){
 display:none!important;
}
body.shuton-chat-first-ios #stage #shutonConversationViewport{
 position:absolute!important;inset:0!important;z-index:100!important;
 display:flex!important;flex-direction:column!important;
 min-width:0!important;min-height:0!important;
 background:linear-gradient(145deg,#031629,#092653)!important;overflow:hidden!important;
}
body.shuton-chat-first-ios #stage #shutonConversationViewport[hidden]{display:none!important}
body.shuton-chat-first-ios #stage #shutonConversationViewport .shuton-stage-history{
 display:flex!important;flex-direction:column!important;flex:1 1 auto!important;
 position:static!important;inset:auto!important;z-index:auto!important;
 width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
 margin:0!important;padding:12px!important;border:0!important;border-radius:0!important;
 opacity:1!important;visibility:visible!important;transform:none!important;
 overflow:hidden!important;pointer-events:auto!important;
 background:transparent!important;box-shadow:none!important;color:#f9fbff!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history :is(.sheet-handle,#transcriptCloseBtn){display:none!important}
body.shuton-chat-first-ios #stage .shuton-stage-history .sheet-head{
 display:flex!important;flex:0 0 auto!important;align-items:center!important;
 border-bottom:1px solid #265184!important;margin-bottom:8px!important;padding-bottom:7px!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .sheet-head :is(h3,.section-kicker){
 color:#f6faff!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat{
 display:flex!important;flex-direction:column!important;flex:1 1 auto!important;
 min-height:0!important;max-height:none!important;gap:11px!important;
 overflow-y:auto!important;overflow-x:hidden!important;
 padding:4px 2px 12px!important;overscroll-behavior:contain!important;
 -webkit-overflow-scrolling:touch;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat .bubble{
 flex-shrink:0!important;max-width:91%!important;padding:12px 14px!important;
 font-size:18px!important;line-height:1.55!important;
 word-break:normal!important;overflow-wrap:anywhere!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .bubble.bot{
 color:#ffffff!important;background:linear-gradient(145deg,#1a416f,#103159)!important;border:1px solid #3a75b2!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .bubble.user{
 color:#ffffff!important;background:#1f5db0!important;border:1px solid #5387e3!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history :is(.sources,.sources a){color:#8ed4ff!important}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat-actions{
 flex:0 0 auto!important;min-height:28px!important;
}
body.shuton-chat-first-ios #currentReply,
body.shuton-chat-first-ios #transcriptToggle,
body.shuton-chat-first-ios .candidate-mode-switch,
body.shuton-chat-first-ios .avatar-live-toolbar,
body.shuton-chat-first-ios .shuton-obsolete-visual{
 display:none!important;
}
body.shuton-chat-first-ios .shuton-live-entry{
 display:block;width:calc(100% - 28px);margin:8px 14px 12px;
 padding:12px 18px;background:#153964;border:1px solid #3b78be;
 border-radius:14px;color:#fff;font-weight:700;font-size:15px;
 position:relative;z-index:1;text-align:center;
}
body.shuton-chat-first-ios.shuton-free-local-usage :is(.usage-meter,.usage-percent){display:none!important}
@media(prefers-reduced-motion:reduce){body.shuton-chat-first-ios #stage *{scroll-behavior:auto!important}}

/* Primary hands-free control must remain prominent, separate from AvatarLive. */
body.shuton-chat-first-ios #handsFreeBtn{
 display:flex!important;align-items:center!important;justify-content:center!important;
 width:calc(100% - 28px)!important;min-height:58px!important;
 margin:10px 14px 14px!important;padding:13px 18px!important;
 border-radius:16px!important;border:2px solid #8ebeff!important;
 background:#2165d4!important;color:#ffffff!important;
 font-size:18px!important;font-weight:750!important;letter-spacing:.01em!important;
 text-align:center!important;box-shadow:0 4px 14px #10294c44!important;
 opacity:1!important;visibility:visible!important;pointer-events:auto!important;
 position:relative!important;z-index:2!important;
}
body.shuton-chat-first-ios #handsFreeBtn[aria-pressed="true"]{
 background:#135849!important;border-color:#73e9c4!important;
}
body.shuton-chat-first-ios #handsFreeBtn:focus-visible{
 outline:3px solid #f4bf50!important;outline-offset:3px!important;
}

/* Approved two-button membership/navigation row; no simulated system chrome. */
body.shuton-chat-first-ios .shuton-plans-bar{
 display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
 gap:10px;margin:7px 12px 14px;align-items:stretch;
}
body.shuton-chat-first-ios .shuton-plans-bar .shuton-plan-entry{
 display:flex!important;align-items:center;justify-content:space-between;gap:8px;
 min-width:0;min-height:91px;padding:12px 10px;border-radius:18px;
 color:#fff!important;font-size:16px!important;text-align:left;font-weight:700;
 background:linear-gradient(135deg,#093c75,#07569e);
 border:2px solid #2e98ff;box-shadow:0 3px 14px #001a4066;
}
body.shuton-chat-first-ios .shuton-plans-bar .shuton-live-entry{
 width:auto!important;margin:0!important;
 background:linear-gradient(135deg,#322577,#472a91)!important;
 border-color:#986ce7!important;font-size:16px!important;
}
body.shuton-chat-first-ios .shuton-plans-bar .shuton-plan-entry:focus-visible{
 outline:3px solid #ffe089;outline-offset:2px;
}
body.shuton-chat-first-ios .shuton-plans-bar .plan-icon{font-size:21px;flex:none}
body.shuton-chat-first-ios .shuton-plans-bar .plan-copy{display:flex;flex:1;flex-direction:column;min-width:0;gap:5px}
body.shuton-chat-first-ios .shuton-plans-bar .plan-copy strong{color:#fff;font-size:16px;line-height:1.2}
body.shuton-chat-first-ios .shuton-plans-bar .plan-copy small{color:#e4edff;font-size:12px;line-height:1.25;font-weight:400}
body.shuton-chat-first-ios #stage .shuton-stage-history .sheet-head h3{font-size:clamp(23px,5vw,28px)!important;line-height:1.2!important}
body.shuton-chat-first-ios #stage .shuton-stage-history .sheet-head .section-kicker{color:#5ec1ff!important}
body.shuton-chat-first-ios #stage .shuton-stage-history #tempToggle{display:none!important}
body.shuton-chat-first-ios #stage .shuton-stage-history #sourceHint{display:none!important}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat-actions:has(#retryBtn.hidden){display:none!important}
body.shuton-chat-first-ios .avatar-live-toolbar{display:none!important}
@media(max-width:390px){
 body.shuton-chat-first-ios .shuton-plans-bar{gap:8px;margin-inline:10px}
 body.shuton-chat-first-ios .shuton-plans-bar .shuton-plan-entry{padding:10px 7px;min-height:86px}
 body.shuton-chat-first-ios .shuton-plans-bar .plan-copy strong{font-size:14px}
 body.shuton-chat-first-ios .shuton-plans-bar .plan-copy small{font-size:11px}
}

/* Header repair: preserve the ORIGINAL single-row header; only add a small logo. */
.shuton-brand-icon{display:none;width:28px;height:28px;flex:0 0 28px;border-radius:7px;object-fit:cover;vertical-align:middle}
body.shuton-chat-first-ios header.top{
 flex-wrap:nowrap!important;align-items:center!important;justify-content:space-between!important;
 gap:6px!important;min-height:70px!important;
 padding-inline:12px!important;
}
body.shuton-chat-first-ios header.top .brand{
 display:inline-flex!important;flex:0 1 auto!important;align-items:center!important;
 gap:5px!important;white-space:nowrap!important;min-width:0!important;
 font-size:26px!important;
}
body.shuton-chat-first-ios header.top .brand .shuton-brand-icon{display:block}
body.shuton-chat-first-ios header.top .top-actions{
 display:flex!important;flex:0 1 auto!important;flex-wrap:nowrap!important;
 align-items:center!important;justify-content:flex-end!important;
 gap:4px!important;min-width:0!important;
}
body.shuton-chat-first-ios header.top .top-actions .usage-battery{
 white-space:nowrap!important;flex-shrink:0!important;
}
@media(max-width:390px){
 body.shuton-chat-first-ios header.top{padding-inline:9px!important;gap:4px!important}
 body.shuton-chat-first-ios header.top .brand{gap:4px!important;font-size:clamp(21px,5.6vw,25px)!important}
 body.shuton-chat-first-ios header.top .brand .shuton-brand-icon{width:24px;height:24px;flex-basis:24px}
 body.shuton-chat-first-ios header.top .top-actions{gap:2px!important}
}

/* Hide the obsolete Classic selector, including the competing !important rule
   in release-ui-103.css. AvatarLive itself remains available via its new button. */
body.shuton-chat-first-ios.shuton-103-candidate .avatar-live-toolbar,
body.shuton-chat-first-ios .presence-shell .avatar-live-toolbar,
body.shuton-chat-first-ios .avatar-live-toolbar[aria-hidden="true"]{
 display:none!important;
}

/* Final approved main-screen grid: identical left/right edges.
   No colors, fonts, card contents or button behaviors are changed. */
body.shuton-chat-first-ios .home-screen{
 padding-left:14px!important;padding-right:14px!important;
}
body.shuton-chat-first-ios .home-screen > .presence-shell{
 width:100%!important;margin-left:0!important;margin-right:0!important;
}
body.shuton-chat-first-ios .home-screen .shuton-plans-bar{
 margin-left:0!important;margin-right:0!important;
}
body.shuton-chat-first-ios .home-screen #stage.shuton-conversation-stage{
 width:100%!important;max-width:100%!important;
 margin-left:0!important;margin-right:0!important;
}
body.shuton-chat-first-ios .home-screen > .ask-shell{
 width:100%!important;max-width:100%!important;
 margin-left:0!important;margin-right:0!important;
}
@media(max-width:390px){
 body.shuton-chat-first-ios .home-screen{padding-left:12px!important;padding-right:12px!important}
 body.shuton-chat-first-ios .home-screen .shuton-plans-bar{margin-left:0!important;margin-right:0!important}
}


/* One scroll container for the ENTIRE conversation. A message must never
   have its own scroll bar or be cut off, including long answers and sources.
   Long messages occupy their natural height; the transcript alone scrolls. */
body.shuton-chat-first-ios #stage .shuton-stage-history .chat{
 scroll-behavior:auto!important;scroll-padding-top:0!important;
 align-content:flex-start!important;gap:7px!important;
 padding:3px 2px 7px!important;overflow-y:auto!important;
 overflow-x:hidden!important;overscroll-behavior-y:contain!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat > .bubble{
 max-height:none!important;height:auto!important;min-height:0!important;
 overflow:visible!important;overscroll-behavior:auto!important;
 flex:0 0 auto!important;font-size:16px!important;
 line-height:1.4!important;padding:9px 11px!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat .response-provenance{
 display:none!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat > .bubble:focus-visible{
 outline:2px solid #8ed4ff!important;outline-offset:2px!important;
}
body.shuton-chat-first-ios #stage .shuton-stage-history .chat .feedback-row{
 margin-top:4px!important;
}

/* Downloadable files stay discoverable even when the reply text is long. */
body.shuton-chat-first-ios #stage .shuton-stage-history .chat .bubble.bot .generated-files{
 position:static!important;z-index:auto!important;
 background:transparent!important;padding-block:5px!important;
}
