.hewa-chat-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1050;
    font-family: inherit;
}

.hewa-chat-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #1f6f4a;
    color: #fff;
    box-shadow: 0 12px 34px rgba(20, 35, 28, .28);
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hewa-chat-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d93a2f;
    color: #fff;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
}

.hewa-chat-panel {
    width: min(380px, calc(100vw - 28px));
    height: min(620px, calc(100vh - 96px));
    border: 1px solid #d7dfda;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(19, 28, 24, .22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hewa-chat-header {
    background: #1f6f4a;
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
}

.hewa-chat-header strong,
.hewa-chat-header span {
    display: block;
}

.hewa-chat-header span {
    color: rgba(255,255,255,.82);
    font-size: 13px;
}

.hewa-chat-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

.hewa-chat-body {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.hewa-chat-start {
    display: grid;
    gap: 12px;
}

.hewa-chat-start label {
    display: grid;
    gap: 5px;
    color: #334038;
    font-size: 13px;
    font-weight: 600;
}

.hewa-chat-start input,
.hewa-chat-start textarea,
.hewa-chat-reply textarea {
    width: 100%;
    border: 1px solid #cfd9d3;
    border-radius: 6px;
    padding: 10px 11px;
    color: #15221b;
    font: inherit;
}

.hewa-chat-start button,
.hewa-chat-new,
.hewa-chat-reply button {
    border: 0;
    border-radius: 6px;
    background: #1f6f4a;
    color: #fff;
    font-weight: 700;
    min-height: 42px;
    padding: 0 16px;
}

.hewa-chat-new {
    width: 100%;
    margin-top: 14px;
}

.hewa-chat-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
}

.hewa-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hewa-chat-message {
    max-width: 86%;
    border: 1px solid #dfe7e2;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f6f8f7;
    align-self: flex-start;
}

.hewa-chat-message.is-customer {
    align-self: flex-end;
    background: #edf7f1;
    border-color: #c7e2d1;
}

.hewa-chat-message.is-system {
    align-self: center;
    max-width: 100%;
    background: #fff8e8;
    border-color: #ecd79f;
    font-size: 13px;
}

.hewa-chat-message.hewa-chat-final-notice {
    width: 100%;
    text-align: center;
    color: #536058;
    background: #f6f8f7;
    border-color: #dfe7e2;
}

.hewa-chat-message small {
    display: block;
    color: #6c766f;
    margin-bottom: 4px;
    font-size: 11px;
}

.hewa-chat-message div {
    white-space: pre-wrap;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.hewa-chat-message a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

.hewa-chat-typing {
    width: fit-content;
    max-width: 86%;
    border: 1px solid #dfe7e2;
    border-radius: 8px;
    padding: 9px 12px;
    background: #f6f8f7;
    color: #55615a;
    font-size: 13px;
    margin-top: 10px;
}

.hewa-chat-reply {
    border-top: 1px solid #e1e8e4;
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 10px;
    padding: 12px;
}

.hewa-chat-reply textarea {
    min-height: 44px;
    max-height: 110px;
    resize: vertical;
}

.hewa-chat-error {
    margin: 0;
    color: #b72f2a;
    font-size: 13px;
}

@media (max-width: 520px) {
    .hewa-chat-widget {
        right: 14px;
        bottom: 14px;
    }

    .hewa-chat-panel {
        height: min(620px, calc(100vh - 82px));
    }
}
