.scb-root {
    --scb-accent: #222;
    --scb-bot-bg: #f2f3f5;
    --scb-user-bg: #e8f1ff;
    --scb-launcher-size: 56px;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: #202124;
}
.scb-launcher {
    width: var(--scb-launcher-size);
    height: var(--scb-launcher-size);
    border: 0;
    border-radius: 999px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--scb-accent);
    color: #fff;
    box-shadow: 0 7px 24px rgba(0,0,0,.22);
}
.scb-launcher:hover { transform: translateY(-1px); }
.scb-launcher img { width: 100%; height: 100%; object-fit: cover; }
.scb-launcher-fallback { font-size: 25px; line-height: 1; }
.scb-launcher-label {
    position: absolute;
    right: calc(var(--scb-launcher-size) + 10px);
    bottom: 8px;
    white-space: nowrap;
    background: #fff;
    color: #222;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 999px;
    padding: 7px 11px;
    box-shadow: 0 4px 14px rgba(0,0,0,.10);
    font-size: 13px;
}
.scb-window {
    position: absolute;
    right: 0;
    bottom: calc(var(--scb-launcher-size) + 14px);
    width: min(380px, calc(100vw - 28px));
    height: min(590px, calc(100vh - 125px));
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 16px 50px rgba(0,0,0,.24);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
}
.scb-window[hidden] { display: none !important; }
.scb-header {
    height: 68px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--scb-accent);
    color: #fff;
}
.scb-header-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scb-header-title strong { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.scb-header-title small { display: block; opacity: .84; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.scb-header-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    background-position: center;
    background-size: cover;
}
.scb-header-avatar.has-image { background-color: transparent; }
.scb-icon-button {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}
.scb-icon-button:hover { background: rgba(255,255,255,.12); }
.scb-log {
    height: calc(100% - 118px);
    overflow-y: auto;
    padding: 17px 14px;
    background: #fff;
    overscroll-behavior: contain;
}
.scb-message-row { display: flex; margin: 0 0 15px; align-items: flex-start; gap: 8px; }
.scb-user-row { justify-content: flex-end; }
.scb-message-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9eaec;
}
.scb-message-avatar-fallback { display: flex; align-items: center; justify-content: center; color: var(--scb-accent); }
.scb-message-body { max-width: calc(100% - 42px); }
.scb-bubble { border-radius: 14px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.scb-bot-bubble { background: var(--scb-bot-bg); border-top-left-radius: 5px; }
.scb-user-bubble { background: var(--scb-user-bg); border-top-right-radius: 5px; max-width: 82%; }
.scb-options-front { display: grid; gap: 7px; margin-top: 9px; }
.scb-choice {
    text-align: left;
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--scb-accent) 40%, #ddd);
    background: #fff;
    color: var(--scb-accent);
    border-radius: 10px;
    padding: 9px 11px;
    cursor: pointer;
    font: inherit;
}
.scb-choice:hover { background: #fafafa; }
.scb-choice:disabled { opacity: .45; cursor: default; }
.scb-cta {
    display: inline-block;
    margin-top: 9px;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--scb-accent);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
}
.scb-footer {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #eceef0;
    background: #fff;
}
.scb-restart { border: 0; background: transparent; color: #646970; cursor: pointer; font: inherit; font-size: 12px; }

@media (max-width: 600px) {
    .scb-root { right: 15px; bottom: max(15px, env(safe-area-inset-bottom)); }
    .scb-launcher-label { display: none; }
    .scb-window {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: min(88dvh, 720px);
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }
    .scb-header { padding-top: env(safe-area-inset-top); height: calc(66px + env(safe-area-inset-top)); }
    .scb-log { height: calc(100% - 116px - env(safe-area-inset-top)); padding-bottom: 22px; }
    .scb-choice { min-height: 44px; }
    html.scb-chat-open, html.scb-chat-open body { overscroll-behavior: none; }
}
