/* No legacy control is hidden until the real robot canvas has mounted. */
#eg-robot-radial[data-egmss-integrated]{visibility:hidden}
html.egmss-robot-ready #eg-robot-radial[data-egmss-integrated]{visibility:visible}
html.egmss-robot-ready .eg-ctsm-float-btn,
html.egmss-robot-ready .egmss-inbox-side-btn,
html.egmss-robot-ready #egms-lsp-button-stack .egms-lsp-side-button,
html.egmss-robot-ready.egmss-robot-course-chat .chat-window-toggle,
html.egmss-robot-ready.egmss-robot-course-chat .n8n-chat-widget-toggle-button,
html.egmss-robot-ready.egmss-robot-course-chat .n8n-chat-toggle-button,
html.egmss-robot-ready.egmss-robot-course-chat .chat-toggle-button{display:none!important}
html.egmss-robot-panel-open #eg-robot-radial .egr-launcher{visibility:hidden!important;pointer-events:none!important}
#eg-robot-radial .egr-launcher{overflow:visible!important;max-width:none!important;min-width:0!important}
#eg-robot-radial:not(.is-open) .egr-dock-badge{display:block!important;visibility:visible!important;opacity:1!important;position:absolute!important;top:auto!important;bottom:-16px!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;white-space:nowrap!important;font:700 12px/18px Cairo,Tahoma,Arial,sans-serif!important;color:var(--egr-text)!important;min-height:18px!important;padding:1px 9px!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important}
#eg-robot-radial.is-open .egr-dock-badge{display:none!important}
#eg-robot-radial .egr-notification-count:not([hidden]){display:grid!important;visibility:visible!important;opacity:1!important;color:white!important;font:700 12px/1 Arial,sans-serif!important;z-index:5}
#eg-robot-radial .egr-notification-count[hidden]{display:none!important}
/* Keep the original popup layout, typography and controls; use a cool neutral canvas. */
html.egmss-robot-ready #egmss-campaign-root :is(.egmss-campaign-card,.eg-lms-popup__dialog){background:#f4f7fc!important}
html.egmss-robot-ready :is(#egms-lsp-modal,#egmss-campaign-root) :focus-visible{outline:2px solid #b92134;outline-offset:3px}
html.egmss-robot-panel-open #eg-robot-radial:not(.is-open){display:none!important}
html.egmss-robot-ready #egms-lsp-modal-overlay{direction:rtl}

html.egmss-robot-ready .egmss-robot-chat-close{position:absolute!important;top:12px!important;left:12px!important;right:auto!important;z-index:2147483646!important;display:grid!important;place-items:center;width:44px!important;height:44px!important;border:1px solid #d62839!important;border-radius:12px!important;background:#b92134!important;color:#fff!important;font:28px/1 Arial!important;cursor:pointer;padding:0!important}
html.egmss-robot-ready :is(.chat-window,.n8n-chat-window,.n8n-chat-widget-window) :is(.chat-header,.chat-heading){padding-inline:64px!important}
#eg-robot-radial .egr-sector-label{position:relative}
#eg-robot-radial .egr-menu-count{position:absolute;top:1px;right:13px;display:grid;place-items:center;min-width:25px;height:25px;padding:0 5px;border:2px solid #fff;border-radius:20px;background:var(--egr-accent);color:#fff;font:700 13px/1 Arial;direction:ltr}
/* Preserve the configured light chat UI; the robot owns the central stage. */
html.egmss-robot-ready .egmss-robot-chat{background:#fff!important;color:#25314b!important;border:1px solid #dbe2ef!important;border-radius:22px!important;overflow:hidden!important;flex-direction:column!important;box-sizing:border-box!important}
html.egmss-robot-ready .egmss-robot-chat :is(.chat-header,.n8n-chat-header,.n8n-chat-widget-header){background:#fff!important;color:#32116d!important;border-bottom:1px solid #e0e6f0!important;flex:0 0 auto!important;box-sizing:border-box!important;min-height:60px;padding:14px 64px!important}
html.egmss-robot-ready .egmss-robot-chat :is(.chat-body,.n8n-chat-body,.n8n-chat-widget-body){background:#f4f7fc!important;color:#25314b!important;overflow-y:auto!important;min-height:0!important;flex:1 1 0!important;display:flex;flex-direction:column}
html.egmss-robot-ready .egmss-chat-robot-bar{display:flex!important;flex:0 0 auto;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:0 12px 8px;width:100%;box-sizing:border-box;background:#f4f7fc;color:#25314b;font-family:Cairo,Tahoma,Arial,sans-serif;direction:rtl;text-align:center}
html.egmss-robot-ready .egmss-chat-robot-bar>div:last-child{display:grid;gap:4px;text-align:center}
html.egmss-robot-ready .egmss-chat-robot-bar strong{font:700 21px/1.5 Cairo,Tahoma,Arial!important;color:#32116d!important}
html.egmss-robot-ready .egmss-chat-robot-bar [role=status]{font:500 14px/1.5 Cairo,Tahoma,Arial!important;color:#526581!important}
html.egmss-robot-ready .egmss-chat-robot{width:var(--egmss-avatar-size,180px)!important;height:var(--egmss-avatar-size,180px)!important;max-width:80vw!important;flex:none!important;padding:0!important;background:transparent!important;border:0!important}
html.egmss-robot-ready .egmss-chat-robot .eg-rh__single-stage{width:100%!important;height:100%!important;min-height:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;transform:none!important}
html.egmss-robot-ready .egmss-chat-robot canvas{display:block!important;width:100%!important;height:100%!important}
html.egmss-robot-ready .egmss-robot-chat .eg-mascot{display:none!important}
html.egmss-robot-ready .egmss-robot-chat .eg-welcome{min-height:0!important;padding-top:0!important;margin-top:0!important;justify-content:flex-start!important}
html.egmss-robot-ready .egmss-robot-chat .eg-welcome-main{display:flex!important;justify-content:center!important;grid-template-columns:1fr!important;max-width:100%!important}
html.egmss-robot-ready .egmss-robot-chat .eg-welcome-copy{max-width:760px!important;width:100%!important}
html.egmss-robot-ready .egmss-robot-chat .eg-welcome-copy:after{display:none!important}
@media(max-width:600px){html.egmss-robot-ready .egmss-chat-robot{width:var(--egmss-avatar-size,180px)!important;height:var(--egmss-avatar-size,180px)!important}html.egmss-robot-ready .egmss-chat-robot-bar{padding:0 8px 6px}html.egmss-robot-ready .egmss-chat-robot-bar strong{font-size:18px!important}}
html.egmss-robot-ready .egmss-robot-chat :is(.chat-messages,.chat-messages-list,.n8n-chat-messages,.n8n-chat-widget-messages){height:auto!important;flex:0 0 auto!important;min-height:0!important;overflow:visible!important}

html.egmss-robot-ready .egmss-robot-chat :is(.chat-footer,.n8n-chat-footer,.n8n-chat-widget-footer){flex:0 0 auto!important}
html.egmss-robot-ready .egmss-robot-chat :is(.chat-messages,.chat-messages-list,.n8n-chat-messages)>*{flex-shrink:0!important}

html.egmss-robot-ready .egmss-chat-robot .eg-rh__single-stage>div{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important}

/* Reserve only the painted character height, not the canvas's empty lower area. */
html.egmss-robot-ready .egmss-chat-robot{height:calc(var(--egmss-avatar-size,180px) * .74)!important;overflow:hidden!important}
html.egmss-robot-ready .egmss-chat-robot .eg-rh__single-stage{height:var(--egmss-avatar-size,180px)!important;flex:none!important}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true]{flex-direction:row!important;gap:12px;padding:2px 12px!important;border-bottom:1px solid #e0e6f0}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true] strong{font-size:16px!important}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true]>div:last-child{text-align:right;gap:0}
html.egmss-robot-ready .egmss-robot-chat :is(.chat-messages,.chat-messages-list,.n8n-chat-messages,.n8n-chat-widget-messages){padding-top:12px!important;padding-bottom:12px!important}
/* Viewport bounds: keep original popup designs and scroll their content internally. */
html.egmss-robot-ready #egms-lsp-modal-overlay{box-sizing:border-box;max-width:100vw;max-height:100dvh}
html.egmss-robot-ready #egms-lsp-modal{box-sizing:border-box;max-width:100%;max-height:100%;min-height:0}
html.egmss-robot-ready #egms-lsp-modal-header{flex-shrink:0;box-sizing:border-box}
html.egmss-robot-ready #egms-lsp-modal-body{min-height:0;min-width:0;overscroll-behavior:contain}
html.egmss-robot-ready #egms-lsp-modal-title{overflow-wrap:anywhere;min-width:0}
html.egmss-robot-ready #egmss-campaign-root{max-width:100vw;height:100dvh;max-height:100dvh;box-sizing:border-box}
html.egmss-robot-ready #egmss-campaign-root .egmss-campaign-card{box-sizing:border-box;max-width:100%;max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
html.egmss-robot-ready #egmss-campaign-root .eg-lms-popup__dialog{box-sizing:border-box;max-width:100%;max-height:100dvh}
@media(max-width:768px){
 html.egmss-robot-ready #egms-lsp-modal-overlay{padding:8px}
 html.egmss-robot-ready #egms-lsp-modal{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);width:100%}
 html.egmss-robot-ready #egms-lsp-modal-header{flex-wrap:wrap;gap:8px}
 html.egmss-robot-ready #egms-lsp-modal-actions{max-width:100%;flex-wrap:wrap}
 html.egmss-robot-ready #egmss-campaign-root .egmss-campaign-card{max-height:calc(100dvh - 24px)}
 html.egmss-robot-ready #egmss-campaign-root .egmss-campaign{padding:12px;box-sizing:border-box}
}

/* One conversation canvas: the character sits beside the answer, not in a toolbar. */
html.egmss-robot-ready .egmss-chat-scene{display:flex;flex-direction:column;flex:1 1 0;min-height:0;min-width:0;background:#f4f7fc;overflow:hidden}
html.egmss-robot-ready .egmss-chat-scene>.chat-body{min-width:0}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true]{border:0!important;background:transparent!important;gap:4px;padding:4px 12px 0!important}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true] strong{display:none!important}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true]>div:last-child{position:relative;background:white;border:1px solid #e0e6f0;border-radius:16px 16px 16px 4px;padding:7px 12px;box-shadow:0 3px 10px #25314b06}
html.egmss-robot-ready .egmss-chat-robot{overflow:visible!important}
html.egmss-robot-ready .egmss-chat-robot-bar[data-compact=true] [role=status]{font-size:12px!important}
@media(min-width:641px){
 html.egmss-robot-ready .egmss-chat-scene[data-compact=true]{flex-direction:row-reverse;direction:ltr}
 html.egmss-robot-ready .egmss-chat-scene[data-compact=true]>.egmss-chat-robot-bar{width:172px;flex:0 0 172px;flex-direction:column!important;justify-content:flex-start;padding:20px 10px!important;gap:8px}
 html.egmss-robot-ready .egmss-chat-scene[data-compact=true]>:is(.chat-body,.n8n-chat-body,.n8n-chat-widget-body){direction:rtl}
}
html.egmss-robot-ready .egmss-chat-scene[data-compact=true] :is(.chat-message-from-bot,.chat-message-from-assistant,.n8n-chat-message--bot){width:100%!important;max-width:100%!important;box-sizing:border-box;align-self:stretch!important}
