.bugisa-chatbot {
    --bugisa-blue: #1468f3;
    --bugisa-ink: #172033;
    --bugisa-muted: #727d90;
    position: fixed;
    right: 28px;
    bottom: 26px;
    z-index: 9998;
    color: var(--bugisa-ink);
    font-family: Pretendard, "Noto Sans KR", Arial, sans-serif;
    letter-spacing: -.02em;
}
.bugisa-chatbot[hidden], .bugisa-chatbot__panel[hidden] { display: none !important; }
.bugisa-chatbot button, .bugisa-chatbot textarea { font: inherit; }

.bugisa-chatbot__launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 62px;
    padding: 6px 18px 6px 6px;
    border: 1px solid rgba(19, 39, 78, .08);
    border-radius: 32px;
    background: #fff;
    color: var(--bugisa-ink);
    box-shadow: 0 14px 40px rgba(20, 38, 67, .18), 0 3px 10px rgba(20, 38, 67, .08);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.bugisa-chatbot__launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(20, 38, 67, .22); }
.bugisa-chatbot__mascot-wrap {
    position: relative;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(145deg, #eef5ff, #dceaff);
}
.bugisa-chatbot__mascot { width: 100%; height: 100%; object-fit: contain; animation: bugisa-float 3.2s ease-in-out infinite; }
.bugisa-chatbot__online-dot { position: absolute; right: 1px; bottom: 2px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #23c875; }
.bugisa-chatbot__launcher-name { font-size: 14px; font-weight: 750; }

.bugisa-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    display: flex;
    flex-direction: column;
    width: 410px;
    height: min(680px, calc(100vh - 125px));
    overflow: hidden;
    border: 1px solid rgba(25, 43, 72, .09);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(19, 33, 55, .24), 0 8px 24px rgba(19, 33, 55, .09);
    transform-origin: right bottom;
    animation: bugisa-open .24s cubic-bezier(.2,.8,.2,1);
}
.bugisa-chatbot__panel--expanded { width: min(610px, calc(100vw - 56px)); height: min(760px, calc(100vh - 76px)); }

.bugisa-chatbot__header {
    position: relative !important;
    inset: auto !important;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    width: auto !important;
    min-height: 72px;
    padding: 12px 16px 12px 18px;
    border-bottom: 1px solid #edf0f5;
    background: rgba(255,255,255,.96);
}
.bugisa-chatbot__header-title { display: flex; align-items: center; gap: 11px; }
.bugisa-chatbot__header-avatar { width: 43px; height: 43px; overflow: hidden; border-radius: 14px; background: #edf4ff; }
.bugisa-chatbot__header-avatar img { width: 100%; height: 100%; object-fit: contain; }
.bugisa-chatbot__header-title strong { display: block; font-size: 15px; font-weight: 780; }
.bugisa-chatbot__header-title small { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--bugisa-muted); font-size: 11px; letter-spacing: -.01em; }
.bugisa-chatbot__header-title small i { width: 7px; height: 7px; border-radius: 50%; background: #24c875; box-shadow: 0 0 0 3px #e6f9ef; }
.bugisa-chatbot__header-actions { display: flex; gap: 2px; }
.bugisa-chatbot__header-actions button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 11px; background: transparent; color: #657186; font-size: 18px; cursor: pointer; }
.bugisa-chatbot__header-actions button:hover { background: #f1f4f8; color: #1e2a3c; }

.bugisa-chatbot__messages { flex: 1; overflow-y: auto; padding: 18px; background: #fff; scroll-behavior: smooth; }
.bugisa-chatbot__messages::-webkit-scrollbar { width: 5px; }
.bugisa-chatbot__messages::-webkit-scrollbar-thumb { border-radius: 5px; background: #dce2eb; }

.bugisa-chatbot__hero {
    position: relative;
    min-height: 190px;
    overflow: hidden;
    padding: 28px 21px;
    border-radius: 20px;
    background: linear-gradient(135deg, #105bdc 0%, #1d79f4 58%, #56a2ff 100%);
    color: #fff;
    box-shadow: 0 12px 32px rgba(20, 104, 243, .18);
}
.bugisa-chatbot__hero::after { content: ""; position: absolute; right: -48px; bottom: -68px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.12); }
.bugisa-chatbot__hero-copy { position: relative; z-index: 2; }
.bugisa-chatbot__hero-copy > span { display: inline-block; margin-bottom: 12px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.28); border-radius: 20px; background: rgba(255,255,255,.13); font-size: 10px; font-weight: 700; }
.bugisa-chatbot__hero h2 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; letter-spacing: -.045em; }
.bugisa-chatbot__hero p { margin: 10px 0 0; color: rgba(255,255,255,.85); font-size: 12px; line-height: 1.6; }
.bugisa-chatbot__hero > img { position: absolute; z-index: 1; right: -6px; bottom: -17px; width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 9px 12px rgba(0,34,91,.2)); animation: bugisa-hero 4s ease-in-out infinite; }
.bugisa-chatbot__section-label { margin: 25px 3px 11px; color: #2b3546; font-size: 13px; font-weight: 780; }

.bugisa-chatbot__quick-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.bugisa-chatbot__quick-actions > button { padding: 8px 12px; border: 1px solid #dce4ef; border-radius: 18px; background: #fff; color: #28588f; font-size: 11px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.bugisa-chatbot__quick-actions > button:hover { border-color: #91b9f6; background: #f7faff; }
.bugisa-chatbot__quick-actions--home { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0; }
.bugisa-chatbot__quick-actions--home > button { display: grid; grid-template-columns: 38px 1fr 12px; align-items: center; gap: 9px; min-width: 0; min-height: 72px; padding: 12px; border: 1px solid #e5e9f0; border-radius: 15px; color: var(--bugisa-ink); text-align: left; box-shadow: 0 2px 6px rgba(25,43,72,.02); }
.bugisa-chatbot__quick-actions--home > button:hover { border-color: #a8c7f9; background: #fbfdff; box-shadow: 0 7px 20px rgba(20,104,243,.08); transform: translateY(-1px); }
.bugisa-chatbot__quick-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #edf4ff; color: var(--bugisa-blue); font-size: 15px; }
.bugisa-chatbot__quick-actions--home button:nth-child(2) .bugisa-chatbot__quick-icon { background: #eef9f3; color: #159458; }
.bugisa-chatbot__quick-actions--home button:nth-child(3) .bugisa-chatbot__quick-icon { background: #fff5e8; color: #c77b18; }
.bugisa-chatbot__quick-actions--home button:nth-child(4) .bugisa-chatbot__quick-icon { background: #f5f0ff; color: #7654d8; }
.bugisa-chatbot__quick-actions--home strong, .bugisa-chatbot__quick-actions--home small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bugisa-chatbot__quick-actions--home strong { font-size: 13px; font-weight: 740; }
.bugisa-chatbot__quick-actions--home small { margin-top: 3px; color: #8a94a5; font-size: 10px; }
.bugisa-chatbot__quick-actions--home b { color: #aeb7c4; font-size: 17px; font-weight: 400; }

.bugisa-chatbot--conversation .bugisa-chatbot__home { display: none; }
.bugisa-chatbot__message { max-width: 84%; margin: 12px 0; padding: 13px 15px; border-radius: 17px; white-space: pre-wrap; font-size: 13px; line-height: 1.65; }
.bugisa-chatbot__message--user { margin-left: auto; border-bottom-right-radius: 5px; background: var(--bugisa-blue); color: #fff; box-shadow: 0 5px 14px rgba(20,104,243,.15); }
.bugisa-chatbot__message--assistant { max-width: 92%; padding: 16px; border: 1px solid #e3e8f0; border-bottom-left-radius: 5px; background: #fff; color: #263144; box-shadow: 0 5px 18px rgba(31,45,67,.06); white-space: normal; }
.bugisa-chatbot__answer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 9px; }
.bugisa-chatbot__answer-head > strong { color: #172033; font-size: 14px; font-weight: 800; }
.bugisa-chatbot__answer-head > span { flex: 0 0 auto; padding: 4px 8px; border-radius: 12px; background: #edf4ff; color: #1769ff; font-size: 10px; font-weight: 750; }
.bugisa-chatbot__answer-progress { position: relative; display: block; height: 4px; margin: 0 0 14px; overflow: hidden; border-radius: 4px; background: #e9eef5; }
.bugisa-chatbot__answer-progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--bugisa-progress, 0%); border-radius: inherit; background: linear-gradient(90deg,#1769ff,#5b9cff); }
.bugisa-chatbot__answer-paragraph { margin: 0; color: #465267; line-height: 1.65; }
.bugisa-chatbot__answer-paragraph + .bugisa-chatbot__answer-paragraph { margin-top: 9px; }
.bugisa-chatbot__answer-paragraph strong { color: #1769ff; font-weight: 780; }
.bugisa-chatbot__answer-emphasis { color: #1769ff; font-style: normal; font-weight: 780; }
.bugisa-chatbot__answer-row { display: grid; grid-template-columns: 8px 1fr; gap: 9px; align-items: start; margin-top: 9px; padding: 9px 10px; border-radius: 10px; background: #f6f8fb; color: #4b576a; line-height: 1.55; }
.bugisa-chatbot__answer-row > i { width: 5px; height: 5px; margin-top: 7px; border-radius: 50%; background: #1769ff; }
.bugisa-chatbot__answer-row--number { grid-template-columns: 22px 1fr; }
.bugisa-chatbot__answer-row--number > b { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; background: #1769ff; color: #fff; font-size: 10px; }
.bugisa-chatbot__answer-label { display: block; margin-bottom: 2px; color: #1d2a3d; font-weight: 780; }
.bugisa-chatbot__source { margin: -5px 3px 12px; color: #929cac; font-size: 10px; }
.bugisa-chatbot__answer-actions { display: grid; gap: 7px; margin: 8px 0 13px; }
.bugisa-chatbot__answer-actions a { position: relative; padding: 12px 36px 12px 13px; border: 1px solid #d6e4fb; border-radius: 12px; background: #f4f8ff; color: #1468f3; font-size: 12px; font-weight: 750; text-decoration: none; }
.bugisa-chatbot__answer-actions a::after { content: "→"; position: absolute; right: 14px; }
.bugisa-chatbot__typing { display: flex; gap: 4px; width: max-content; margin: 12px 0; padding: 14px 17px; border-radius: 17px 17px 17px 5px; background: #f2f4f7; }
.bugisa-chatbot__typing i { width: 5px; height: 5px; border-radius: 50%; background: #8793a5; animation: bugisa-dot 1.1s infinite; }
.bugisa-chatbot__typing i:nth-child(2) { animation-delay: .15s; }
.bugisa-chatbot__typing i:nth-child(3) { animation-delay: .3s; }

.bugisa-chatbot__form { padding: 10px 14px 11px; border-top: 1px solid #edf0f4; background: #fff; }
.bugisa-chatbot__composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 14px; border: 1px solid #d8dee8; border-radius: 17px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.bugisa-chatbot__composer:focus-within { border-color: #7cacf6; box-shadow: 0 0 0 3px rgba(20,104,243,.09); }
.bugisa-chatbot__composer textarea { flex: 1; min-height: 26px; max-height: 90px; padding: 4px 0 2px; border: 0; outline: 0; resize: none; color: var(--bugisa-ink); font-size: 13px; line-height: 1.45; }
.bugisa-chatbot__composer textarea::placeholder { color: #9aa4b3; }
.bugisa-chatbot__composer button { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: var(--bugisa-blue); color: #fff; font-size: 14px; cursor: pointer; box-shadow: 0 4px 10px rgba(20,104,243,.22); }
.bugisa-chatbot__composer button:disabled { opacity: .4; box-shadow: none; }
.bugisa-chatbot__form > p { margin: 7px 2px 0; color: #a1a9b6; font-size: 9px; text-align: center; line-height: 1.4; }

@keyframes bugisa-open { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bugisa-float { 0%,100% { transform: translateY(1px) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1deg); } }
@keyframes bugisa-hero { 0%,100% { transform: translateY(2px) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes bugisa-dot { 0%,60%,100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 600px) {
    .bugisa-chatbot { right: 13px; bottom: 13px; }
    .bugisa-chatbot__launcher { width: 58px; height: 58px; padding: 4px; }
    .bugisa-chatbot__mascot-wrap { width: 50px; height: 50px; }
    .bugisa-chatbot__launcher-name { display: none; }
    .bugisa-chatbot__panel, .bugisa-chatbot__panel--expanded { position: fixed; inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
    .bugisa-chatbot__header { padding-top: max(12px, env(safe-area-inset-top)); }
    .bugisa-chatbot__messages { padding: 16px 14px; }
    .bugisa-chatbot__form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
    .bugisa-chatbot__expand { display: none !important; }
}
@media (max-width: 370px) { .bugisa-chatbot__quick-actions--home { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bugisa-chatbot * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
