/* Theme-aware lens, shared by Analytics and customer detail; preserve the compact composer layout. */
html body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill .fast{display:none}
html body.shopify:is([data-view="analytics"],:has(.customer-workspace)):not(.email-canvas-mode) .composer{
  bottom:calc(6px + env(safe-area-inset-bottom,0px));
  right:0;
}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill,
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill:has(.send.voice-session){
  background:transparent!important;
  color:#f5f5f7;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  border:1px solid transparent!important;
  box-shadow:0 4px 12px rgba(15,23,42,.10),0 14px 36px -8px rgba(15,23,42,.24);
  box-sizing:border-box;
}
html[data-theme="dark"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)){--analytics-composer-background:#000}
html[data-theme="dark"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill{color:#f5f5f7;border-color:#303033;box-shadow:0 4px 14px rgba(0,0,0,.45),0 16px 40px -6px rgba(0,0,0,.7)}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::before{
  z-index:-2!important;
  pointer-events:none;
  content:""!important;
  background:var(--composer-custom-background,rgba(0,0,0,var(--composer-tint-alpha,.68)))!important;
  opacity:var(--composer-custom-opacity,1);
  backdrop-filter:blur(var(--composer-blur,6px)) saturate(1.12)!important;
  -webkit-backdrop-filter:blur(var(--composer-blur,6px)) saturate(1.12)!important;
  box-shadow:none;
}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::after{
  z-index:-1!important;
  pointer-events:none;
  content:""!important;
  background:transparent!important;
  padding:5px;
  border:0;
  box-sizing:border-box;
  backdrop-filter:var(--analytics-lens,none);
  -webkit-backdrop-filter:var(--analytics-lens,none);
}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer #inp:not(.composer-rich){
  color:inherit!important;-webkit-text-fill-color:currentColor!important;
  background:none!important;
}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer #inp::placeholder{color:currentColor;-webkit-text-fill-color:currentColor;opacity:.85}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill .ic,
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill .send:not(.on){color:#f5f5f7!important}
html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill{color:#202022}
html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::before{background:var(--composer-custom-background,rgba(255,255,255,var(--composer-tint-alpha,1)))!important}
html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill[data-glass-editing]::after{border:0;padding:0;mask:none!important;-webkit-mask:none!important}
html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::after{border-color:#dedfe2}
html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill .ic,
html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill .send:not(.on){color:#202022!important}
/* Inherit New Chat's theme-aware shimmer palette and shared phchime timing. */
@media(min-width:721px){
  html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer #inp::placeholder{color:transparent!important;-webkit-text-fill-color:transparent!important;opacity:0}
}
/* Reuse New Chat's cursor-led rim, independently of the optical backdrop. */
body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .analytics-chat-rim{position:absolute;inset:0;z-index:0;pointer-events:none;border-radius:inherit;padding:1px;opacity:var(--composer-rim-alpha,1);background:radial-gradient(ellipse at var(--glass-x,8%) var(--glass-y,12%),rgba(255,255,255,.52),transparent 48%),radial-gradient(ellipse at var(--glass-reflect-x,95%) var(--glass-reflect-y,92%),rgba(255,255,255,.22),transparent 46%),rgba(255,255,255,.075);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .analytics-chat-rim{background:radial-gradient(ellipse at var(--glass-x,8%) var(--glass-y,12%),rgba(255,255,255,.98),transparent 60%),radial-gradient(ellipse at var(--glass-reflect-x,95%) var(--glass-reflect-y,92%),rgba(93,110,135,.28),transparent 58%),rgba(255,255,255,.40)}
@media(prefers-reduced-motion:reduce){html body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)) .composer .pill .ph-chime{animation:none!important;-webkit-text-fill-color:var(--ph-base);color:var(--ph-base)}}
@media(prefers-reduced-transparency:reduce){
  html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::after{
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
  html[data-theme] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::before{
    background:#000!important;
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
}
@media(prefers-reduced-transparency:reduce){
  html[data-theme="light"] body:is([data-view="analytics"],[data-view="messages"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill::before{background:#fff!important}
}
/* Share optics, not Analytics\' compact dimensions or route offsets. */
html[data-theme] body:is([data-view="analytics"],:has(.customer-workspace)):not(.email-canvas-mode) .composer .pill{max-width:320px;padding:2px 4px;gap:4px}
html[data-theme] body.shopify[data-view="messages"]:not(.email-canvas-mode) .main>.composer{bottom:calc(24px + env(safe-area-inset-bottom,0px))!important}

/* Gridbox progressive top edge, shared by every Inbox conversation type. */
body[data-view="messages"] .sf-message-main>.chat-progressive-blur{
  position:absolute;inset:0 0 auto;height:var(--gridbox-blur-height,120px);
  border-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;
  overflow:hidden;pointer-events:none;z-index:4;background:transparent;
}
body[data-view="messages"] .chat-progressive-blur>div{
  position:absolute;inset:0;pointer-events:none;
  backdrop-filter:blur(var(--gridbox-blur-radius)) saturate(120%);
  -webkit-backdrop-filter:blur(var(--gridbox-blur-radius)) saturate(120%);
  mask-image:var(--gridbox-blur-mask);-webkit-mask-image:var(--gridbox-blur-mask);
}
body[data-view="messages"] .sf-message-main .agx-top{
  backdrop-filter:none;-webkit-backdrop-filter:none;
}
body[data-view="messages"] .agx-top>:is(.agx-agent-wrap,.agx-top-actions){z-index:1}
@media(prefers-reduced-transparency:reduce){
  body[data-view="messages"] .sf-message-main>.chat-progressive-blur{display:none}
  html[data-theme] body.shopify[data-view="messages"] .sf-message-main .agx-top{background:var(--sf-surface)}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  body[data-view="messages"] .sf-message-main>.chat-progressive-blur{display:none}
  html[data-theme] body.shopify[data-view="messages"] .sf-message-main .agx-top{background:var(--sf-surface)}
}
@media(forced-colors:active){
  body[data-view="messages"] .sf-message-main>.chat-progressive-blur{display:none}
  html[data-theme] body.shopify[data-view="messages"] .sf-message-main .agx-top{background:Canvas}
}
/* Give the final conversation the same 10px gutter as the list sides. */
html body.shopify[data-view="messages"] .sf-message-workspace-history .sf-message-previews-clip{padding-bottom:10px;scroll-padding-bottom:10px}
html body.shopify[data-view="messages"] .sf-message-workspace-history .sf-message-previews-clip>.sf-message-swipe:last-child{margin-bottom:0}
html[data-theme="dark"] body[data-view="messages"]{--inbox-edge-surface:#000}
html[data-theme="light"] body[data-view="messages"]{--inbox-edge-surface:#fff}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation{height:100%;min-height:0;display:flex;flex-direction:column}
/* The transcript fills the panel; the identity and actions float above it.
   Only the decorative backdrop fades, never the scrollport or its contents. */
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation .agx-top{
  position:absolute;inset:0 0 auto;min-height:96px;height:96px;box-sizing:border-box;
  display:flex;justify-content:center;
  padding:10px 22px 12px;z-index:5;background:transparent;pointer-events:none;
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation .agx-top :is(.agx-agent-wrap,.agx-top-actions){pointer-events:auto}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation #sfMsgThread{
  flex:1 1 0;min-height:0;height:100%;overflow-y:auto;overflow-x:hidden;display:block;
  padding-top:116px!important;scroll-padding-top:116px;
  padding-bottom:max(112px,calc(var(--ai-composer-clearance,150px) + env(safe-area-inset-bottom,0px)))!important;
  scroll-padding-bottom:max(112px,calc(var(--ai-composer-clearance,150px) + env(safe-area-inset-bottom,0px)));
}
/* Only the outer thread scrolls. Nested transcript padding otherwise creates
   a second clearance zone while flex sizing can squeeze the final actions. */
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation #ag-chat-msgs{flex:none;height:auto;overflow:visible;padding-top:0!important;padding-bottom:0!important}
/* Inbox inherits Analytics' saved transparent glass tint and optical layers. */
/* Match the existing 770px Inbox composer even with the older shell's
   ID-specific padding reset. Both transcript renderers share this column. */
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation #sfMsgThread{
  box-sizing:border-box;
  padding-left:max(22px,calc((100% - 770px) / 2))!important;
  padding-right:max(22px,calc((100% - 770px) / 2))!important;
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation #ag-chat-msgs{
  box-sizing:border-box;width:100%;max-width:770px;min-width:0;margin-inline:auto;padding-left:0!important;padding-right:0!important;
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation .guided-work{
  box-sizing:border-box;width:100%;max-width:770px;min-width:0;margin-inline:auto;padding-inline:0;
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation :is(.agx-turn,.sf-message-row,.guided-message){min-width:0;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
@media(max-width:720px){
  html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation #sfMsgThread{padding-left:18px!important;padding-right:22px!important}
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation .agx-top::before{
  content:none!important;display:none!important;
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation .agx-top>.agx-agent-wrap{position:relative;z-index:1}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main.ai-conversation .agx-top-actions{z-index:1}
html[data-theme] body.shopify[data-view="messages"] .main>.composer::before{
  content:none!important;display:none!important;
}
html[data-theme] body.shopify[data-view="messages"] .sf-message-main>.sf-message-top-blur{display:none!important}
html[data-theme] body.shopify[data-view="messages"] .main>.composer .pill{position:relative;z-index:1}
@media(prefers-reduced-transparency:reduce){
  html[data-theme] body.shopify[data-view="messages"] :is(.main>.composer,.sf-message-main.ai-conversation .agx-top)::before{backdrop-filter:none;-webkit-backdrop-filter:none}
}
@media(forced-colors:active){
  html[data-theme] body.shopify[data-view="messages"] :is(.main>.composer,.sf-message-main.ai-conversation .agx-top)::before{display:none!important}
}
