.cyjjr-chatbot {
    --cyjjr-chatbot-navy: #121b2f;
    --cyjjr-chatbot-muted: #64708a;
    --cyjjr-chatbot-line: #eadfd7;
    --cyjjr-chatbot-coral: #df6658;
    --cyjjr-chatbot-pink: #e6528a;
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 99999;
    font-family: inherit;
}

.cyjjr-chatbot,
.cyjjr-chatbot * {
    box-sizing: border-box;
}

.cyjjr-chatbot__toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px 10px 12px;
    background: linear-gradient(135deg, var(--cyjjr-chatbot-coral), var(--cyjjr-chatbot-pink));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(223, 102, 88, 0.28);
    cursor: pointer;
}

.cyjjr-chatbot__toggle-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    letter-spacing: 0;
}

.cyjjr-chatbot__toggle-text {
    font-size: 15px;
    white-space: nowrap;
}

.cyjjr-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    display: grid;
    grid-template-rows: auto minmax(160px, 1fr) auto auto;
    width: min(380px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 120px));
    overflow: hidden;
    border: 1px solid var(--cyjjr-chatbot-line);
    border-radius: 18px;
    background: #fffaf7;
    box-shadow: 0 24px 70px rgba(18, 27, 47, 0.18);
}

.cyjjr-chatbot__panel[hidden] {
    display: none;
}

.cyjjr-chatbot__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--cyjjr-chatbot-line);
    background: rgba(255, 255, 255, 0.78);
}

.cyjjr-chatbot__head strong,
.cyjjr-chatbot__head span {
    display: block;
}

.cyjjr-chatbot__head strong {
    color: var(--cyjjr-chatbot-navy);
    font-size: 17px;
    line-height: 1.35;
}

.cyjjr-chatbot__head span {
    margin-top: 4px;
    color: var(--cyjjr-chatbot-muted);
    font-size: 12px;
    line-height: 1.45;
}

.cyjjr-chatbot__close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 1px solid var(--cyjjr-chatbot-line);
    border-radius: 50%;
    background: #fff;
    color: var(--cyjjr-chatbot-navy);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.cyjjr-chatbot__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}

.cyjjr-chatbot__message {
    max-width: 86%;
}

.cyjjr-chatbot__message p {
    margin: 0;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.62;
    letter-spacing: 0;
}

.cyjjr-chatbot__message--bot {
    align-self: flex-start;
}

.cyjjr-chatbot__message--bot p {
    border: 1px solid var(--cyjjr-chatbot-line);
    background: #fff;
    color: var(--cyjjr-chatbot-navy);
}

.cyjjr-chatbot__message--user {
    align-self: flex-end;
}

.cyjjr-chatbot__message--user p {
    background: var(--cyjjr-chatbot-navy);
    color: #fff;
}

.cyjjr-chatbot__message a {
    color: var(--cyjjr-chatbot-pink);
    font-weight: 800;
}

.cyjjr-chatbot__quick {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 18px 14px;
}

.cyjjr-chatbot__quick button {
    flex: 0 0 auto;
    border: 1px solid var(--cyjjr-chatbot-line);
    border-radius: 999px;
    padding: 9px 12px;
    background: #fff;
    color: var(--cyjjr-chatbot-navy);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.cyjjr-chatbot__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid var(--cyjjr-chatbot-line);
    background: #fff;
}

.cyjjr-chatbot__form input {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--cyjjr-chatbot-line);
    border-radius: 999px;
    padding: 0 15px;
    color: var(--cyjjr-chatbot-navy);
    font-size: 14px;
}

.cyjjr-chatbot__form button {
    min-width: 64px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 0 15px;
    background: var(--cyjjr-chatbot-navy);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.cyjjr-chatbot.is-loading .cyjjr-chatbot__messages::after {
    content: "답변을 준비하고 있어요...";
    align-self: flex-start;
    border: 1px solid var(--cyjjr-chatbot-line);
    border-radius: 999px;
    padding: 9px 12px;
    background: #fff;
    color: var(--cyjjr-chatbot-muted);
    font-size: 12px;
}

@media (max-width: 640px) {
    .cyjjr-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .cyjjr-chatbot__toggle {
        min-height: 48px;
        padding: 9px 14px 9px 10px;
    }

    .cyjjr-chatbot__panel {
        position: fixed;
        right: 10px;
        bottom: 74px;
        left: 10px;
        width: auto;
        height: min(560px, calc(100vh - 96px));
        border-radius: 16px;
    }

    .cyjjr-chatbot__message {
        max-width: 92%;
    }
}
