.chatbot-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

.chatbot-fab {
    position: relative;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%);
    box-shadow: 0 22px 44px rgba(34, 197, 94, 0.32);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chatbot-fab-ripple {
    position: absolute;
    inset: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.chatbot-fab-notice {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #f97316;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
    z-index: 2;
}

.chatbot-fab-core {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 96px;
    width: min(400px, calc(100vw - 32px));
    height: min(720px, calc(100vh - 128px));
    border-radius: 30px;
    border: 1px solid rgba(226, 232, 240, 0.94);
    background: #ffffff;
    box-shadow: 0 34px 84px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: none;
    grid-template-rows: auto 1fr auto;
}

.chatbot-panel.is-open {
    display: grid;
}

.chatbot-header {
    min-height: 84px;
    padding: 18px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #eef2f7;
    backdrop-filter: blur(12px);
}

.chatbot-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chatbot-profile-icon {
    width: 44px;
    height: 44px;
    border-radius: 18px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.chatbot-header-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chatbot-header-title {
    font-size: 17px;
    color: #111827;
    font-weight: 900;
    line-height: 1.2;
}

.chatbot-header-status {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-icon-button,
.chatbot-back-button,
.chatbot-tool-button {
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.chatbot-icon-button {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chatbot-icon-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-icon-button svg,
.chatbot-back-button svg,
.chatbot-tool-button svg,
.chatbot-send-button svg {
    width: 18px;
    height: 18px;
}

.chatbot-screen {
    min-height: 0;
    background:
        radial-gradient(circle at top left, rgba(190, 242, 100, 0.16), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f9fcf8 100%);
}

.chatbot-screen-hidden {
    display: none;
}

.chatbot-screen-body {
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.chatbot-home {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chatbot-home-hero {
    padding: 22px;
    border-radius: 28px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.chatbot-home-badge {
    width: 64px;
    height: 64px;
    border-radius: 24px;
    background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
}

.chatbot-home-hero h3,
.chatbot-screen-intro h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    color: #111827;
}

.chatbot-home-hero p,
.chatbot-screen-intro p {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #667085;
    font-weight: 600;
}

.chatbot-home-card-list {
    display: grid;
    gap: 12px;
}

.chatbot-home-card,
.chatbot-settings-card {
    border-radius: 24px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.chatbot-home-card strong,
.chatbot-settings-card strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.chatbot-home-card p,
.chatbot-settings-card p {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #6b7280;
}

.chatbot-primary-button,
.chatbot-secondary-button {
    min-height: 54px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
}

.chatbot-primary-button {
    margin-top: auto;
    background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%);
    color: #ffffff;
    box-shadow: 0 18px 30px rgba(22, 163, 74, 0.2);
}

.chatbot-secondary-button {
    margin-top: 16px;
    padding: 0 18px;
    min-height: 46px;
    background: #f3f4f6;
    color: #374151;
}

.chatbot-inline-action {
    width: 100%;
    margin-top: 14px;
}

.chatbot-room-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.chatbot-room-card {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #ffffff;
    padding: 16px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    text-align: left;
    position: relative;
}

.chatbot-room-card.is-active {
    border-color: #bbf7d0;
    box-shadow: 0 18px 30px rgba(22, 163, 74, 0.1);
}

.chatbot-room-main {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.chatbot-room-avatar {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background: #ecfccb;
    color: #3f6212;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.chatbot-room-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chatbot-room-topline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 40px;
}

.chatbot-room-topline strong {
    font-size: 14px;
    color: #111827;
    font-weight: 800;
}

.chatbot-room-preview {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chatbot-room-date {
    margin-top: 10px;
    align-self: flex-end;
    font-size: 10px;
    line-height: 1;
    color: rgba(148, 163, 184, 0.88);
    font-weight: 700;
}

.chatbot-room-menu-wrap {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 2;
}

.chatbot-room-menu-trigger {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.chatbot-room-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 112px;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.chatbot-room-menu-action {
    width: 100%;
    min-height: 36px;
    border: none;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.chatbot-room-empty {
    margin-top: 14px;
    padding: 24px 18px;
    border-radius: 22px;
    border: 1px dashed #d1d5db;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

.chatbot-chat-topbar {
    min-height: 68px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eef2f7;
    background: rgba(255, 255, 255, 0.96);
}

.chatbot-back-button {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chatbot-chat-topbar-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.chatbot-chat-topbar-copy strong {
    font-size: 16px;
    color: #111827;
    font-weight: 900;
}

.chatbot-chat-topbar-copy span {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.chatbot-support-close-button {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid #fca5a5;
    border-radius: 999px;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.chatbot-support-close-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-message-area {
    height: calc(100% - 68px - 106px);
    overflow-y: auto;
    padding: 18px 18px 136px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-message {
    display: flex;
}

.chatbot-message.assistant {
    justify-content: flex-start;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message-wrap {
    max-width: 84%;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbot-message.user .chatbot-message-wrap {
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 14px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.chatbot-message.assistant .chatbot-message-avatar {
    background: #ecfccb;
    color: #365314;
}

.chatbot-message.user .chatbot-message-avatar {
    background: #16a34a;
    color: #ffffff;
}

.chatbot-bubble {
    padding: 12px 14px;
    border-radius: 20px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.chatbot-message.assistant .chatbot-bubble {
    background: #ffffff;
    color: #111827;
    border-bottom-left-radius: 8px;
}

.chatbot-message.user .chatbot-bubble {
    background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%);
    color: #ffffff;
    border-bottom-right-radius: 8px;
}

.chatbot-bubble p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.chatbot-bubble-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.01em;
    color: #166534;
}

.chatbot-message.user .chatbot-bubble-label {
    color: rgba(255, 255, 255, 0.88);
}

.chatbot-bubble-time {
    display: block;
    margin-top: 8px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.72;
}

.chatbot-composer {
    position: absolute;
    right: 0;
    bottom: 76px;
    left: 0;
    padding: 12px 18px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 24%);
}

.chatbot-status {
    min-height: 18px;
    margin-bottom: 8px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 700;
}

.chatbot-attachment-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #d9f99d;
    border-radius: 16px;
    background: #f7fee7;
}

.chatbot-attachment-preview[hidden] {
    display: none !important;
}

.chatbot-attachment-name {
    min-width: 0;
    font-size: 12px;
    color: #3f6212;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatbot-attachment-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.chatbot-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 24px;
    background: #f4f4f5;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.chatbot-input-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 4px;
}

.chatbot-tool-button {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    color: #71717a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input {
    flex: 1;
    min-height: 24px;
    max-height: 96px;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 14px;
    line-height: 1.45;
    color: #111827;
    padding: 6px 4px;
}

.chatbot-input::placeholder {
    color: #9ca3af;
}

.chatbot-send-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #bef264 0%, #86efac 100%);
    color: #166534;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(132, 204, 22, 0.24);
}

.chatbot-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-tabbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 16px 16px;
    background: #ffffff;
    border-top: 1px solid #eef2f7;
}

.chatbot-tabbar.chatbot-tabbar-admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chatbot-tab {
    min-height: 54px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.chatbot-tab.is-active {
    background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.16);
}

.chatbot-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

@media (max-width: 640px) {
    .chatbot-widget {
        right: 12px;
        bottom: 12px;
    }

    .chatbot-panel {
        right: 0;
        bottom: 84px;
        width: min(420px, calc(100vw - 24px));
        height: min(760px, calc(100vh - 106px));
        border-radius: 28px;
    }

    .chatbot-home-hero {
        grid-template-columns: 1fr;
    }

    .chatbot-message-area {
        height: calc(100% - 68px - 112px);
        padding-bottom: 148px;
    }

    .chatbot-chat-topbar {
        padding-right: 14px;
    }

    .chatbot-support-close-button {
        padding: 0 12px;
        font-size: 11px;
    }

    .chatbot-composer {
        bottom: 78px;
        padding: 10px 14px 14px;
    }

    .chatbot-tabbar {
        padding: 12px 14px 14px;
    }

    .chatbot-fab {
        width: 66px;
        height: 66px;
    }
}
