#starline-chat {
    --slc-accent: #0b6fb8;
    --slc-accent-dark: #08507f;
    --slc-bg: #ffffff;
    --slc-body-bg: #f4f6f8;
    --slc-text: #22282e;
    --slc-muted: #7b858f;
    --slc-user-bg: #0b6fb8;
    --slc-user-text: #ffffff;
    --slc-bot-bg: #ffffff;
    --slc-border: #e2e6ea;
    --slc-radius: 14px;
    --slc-z: 99990;

    position: fixed;
    right: 20px;
    bottom: var(--slc-offset, 90px);
    z-index: var(--slc-z);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--slc-text);
}

#starline-chat *, #starline-chat *:before, #starline-chat *:after { box-sizing: border-box; }

/* bubble */
#starline-chat .slc-bubble {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--slc-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, background .15s ease;
    padding: 0;
}
#starline-chat .slc-bubble:hover { background: var(--slc-accent-dark); transform: scale(1.05); }
#starline-chat.slc-open .slc-bubble { transform: scale(.85); opacity: .85; }

/* panel */
#starline-chat .slc-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 110px);
    background: var(--slc-body-bg);
    border-radius: var(--slc-radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
#starline-chat.slc-open .slc-panel { opacity: 1; visibility: visible; transform: translateY(0); }

#starline-chat .slc-head {
    background: var(--slc-accent);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}
#starline-chat .slc-head-txt { display: flex; flex-direction: column; }
#starline-chat .slc-head-txt strong { font-size: 15px; }
#starline-chat .slc-head-txt span { font-size: 12px; opacity: .8; }
#starline-chat .slc-close {
    background: none; border: 0; color: #fff; font-size: 26px; line-height: 1;
    cursor: pointer; padding: 0 4px; opacity: .85;
}
#starline-chat .slc-close:hover { opacity: 1; }

#starline-chat .slc-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}

#starline-chat .slc-msg { margin-bottom: 10px; display: flex; flex-wrap: wrap; }
#starline-chat .slc-msg.slc-user { justify-content: flex-end; }
#starline-chat .slc-bubble-txt {
    max-width: 86%;
    flex: 0 1 auto;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--slc-bot-bg);
    border: 1px solid var(--slc-border);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
#starline-chat .slc-user .slc-bubble-txt {
    background: var(--slc-user-bg);
    border-color: var(--slc-user-bg);
    color: var(--slc-user-text);
}
#starline-chat .slc-err .slc-bubble-txt { background: #fdecea; border-color: #f5c6c2; color: #8a1f14; }

#starline-chat .slc-bubble-txt p { margin: 0 0 6px; }
#starline-chat .slc-bubble-txt p:last-child { margin-bottom: 0; }
#starline-chat .slc-bubble-txt ul,
#starline-chat .slc-bubble-txt ol { margin: 4px 0 6px; padding-left: 20px; }
#starline-chat .slc-bubble-txt li { margin-bottom: 3px; }
#starline-chat .slc-bubble-txt li > ul,
#starline-chat .slc-bubble-txt li > ol { margin: 3px 0 2px; padding-left: 17px; }
#starline-chat .slc-bubble-txt li > ul { list-style-type: circle; }
#starline-chat .slc-bubble-txt code {
    background: #eef1f4; padding: 1px 4px; border-radius: 3px; font-size: 12px;
}
#starline-chat .slc-h { font-weight: 700; margin: 4px 0; }
#starline-chat .slc-bubble-txt a { color: var(--slc-accent); text-decoration: underline; }

/* documents */
#starline-chat .slc-docs { flex: 0 0 100%; max-width: 100%; margin-top: 8px; }
#starline-chat .slc-docs-t { font-size: 11px; text-transform: uppercase; color: var(--slc-muted); margin-bottom: 4px; letter-spacing: .04em; }
#starline-chat .slc-doc {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--slc-border); border-radius: 8px;
    padding: 7px 10px; margin-bottom: 5px; font-size: 12.5px;
    color: var(--slc-text) !important; text-decoration: none !important;
}
#starline-chat .slc-doc:hover { border-color: var(--slc-accent); }
#starline-chat .slc-doc-i {
    background: #d93025; color: #fff; font-size: 9px; font-weight: 700;
    padding: 2px 4px; border-radius: 3px; flex: 0 0 auto;
}

/* typing */
#starline-chat .slc-dots i {
    display: inline-block; width: 5px; height: 5px; margin-right: 2px;
    background: var(--slc-muted); border-radius: 50%; animation: slc-blink 1.2s infinite;
}
#starline-chat .slc-dots i:nth-child(2) { animation-delay: .2s; }
#starline-chat .slc-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes slc-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* footer */
#starline-chat .slc-foot {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px;
    background: var(--slc-bg);
    border-top: 1px solid var(--slc-border);
}
#starline-chat textarea#slc-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    font-size: 16px;
    resize: none;
    border: 1px solid var(--slc-border);
    border-radius: 10px;
    padding: 9px 10px;
    font: inherit;
    max-height: 110px;
    outline: none;
    background: #fff;
    color: var(--slc-text);
}
#starline-chat textarea#slc-input:focus { border-color: var(--slc-accent); }
#starline-chat #slc-send {
    flex: 0 0 auto;
    width: 40px; height: 40px;
    border: 0; border-radius: 10px;
    background: var(--slc-accent); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
#starline-chat #slc-send:hover { background: var(--slc-accent-dark); }
#starline-chat #slc-send:disabled,
#starline-chat textarea#slc-input:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 480px) {
    #starline-chat { right: 14px; bottom: var(--slc-offset-mobile, 155px); }
    #starline-chat .slc-panel {
        position: fixed;
        right: 0; left: 0; top: 0; bottom: 0;
        width: 100%; height: 100%; max-height: none;
        border-radius: 0;
    }
}

/* feedback */
#starline-chat .slc-fb {
    flex: 0 0 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    padding-left: 2px;
    min-height: 24px;
}
#starline-chat .slc-fb-q { font-size: 11.5px; color: var(--slc-muted); }
#starline-chat .slc-fb-b {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--slc-border);
    border-radius: 6px;
    background: #fff;
    color: var(--slc-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .12s ease, border-color .12s ease;
}
#starline-chat .slc-fb-b:hover { color: var(--slc-accent); border-color: var(--slc-accent); }
#starline-chat .slc-fb-done { font-size: 11.5px; color: var(--slc-accent); }

/* clarify options */
#starline-chat .slc-opts {
    flex: 0 0 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}
#starline-chat .slc-opt {
    border: 1px solid var(--slc-accent);
    background: #fff;
    color: var(--slc-accent);
    border-radius: 14px;
    padding: 5px 12px;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
#starline-chat .slc-opt:hover { background: var(--slc-accent); color: #fff; }
#starline-chat.slc-busy .slc-opt { opacity: .5; pointer-events: none; }
