.bc-chatbot-page {
    position: relative;
    font-family: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
    z-index: 0;
    --bc-chatbot-messages-height: 500px;
}

.bc-chatbot-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    padding: 0 20px;
    border-radius: 32px;
    background: #0129FE;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, width 0.25s ease, border-radius 0.25s ease, padding 0.25s ease;
    z-index: 1000;
    overflow: hidden;
    border: 0;
}

.bc-chatbot-launcher-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bc-chatbot-launcher-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

.bc-chatbot-launcher-label {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, transform 0.25s ease;
    pointer-events: none;
    max-width: 0;
    overflow: hidden;
}

.bc-chatbot-launcher:not(.bc-chatbot-launcher--open) {
    width: 64px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
}

.bc-chatbot-launcher--open {
    width: 264px;
    border-radius: 9999px;
    padding: 0 28px 0 20px;
    border: 0;
}

.bc-chatbot-launcher--open .bc-chatbot-launcher-label {
    max-width: 220px;
    opacity: 1;
    transform: translateX(0);
}

.bc-chatbot-window {
    position: fixed;
    bottom: 104px;
    right: 24px;
    width: 360px;
    max-height: 70vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.bc-chatbot-window--open {
    display: flex;
}

.bc-chatbot-window-header {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bc-chatbot-window-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.bc-chatbot-window-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 22px;
    cursor: pointer;
}

.bc-chatbot-messages {
    flex: 0 0 auto;
    height: min(var(--bc-chatbot-messages-height), 50vh);
    max-height: min(var(--bc-chatbot-messages-height), 50vh);
    padding: 20px 20px 12px;
    overflow-y: auto;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 60%);
}

.bc-chatbot-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    max-width: 82%;
    font-size: 0.95rem;
    line-height: 1.5;
}

.bc-chatbot-message--user {
    margin-left: auto;
    align-items: flex-end;
}

.bc-chatbot-message--user .bc-chatbot-message-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 16px;
}

.bc-chatbot-message--bot {
    margin-right: auto;
    align-items: flex-start;
}

.bc-chatbot-message--bot .bc-chatbot-message-bubble {
    background: #fff;
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 16px;
}

.bc-chatbot-message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    white-space: pre-wrap;
}

.bc-chatbot-message-time {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #64748b;
}

.bc-chatbot-window-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding: 12px 16px 16px;
    background: #fff;
}

.bc-chatbot-form {
    display: flex;
    gap: 8px;
}

.bc-chatbot-input {
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 14px;
    padding: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    min-height: 96px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bc-chatbot-input::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.bc-chatbot-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.bc-chatbot-submit {
    position: relative;
    background: #e0ecff;
    color: #2563eb;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bc-chatbot-submit-icon {
    width: 24px;
    height: 24px;
    background-color: currentColor;
    mask: url('./images/arrow_upward.svg') no-repeat center / contain;
    -webkit-mask: url('./images/arrow_upward.svg') no-repeat center / contain;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bc-chatbot-submit-spinner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.35);
    border-top-color: currentColor;
    animation: bc-chatbot-spinner 0.8s linear infinite;
    opacity: 0;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    pointer-events: none;
}

.bc-chatbot-submit--loading .bc-chatbot-submit-spinner {
    opacity: 1;
}

.bc-chatbot-submit--loading .bc-chatbot-submit-icon {
    opacity: 0;
}

.bc-chatbot-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bc-chatbot-submit:not(:disabled):hover {
    background: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
}

.bc-chatbot-submit:not(:disabled):hover .bc-chatbot-submit-spinner {
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
}

.bc-chatbot-status {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #475569;
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bc-chatbot-status--loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(71, 85, 105, 0.35);
    border-top-color: #2563eb;
    animation: bc-chatbot-spinner 0.9s linear infinite;
}

@keyframes bc-chatbot-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.bc-chatbot-audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.bc-chatbot-audio-controls button {
    background: transparent;
    border: none;
    color: #2563eb;
    font-size: 0.9rem;
    cursor: pointer;
}

.bc-chatbot-audio-controls button:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .bc-chatbot-window {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
        bottom: 96px;
        max-height: 76vh;
    }
}
