#sc-chat{position:fixed;bottom:20px;right:20px;z-index:9999;font-family:inherit;font-size:15px;line-height:1.55;color:#173451;display:flex;flex-direction:column;align-items:flex-end;gap:10px;max-width:calc(100vw - 40px)}#sc-chat *{box-sizing:border-box;font-family:inherit}#sc-chat [hidden]{display:none!important}#sc-chat button{cursor:pointer;border:0;border-radius:10px;background:#2457a0;color:white;padding:10px 15px;font:inherit;transition:background .18s,transform .18s}#sc-chat button:hover{background:#173451;transform:translateY(-1px)}#sc-chat>button{border-radius:30px;box-shadow:0 4px 20px #17345140}#sc-chat section{width:min(620px,calc(100vw - 40px));height:min(820px,calc(100dvh - 100px));background:#fff;border:1px solid #b8cbe0;border-radius:20px;box-shadow:0 12px 48px #17345133;overflow:hidden;display:flex;flex-direction:column;animation:sc-enter .22s ease-out}#sc-chat.sc-expanded section{width:min(1100px,calc(100vw - 40px));height:calc(100dvh - 100px)}#sc-chat header{position:static;display:flex;align-items:center;gap:8px;justify-content:space-between;background:#173451;color:white;padding:16px 20px;font-weight:600;flex-shrink:0}#sc-chat header button{padding:6px 10px;background:#ffffff20}#sc-chat .sc-log{flex:1;min-height:0;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:14px;overscroll-behavior:contain;background:#f7f9fc}#sc-chat p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}#sc-chat .sc-message{max-width:88%;padding:12px 15px;border-radius:15px;flex-shrink:0}#sc-chat .sc-assistant{align-self:flex-start;background:#fff;border:1px solid #dbe5ef;color:#173451;border-bottom-left-radius:4px}#sc-chat .sc-user{align-self:flex-end;background:#2457a0;color:#fff;border-bottom-right-radius:4px}#sc-chat .sc-role{font-size:11px;font-weight:600;opacity:.85;margin-bottom:4px}#sc-chat .sc-sources{display:flex;flex-direction:column;gap:6px;margin-top:12px}#sc-chat .sc-sources a{display:block;border:1px solid #c7d9ec;border-radius:9px;padding:9px 12px;color:#2457a0;background:#f2f7fc;text-decoration:none;font-size:13px;transition:background .18s,transform .18s}#sc-chat .sc-sources a:hover{background:#dceafb;transform:translateX(3px)}#sc-chat .sc-footer{padding:12px 18px;background:white;border-top:1px solid #dbe5ef;flex-shrink:0}#sc-chat .sc-note{font-size:11px;color:#435b70}#sc-chat form{display:flex;gap:8px;margin:9px 0}#sc-chat input{min-width:0;flex:1;padding:12px;border:1px solid #a7bdd2;border-radius:10px;color:#173451;background:white;font:inherit}#sc-chat a{color:#2457a0}#sc-chat .sc-invite{background:white;border:1px solid #b8cbe0;padding:12px;border-radius:12px;box-shadow:0 4px 18px #17345122}#sc-chat .sc-invite button{margin-left:8px;padding:4px 8px}#sc-chat button:disabled{opacity:.6;cursor:wait}#sc-chat :focus-visible{outline:3px solid #e6a43b;outline-offset:2px}@keyframes sc-enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@media(max-width:650px){#sc-chat{right:12px;bottom:12px;max-width:calc(100vw - 24px)}#sc-chat section,#sc-chat.sc-expanded section{position:fixed;inset:0;width:100%;height:100dvh;border-radius:0;max-width:none}#sc-chat .sc-log{padding:14px}#sc-chat .sc-footer{padding-bottom:max(12px,env(safe-area-inset-bottom))}#sc-chat .sc-expand{display:none}}@media(prefers-reduced-motion:reduce){#sc-chat *{animation:none!important;transition:none!important}}

/* R3 compact viewport-safe layout */

#sc-chat section {
    position: fixed;
    top: auto;
    left: auto;
    right: 20px;
    bottom: 20px;

    width: clamp(260px, 15vw, 340px);
    height: 55dvh;
    max-height: calc(100dvh - 40px);

    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;

    border-radius: 16px;
    box-sizing: border-box;
}

#sc-chat.sc-expanded section {
    width: min(620px, calc(100vw - 40px));
    height: 85dvh;
}

#sc-chat:has(section:not([hidden])) > button {
    visibility: hidden;
}

#sc-chat header {
    margin: 0 !important;
    padding: 10px 12px;
    min-height: 0;
    font-size: 13px;
    line-height: 1.3;
    flex: 0 0 auto;
}

#sc-chat header button {
    padding: 5px 8px;
    flex-shrink: 0;
}

#sc-chat .sc-log {
    padding: 10px;
    gap: 10px;
    font-size: 13px;
}

#sc-chat .sc-message {
    max-width: 94%;
    padding: 9px 11px;
}

#sc-chat .sc-footer {
    padding: 8px 10px;
    font-size: 12px;
}

#sc-chat .sc-note {
    font-size: 10px;
    line-height: 1.35;
}

#sc-chat form {
    margin: 6px 0;
    gap: 5px;
}

#sc-chat input {
    padding: 8px;
    font-size: 12px;
}

#sc-chat form button {
    padding: 8px;
    font-size: 12px;
}

#sc-chat .sc-sources a {
    padding: 7px 8px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

@media (max-width: 650px) {
    #sc-chat section,
    #sc-chat.sc-expanded section {
        inset: 0;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #sc-chat .sc-footer {
        padding-bottom:
            max(10px, env(safe-area-inset-bottom));
    }
}

/* R3.1 - Tall compact concierge */

#sc-chat section {
    height: 90dvh !important;
    max-height: calc(100dvh - 32px) !important;
    bottom: 16px !important;
    top: auto !important;
    width: clamp(260px, 15vw, 340px);
    overflow: hidden;
}

#sc-chat header {
    flex-shrink: 0;
}

#sc-chat .sc-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

#sc-chat .sc-footer {
    flex-shrink: 0;
}

#sc-chat.sc-expanded section {
    height: 94dvh !important;
    width: min(620px, calc(100vw - 32px));
}

@media (max-width: 650px) {
    #sc-chat section,
    #sc-chat.sc-expanded section {
        inset: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #sc-chat .sc-log {
        scroll-behavior: auto;
    }
}
/* V2.2.1 */
#sc-chat .sc-language{display:flex;align-items:center;gap:8px;padding:6px 10px;background:#eef4fa;flex-shrink:0;font-size:12px}
#sc-chat .sc-language select{min-width:0;flex:1;max-width:100%;padding:6px;border:1px solid #a7bdd2;border-radius:6px;background:white;color:#173451;font:inherit}
#sc-chat .sc-message,#sc-chat .sc-sources button{overflow-wrap:anywhere;min-width:0}
#sc-chat section[dir=rtl] .sc-message{text-align:start}
@media(max-width:650px), (pointer:coarse) and (max-height:500px){
#sc-chat section,#sc-chat.sc-expanded section{position:fixed!important;top:var(--sc-top,0px)!important;left:var(--sc-left,0px)!important;right:auto!important;bottom:auto!important;width:var(--sc-vw,100vw)!important;height:var(--sc-vh,100dvh)!important;max-height:none!important;max-width:none!important;border-radius:0!important;border:0;animation:none!important}
#sc-chat header{padding: max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));}
#sc-chat header button,#sc-chat form button,#sc-chat .sc-language select{min-height:44px;min-width:44px;font-size:16px}
#sc-chat .sc-expand{display:none!important}
#sc-chat input{font-size:16px;min-height:44px}
#sc-chat .sc-log{scroll-behavior:auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch}
#sc-chat .sc-footer{padding:6px max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));}
#sc-chat .sc-note{font-size:11px}
#sc-chat.sc-keyboard .sc-note{max-height:38px;overflow:auto}
#sc-chat.sc-keyboard .sc-footer>a{display:none}
#sc-chat>button{max-width:100%;white-space:normal;font-size:13px}
}
