.ec-site-chat{position:fixed;right:22px;bottom:24px;z-index:1100;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#f5faff}.ec-site-chat *{box-sizing:border-box}.ec-site-chat-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.ec-site-chat-launcher{display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;gap:8px;border:0;background:transparent;padding:0;cursor:pointer;color:#fff;font:inherit}.ec-site-chat-invitation{display:block;max-width:245px;padding:13px 15px;border:1px solid #3976af;border-radius:14px;background:linear-gradient(135deg,#0e2a4d,#132b50);box-shadow:0 10px 30px #0310247a;font-size:13px;line-height:1.4;font-weight:800;text-align:center}.ec-site-chat-bubble-icon{display:grid;place-items:center;width:62px;height:62px;flex:none;border-radius:50%;border:1px solid #29d5aa;background:linear-gradient(140deg,#087fba,#00bd94);font-size:27px;box-shadow:0 11px 28px #00c5a13d,0 8px 27px #02142d}.ec-site-chat-launcher:hover .ec-site-chat-bubble-icon,.ec-site-chat-launcher:focus-visible .ec-site-chat-bubble-icon{transform:translateY(-3px);box-shadow:0 0 25px #26d6a777}.ec-site-chat-panel{position:absolute;right:0;bottom:78px;width:min(388px,calc(100vw - 24px));height:min(540px,calc(100dvh - 115px));display:flex;flex-direction:column;border-radius:19px;border:1px solid #2d567a;background:#0a1930;box-shadow:0 22px 65px #020713c7;overflow:hidden}.ec-site-chat-panel[hidden]{display:none!important}.ec-site-chat-head{display:flex;align-items:center;gap:10px;background:linear-gradient(115deg,#092744,#073c49);padding:14px;border-bottom:1px solid #265679}.ec-site-chat-head img{width:100px;height:42px;object-fit:contain;object-position:center}.ec-site-chat-head-copy{min-width:0;display:flex;flex-direction:column;gap:4px;flex:1}.ec-site-chat-head-copy strong{font-size:14px;color:#fff}.ec-site-chat-head-copy small{font-size:11px;color:#a1c8d9}.ec-site-chat-close{border:1px solid #5a7d91;background:#13334e;color:#fff;border-radius:10px;font-size:24px;line-height:1;width:37px;height:37px;cursor:pointer}.ec-site-chat-close:hover{background:#235478}.ec-site-chat-list{flex:1;overflow:auto;padding:18px 14px;background:linear-gradient(155deg,#10243d,#0a1930);display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}.ec-site-chat-welcome,.ec-site-chat-message{padding:12px 14px;border-radius:13px;font-size:13px;line-height:1.55;max-width:88%;white-space:pre-wrap;overflow-wrap:anywhere}.ec-site-chat-welcome,.ec-site-chat-message.agent{background:#193a57;border:1px solid #345876;color:#fff;align-self:flex-start;border-bottom-left-radius:4px}.ec-site-chat-message.customer{background:linear-gradient(135deg,#0a987e,#087db0);align-self:flex-end;color:#fff;border-bottom-right-radius:4px}.ec-site-chat-status{min-height:18px;padding:0 15px 4px;color:#b8cce1;font-size:11px;background:#0a1930}.ec-site-chat-form{display:flex;gap:8px;padding:11px;border-top:1px solid #28435e;background:#102037}.ec-site-chat-form textarea{flex:1;min-width:0;max-height:110px;resize:vertical;padding:11px;border-radius:11px;border:1px solid #365d7c;background:#07182c;color:#fff;font:inherit;font-size:13px}.ec-site-chat-form textarea::placeholder{color:#95a8bf}.ec-site-chat-form button{width:43px;align-self:stretch;border:0;border-radius:11px;background:#0ac39d;color:#042337;font-size:23px;cursor:pointer}.ec-site-chat-form button:disabled{opacity:.55;cursor:wait}.ec-site-chat-disclaimer{font-size:10px;line-height:1.4;text-align:center;color:#8fb1c5;background:#102037;margin:0;padding:0 10px 9px}.ec-site-chat-disclaimer a{color:#81d9d4;text-decoration:underline}.ec-site-chat :focus-visible{outline:2px solid #55edd5;outline-offset:3px}@media(max-width:600px){.ec-site-chat{bottom:14px;right:12px}.ec-site-chat-invitation{font-size:11px;max-width:183px;padding:10px}.ec-site-chat-bubble-icon{width:55px;height:55px}.ec-site-chat-panel{bottom:70px;height:min(530px,calc(100dvh - 100px));width:min(365px,calc(100vw - 24px))}}@media(prefers-reduced-motion:reduce){.ec-site-chat-bubble-icon{transition:none!important;transform:none!important}}

/* Estoria Commerce bot avatar - visitor site-chat launcher only.
   The actual chat panel, API and Telegram flows remain unchanged. */
.ec-site-chat{bottom:calc(18px + var(--ec-chat-extra-offset, 0px));right:18px;transition:bottom .2s ease}
.ec-site-chat-launcher{gap:4px;align-items:flex-end;max-width:min(236px,calc(100vw - 28px))}
.ec-site-chat-invitation{max-width:214px;line-height:1.4;padding:10px 12px;border-color:#2779b5;border-radius:12px;box-shadow:0 8px 22px #00172b50;font-size:12px}
.ec-site-chat-robot,.ec-site-chat-robot picture{display:block;width:150px;max-width:100%;height:auto}
.ec-site-chat-robot{position:relative;filter:drop-shadow(0 8px 9px #0a244b38);transform-origin:50% 100%;animation:ec-chat-robot-idle 5.8s ease-in-out infinite}
.ec-site-chat-robot img{display:block;width:100%;height:auto;object-fit:contain;user-select:none;-webkit-user-drag:none;pointer-events:none}
.ec-site-chat-launcher:hover .ec-site-chat-robot,.ec-site-chat-launcher:focus-visible .ec-site-chat-robot{filter:drop-shadow(0 9px 13px #087cb45c);animation-play-state:paused;transform:scale(1.035)}
.ec-site-chat-panel{bottom:0;height:min(540px,calc(100dvh - 48px));max-height:calc(100dvh - 48px)}
.ec-site-chat.is-open .ec-site-chat-launcher{visibility:hidden;pointer-events:none}
@keyframes ec-chat-robot-idle{0%,12%,52%,100%{transform:translateY(0)}28%{transform:translateY(-3px)}39%{transform:translateY(0)}}
@media(max-width:600px){
  .ec-site-chat{right:10px;bottom:calc(10px + var(--ec-chat-extra-offset, 0px))}
  .ec-site-chat-robot,.ec-site-chat-robot picture{width:118px}
  .ec-site-chat-invitation{font-size:11px;max-width:183px;padding:9px 10px}
  .ec-site-chat-panel{bottom:0;width:min(365px,calc(100vw - 20px));height:min(530px,calc(100dvh - 26px));max-height:calc(100dvh - 26px)}
}
@media(max-height:570px){.ec-site-chat-robot,.ec-site-chat-robot picture{width:102px}.ec-site-chat-invitation{font-size:10px;padding:7px 8px}.ec-site-chat-panel{height:calc(100dvh - 28px)}}
@media(prefers-reduced-motion:reduce){.ec-site-chat{transition:none}.ec-site-chat-robot{animation:none!important}.ec-site-chat-launcher:hover .ec-site-chat-robot,.ec-site-chat-launcher:focus-visible .ec-site-chat-robot{transform:none}}

/* Mobile quick-CTA + visitor robot: avoid overlapping two fixed affordances. */
@media(max-width:690px){
  body:has(.ec-mobile-phase-cta) .ec-site-chat:not(.is-open){bottom:calc(83px + var(--ec-chat-extra-offset,0px));right:10px}
  body:has(.ec-mobile-phase-cta) .ec-site-chat:not(.is-open) .ec-site-chat-robot,
  body:has(.ec-mobile-phase-cta) .ec-site-chat:not(.is-open) .ec-site-chat-robot picture{width:78px}
  body:has(.ec-mobile-phase-cta) .ec-site-chat:not(.is-open) .ec-site-chat-invitation{max-width:146px;font-size:10px;padding:6px 8px}
  body:has(.ec-mobile-phase-cta) .ec-site-chat.is-open{bottom:12px}
  body:has(.ec-mobile-phase-cta) .ec-site-chat.is-open .ec-site-chat-panel{height:min(530px,calc(100dvh - 28px))}
}


/* M197 actual-phone layout: use measured CTA geometry (not a fixed 83 px guess).
   The body classes are installed by site-visitor-chat.js for browsers that do
   not implement :has() and when dynamic viewport / text scaling changes. */
@media(max-width:690px){
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open){
    bottom:calc(var(--ec-chat-dock-offset, max(98px, calc(86px + env(safe-area-inset-bottom, 0px)))) + var(--ec-chat-extra-offset, 0px));
    right:max(10px, env(safe-area-inset-right, 0px));
  }
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot,
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot picture{width:78px}
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-invitation{max-width:146px;font-size:10px;padding:6px 8px}
  body.ec-chat-panel-open .ec-mobile-phase-cta,
  body.ec-consent-ui-open .ec-mobile-phase-cta{display:none!important}
  body.ec-has-mobile-cta .ec-site-chat.is-open{bottom:max(12px, env(safe-area-inset-bottom, 0px))}
  body.ec-has-mobile-cta .ec-site-chat.is-open .ec-site-chat-panel{height:min(530px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
  /* Preserve robot access while reducing the invitation on short real viewports. */
}
@media(max-width:690px) and (max-height:540px){
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-invitation{font-size:9px;padding:5px 7px}
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot,
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot picture{width:66px}
}

/* The open panel is viewport anchored. Anchoring it to the hidden launcher's
   element box put its heading above the viewport on short real phones. */
@media(max-width:690px){
  body.ec-has-mobile-cta .ec-site-chat.is-open .ec-site-chat-panel,
  .ec-site-chat.is-open .ec-site-chat-panel{
    position:fixed;
    right:max(10px, env(safe-area-inset-right, 0px));
    bottom:max(12px, env(safe-area-inset-bottom, 0px));
    width:min(365px,calc(100vw - 20px));
    height:min(530px,calc(100dvh - 32px));
    max-height:calc(100dvh - 32px);
  }
}


/* M197: lean mobile robot prompt and message panel. The robot animation,
   send/poll logic, close controls and approved CTA offset remain unchanged. */
@media screen and (max-width:690px){
  .ec-site-chat:not(.is-open) .ec-site-chat-launcher{gap:3px;max-width:min(172px,calc(100vw - 24px))}
  .ec-site-chat:not(.is-open) .ec-site-chat-invitation,
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-invitation{
    max-width:136px;
    padding:5px 7px;
    border-radius:9px;
    font-size:10px;
    line-height:1.25;
    box-shadow:0 5px 14px rgba(0,0,0,.26);
  }
  .ec-site-chat:not(.is-open) .ec-site-chat-robot,
  .ec-site-chat:not(.is-open) .ec-site-chat-robot picture,
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot,
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot picture{width:68px}
  body.ec-has-mobile-cta .ec-site-chat.is-open .ec-site-chat-panel,
  .ec-site-chat.is-open .ec-site-chat-panel{
    position:fixed;
    top:auto;
    right:max(8px, env(safe-area-inset-right, 0px));
    bottom:max(8px, env(safe-area-inset-bottom, 0px));
    width:min(338px, calc(100vw - 16px));
    height:min(440px, calc(var(--ec-chat-visible-height, 100dvh) - 22px - env(safe-area-inset-bottom, 0px)));
    max-height:calc(var(--ec-chat-visible-height, 100dvh) - 22px - env(safe-area-inset-bottom, 0px));
    border-radius:14px;
  }
  .ec-site-chat-head{padding:8px 10px;gap:7px}
  .ec-site-chat-head img{width:72px;height:32px}
  .ec-site-chat-head-copy{gap:2px}
  .ec-site-chat-head-copy strong{font-size:13px}
  .ec-site-chat-head-copy small{font-size:10px}
  .ec-site-chat-close{min-width:42px;min-height:42px;width:42px;height:42px;font-size:22px}
  .ec-site-chat-list{padding:10px;gap:7px}
  .ec-site-chat-welcome,.ec-site-chat-message{padding:9px 10px;font-size:12px;line-height:1.45}
  .ec-site-chat-status{min-height:15px;font-size:10px;padding:0 10px 3px}
  .ec-site-chat-form{padding:7px;gap:6px}
  .ec-site-chat-form textarea{padding:8px;min-height:42px;font-size:12px;line-height:1.35;resize:none}
  .ec-site-chat-form button{width:42px;min-width:42px;min-height:42px;border-radius:9px}
  .ec-site-chat-disclaimer{padding:0 8px 6px;font-size:9px}
}
@media screen and (max-width:690px) and (max-height:540px){
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot,
  body.ec-has-mobile-cta .ec-site-chat:not(.is-open) .ec-site-chat-robot picture{width:58px}
  body.ec-has-mobile-cta .ec-site-chat.is-open .ec-site-chat-panel,
  .ec-site-chat.is-open .ec-site-chat-panel{height:calc(100dvh - 20px - env(safe-area-inset-bottom, 0px))}
}
