/* Keep the widget independent of the page theme and reserve room for its form. */
#ssch-root *{font-family:inherit;letter-spacing:normal}
#ssch-root .ssch-panel{height:600px}
#ssch-root .ssch-head{flex-shrink:0;padding:14px 16px}
#ssch-root .ssch-title{font-family:inherit;font-weight:700}
#ssch-root .ssch-note{flex-shrink:0;line-height:1.45;padding:8px 16px}
#ssch-root .ssch-history{min-height:90px;padding:12px 16px}
#ssch-root .ssch-panel,#ssch-root textarea{scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior:contain}
#ssch-root .ssch-panel::-webkit-scrollbar,#ssch-root textarea::-webkit-scrollbar{display:none;width:0;height:0}
#ssch-root .ssch-welcome{flex-shrink:0;padding:4px 0;line-height:1.4}
#ssch-root .ssch-welcome strong{font-family:inherit;font-size:21px;font-weight:700;line-height:1.3;margin:0 0 6px}
#ssch-root .ssch-state{flex-shrink:0;line-height:1.4}
#ssch-root .ssch-state:empty{display:none}
#ssch-root .ssch-form{flex-shrink:0;margin:0;padding:10px 16px 12px}
#ssch-root .ssch-label{line-height:1.4;margin:6px 0 4px}
#ssch-root input{height:42px;min-height:42px;line-height:20px;margin:0;padding:10px 12px}
#ssch-root textarea{height:64px;min-height:64px;line-height:21px;resize:none;margin:0;padding:10px 12px}
#ssch-root .ssch-compose{margin-top:0;gap:8px;align-items:center}
#ssch-root .ssch-send{width:44px;height:44px;padding:0;font-size:22px;line-height:1}
#ssch-root .ssch-form>.ssch-sub{margin-top:8px;font-size:11px;line-height:1.4}
#ssch-root .ssch-end{margin-top:4px;padding:4px 0;line-height:1.4;color:#53617a;text-align:left}
@media(max-height:700px){#ssch-root .ssch-panel{bottom:12px;max-height:calc(100dvh - 24px);overflow:auto}#ssch-root .ssch-history{flex-shrink:0}}

#ssch-root .ssch-typing{flex-shrink:0;padding:6px 16px;color:#53617a;background:#fff;font-size:12px;line-height:1.5}
#ssch-root .ssch-typing span{color:#0866ff;letter-spacing:2px;margin-right:5px}

#ssch-root .ssch-launch{min-height:54px;padding:13px 19px;gap:10px;border-radius:28px;font-size:15px;font-weight:650;line-height:1.2;box-shadow:0 6px 20px #0866ff38;transition:background .15s,box-shadow .15s}
#ssch-root .ssch-launch:hover{background:#0759dd;box-shadow:0 8px 24px #0866ff48}
#ssch-root .ssch-launch-icon{display:block;width:25px;height:25px;flex:none}
@media(prefers-reduced-motion:reduce){#ssch-root .ssch-launch{transition:none}}

#ssch-root .ssch-system{align-self:center;max-width:100%;text-align:center;font-size:12px;color:#53617a}
#ssch-root .ssch-system .ssch-bubble{padding:6px 10px;background:#f3f6fc;color:#53617a;border-radius:10px}

#ssch-root .ssch-title{font-size:16px}
#ssch-root .ssch-welcome-text{display:block;max-width:300px;font-size:14px;line-height:1.45}

#ssch-root.ssch-menu-open .ssch-launch{display:none}
#ssch-root.ssch-compact .ssch-launch{width:72px;min-height:72px;height:72px;padding:17px;gap:0;border-radius:50%}
#ssch-root.ssch-compact .ssch-launch>span:not(.ssch-badge){display:none}
#ssch-root.ssch-compact .ssch-badge{position:absolute;right:-5px;top:-5px;font-size:11px;line-height:18px;padding:0 5px}
.ssch-menu-entry[hidden]{display:none!important}
.site-nav .ssch-menu-entry{width:100%;padding:0 16px 16px;order:2}
.site-nav #ssch-menu-chat{display:flex;justify-content:center;align-items:center;gap:9px;width:100%;min-height:48px;border:0;border-radius:26px;background:#0866ff;color:#fff;font:600 15px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;padding:12px 18px;cursor:pointer}
.site-nav #ssch-menu-chat svg{width:24px;height:24px;flex:none}
.site-nav #ssch-menu-chat:focus-visible{outline:3px solid #a443d6;outline-offset:3px}

/* Mobile navigation: compact search and reachable actions, even on short screens. */
.site-nav.ssch-mobile-nav.is-open{max-height:calc(100dvh - var(--ssch-menu-top,80px));overflow-y:auto;overscroll-behavior:contain;background:#0b0b1b;padding-bottom:env(safe-area-inset-bottom,0px)}
.site-nav.ssch-mobile-nav .site-nav__mobile-search{position:relative;top:auto;flex:none;margin:0;padding:12px 16px 4px;background:#0b0b1b}
.site-nav.ssch-mobile-nav .ss-search__form--header{flex-direction:row;align-items:center;gap:8px}
.site-nav.ssch-mobile-nav .ss-search__label--header{flex:1;min-width:0;margin:0}
.site-nav.ssch-mobile-nav .ss-search__input--header{height:44px;min-height:44px;padding:10px 12px;font-size:16px;border-radius:14px}
.site-nav.ssch-mobile-nav .site-header__search-button{width:auto;min-height:44px;height:44px;flex:none;margin:0;padding:10px 14px;font-size:14px;border:1px solid #666678;color:#fff}
.site-nav.ssch-mobile-nav>ul.menu{flex:none;gap:0;margin:0;padding:4px 16px 8px}
.site-nav.ssch-mobile-nav>ul.menu>li{margin:0;padding:0}
.site-nav.ssch-mobile-nav>ul.menu>li>a{display:flex;align-items:center;min-height:44px;padding:9px 0;line-height:1.4;font-size:16px;color:#fff}
.site-nav.ssch-mobile-nav .site-nav__mobile-cta{flex:none;margin:0;padding:0 16px 10px}
.site-nav.ssch-mobile-nav .site-nav__mobile-cta>a{display:flex;align-items:center;justify-content:center;min-height:48px;margin:0;padding:12px 16px;line-height:1.3;color:#171322;font-weight:700}
.site-nav.ssch-mobile-nav .ssch-menu-entry{flex:none;padding:0 16px 16px}

.site-nav.ssch-mobile-nav .site-nav__mobile-search{margin:0!important}
.site-nav.ssch-mobile-nav .ss-search__form--header{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important}
.site-nav.ssch-mobile-nav .ss-search__label--header,.site-nav.ssch-mobile-nav .ss-search__input--header{width:100%!important;min-width:0!important}
.site-nav.ssch-mobile-nav .site-header__search-button{width:auto!important;min-width:0!important}

/* Keep the full document behind an open mobile menu; theme height:100% clipped it after scrolling. */
@media(max-width:840px){
 html.nav-open,body.nav-open{height:auto!important;min-height:100%;touch-action:auto}
 body.nav-open{min-height:100dvh;overflow:visible!important}
 .site-nav.ssch-mobile-nav.is-open{touch-action:pan-y}
}

/* Keep a visible, draggable scrollbar for the conversation, independent of the page. */
#ssch-root .ssch-history{overflow-y:scroll;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:#8295b8 #edf1f7;-ms-overflow-style:auto}
#ssch-root .ssch-history::-webkit-scrollbar{display:block;width:10px;height:10px}
#ssch-root .ssch-history::-webkit-scrollbar-track{background:#edf1f7;border-radius:8px}
#ssch-root .ssch-history::-webkit-scrollbar-thumb{background:#8295b8;border:2px solid #edf1f7;border-radius:8px;min-height:32px}
#ssch-root .ssch-history::-webkit-scrollbar-thumb:hover{background:#536f9d}

/* Bright unread replies remain visible on the launcher and inside mobile navigation. */
#ssch-root .ssch-launch .ssch-badge,.site-nav #ssch-menu-chat .ssch-badge{
  box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex:none;
  min-width:26px;height:26px;padding:0 6px;border:2px solid #fff;border-radius:20px;
  background:#e51645;color:#fff;font:800 12px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  box-shadow:0 2px 7px #80102d40;
}
.site-nav #ssch-menu-chat .ssch-badge[hidden]{display:none!important}
#ssch-root .ssch-launch.ssch-has-unread{box-shadow:0 0 0 3px #fff,0 0 0 5px #e51645,0 8px 24px #0866ff40}
#ssch-root.ssch-compact .ssch-launch .ssch-badge{top:-7px;right:-7px;min-width:24px;height:24px;padding:0 5px}

/* Reopening must jump to the newest reply immediately, without a delayed smooth scroll. */
#ssch-root .ssch-history{scroll-behavior:auto}
#ssch-root .ssch-message{flex-shrink:0}
#ssch-root .ssch-session-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
#ssch-root .ssch-session-actions button{display:flex;align-items:center;justify-content:center;min-height:32px;margin:0;padding:6px 9px;border-radius:9px;font-size:12px;font-weight:600;line-height:1.25;text-align:center;white-space:normal}
#ssch-root .ssch-collapse{background:#eef3fb;color:#23416e;border:1px solid #c8d5e8}
#ssch-root .ssch-form>.ssch-end{display:inline-flex;align-items:center;min-height:26px;margin:6px 0 0;padding:3px 7px;border:1px solid #efd0d7;border-radius:7px;background:#fff7f8;color:#934253;font-size:12px;font-weight:500;line-height:1.35;text-align:left}
#ssch-root .ssch-collapse:hover{background:#e1eafa}
#ssch-root .ssch-form>.ssch-end:hover{background:#ffe2e8}

#ssch-root.ssch-compact .ssch-launch-icon{width:38px;height:38px}

@media(max-width:840px){#ssch-root .ssch-send{width:55px;height:55px;font-size:27.5px}}

#ssch-root .ssch-head>div{min-width:0;flex:1}
#ssch-root .ssch-close{flex:none;display:grid;place-items:center;width:48px;height:48px;padding:0;font-size:44px;line-height:1}

/* Customer widget only: operator photo and visitor initial beside message bubbles. */
#ssch-root .ssch-message:not(.ssch-system){display:grid;grid-template-columns:32px minmax(0,1fr);column-gap:8px;row-gap:0;width:fit-content;max-width:100%}
#ssch-root .ssch-message.ssch-mine{grid-template-columns:minmax(0,1fr) 32px}
#ssch-root .ssch-message-content{display:contents}
#ssch-root .ssch-message:not(.ssch-system) .ssch-bubble{grid-column:2;grid-row:1;justify-self:start;width:fit-content;max-width:100%;box-sizing:border-box;min-width:0}
#ssch-root .ssch-message.ssch-mine .ssch-bubble{grid-column:1;justify-self:end}
#ssch-root .ssch-message:not(.ssch-system) small{grid-column:1 / -1;grid-row:2;white-space:nowrap;margin:4px 0 0 40px}
#ssch-root .ssch-message.ssch-mine small{margin:4px 40px 0 0;justify-self:end}
#ssch-root .ssch-message-avatar{grid-column:1;grid-row:1;align-self:center;display:grid;place-items:center;width:32px;height:32px;margin:0;border-radius:50%;overflow:hidden;color:#fff;background:#e8efff;font-size:15px;font-weight:700;line-height:1}
#ssch-root .ssch-mine .ssch-message-avatar{grid-column:2}
#ssch-root .ssch-message-avatar img,#ssch-root .ssch-head .ssch-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}

/* Session confirmation uses the browser top layer and stays within small viewports. */
#ssch-root dialog.ssch-confirm{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:calc(100% - 32px);max-width:400px;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid #dce2ef;border-radius:22px;background:#fff;color:#11152d;box-shadow:0 16px 60px #11152d40;font-family:Arial,sans-serif;text-align:left;overscroll-behavior:contain}
#ssch-root dialog.ssch-confirm::backdrop{background:rgba(17,21,45,.48)}
#ssch-root .ssch-confirm h2{margin:0 0 14px;font:700 21px/1.3 Arial,sans-serif;color:#11152d;text-transform:none}
#ssch-root .ssch-confirm p{margin:0 0 16px;font:400 16px/1.5 Arial,sans-serif;color:#25314a}
#ssch-root .ssch-confirm p.ssch-confirm-note{font-size:14px;color:#52617a}
#ssch-root .ssch-confirm-actions{display:flex;gap:10px;margin-top:22px}
#ssch-root .ssch-confirm-actions button{box-sizing:border-box;flex:1;min-height:48px;margin:0;padding:12px 14px;border:1px solid #cdd7e8;border-radius:14px;background:#f2f5fa;color:#1d355b;font:700 16px/1.3 Arial,sans-serif;cursor:pointer;text-align:center;white-space:normal;text-transform:none}
#ssch-root .ssch-confirm-actions .ssch-confirm-accept{background:#0866ff;border-color:#0866ff;color:#fff}
#ssch-root .ssch-confirm-actions button:focus-visible{outline:3px solid #7724d8;outline-offset:3px}
#ssch-root .ssch-confirm-actions .ssch-confirm-cancel:hover{background:#e5ebf5}
#ssch-root .ssch-confirm-actions .ssch-confirm-accept:hover{background:#0054dc}
@media(max-width:360px){#ssch-root dialog.ssch-confirm{padding:20px}#ssch-root .ssch-confirm-actions{flex-direction:column}}

/* Desktop: 100px more conversation space; navigation stays above the chat. */
@media(min-width:841px){#ssch-root .ssch-panel{height:700px}header.site-header#top{z-index:10002}}
@media(min-width:801px){body>header.header{z-index:10002}}

/* Readable conversation status, independent of brand colours. */
#ssch-root .ssch-note[data-status="waiting"]{background:#fff1d6;color:#754000;border-bottom:1px solid #e9bd68;font-weight:600}
#ssch-root .ssch-note[data-status="joined"]{background:#e2f5e9;color:#175c35;border-bottom:1px solid #93cba8;font-weight:600}
#ssch-root .ssch-note[data-status="closed"]{background:#eef1f5;color:#44516a}
#ssch-root .ssch-note[data-status="waiting"]::before,#ssch-root .ssch-note[data-status="joined"]::before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:currentColor;margin-right:8px;vertical-align:1px}

/* Status colours take precedence over brand widget overrides. */
#ssch-root .ssch-note[data-status="waiting"]{background:#fff1d6!important;color:#754000!important}
#ssch-root .ssch-note[data-status="joined"]{background:#e2f5e9!important;color:#175c35!important}
