.tbchatbot-widget {
    --tbchatbot-color: #0b6e4f;
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.tbchatbot-widget.tbchatbot-bottom-right { right: 20px; }
.tbchatbot-widget.tbchatbot-bottom-left  { left: 20px; }

.tbchatbot-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: var(--tbchatbot-color);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}

.tbchatbot-toggle:hover { transform: scale(1.06); }

.tbchatbot-panel {
    position: absolute;
    bottom: 72px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tbchatbot-widget.tbchatbot-max .tbchatbot-panel {
    width: min(760px, calc(100vw - 40px));
    height: calc(100vh - 120px);
}

.tbchatbot-resizer {
    position: absolute;
    top: 0;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    z-index: 2;
    opacity: .55;
}

.tbchatbot-resizer::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    border-radius: 3px 0 0 0;
}

.tbchatbot-bottom-right .tbchatbot-resizer { left: 0; }
.tbchatbot-bottom-left  .tbchatbot-resizer { right: 0; cursor: nesw-resize; transform: scaleX(-1); }

.tbchatbot-resizer:hover { opacity: 1; }

.tbchatbot-bottom-right .tbchatbot-panel { right: 0; }
.tbchatbot-bottom-left  .tbchatbot-panel { left: 0; }

.tbchatbot-header {
    background: var(--tbchatbot-color);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 15px;
}

.tbchatbot-close,
.tbchatbot-maximize {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.tbchatbot-header-buttons {
    display: flex;
    gap: 2px;
}

.tbchatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f7f7f8;
}

.tbchatbot-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
}

.tbchatbot-msg-bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e2e2e2;
    color: #222;
    border-bottom-left-radius: 4px;
}

.tbchatbot-msg-user {
    align-self: flex-end;
    background: var(--tbchatbot-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.tbchatbot-msg.tbchatbot-typing {
    opacity: .6;
    font-style: italic;
}

.tbchatbot-msg a {
    color: inherit;
    text-decoration: underline;
    word-break: break-word;
}

.tbchatbot-msg-bot a { color: var(--tbchatbot-color); }

.tbchatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 8px;
    background: #f7f7f8;
}

.tbchatbot-chip {
    border: 1px solid var(--tbchatbot-color);
    color: var(--tbchatbot-color);
    background: #fff;
    border-radius: 14px;
    padding: 5px 11px;
    font-size: 12.5px;
    line-height: 1.3;
    cursor: pointer;
    text-align: left;
    max-width: 100%;
}

.tbchatbot-chip:hover {
    background: var(--tbchatbot-color);
    color: #fff;
}

.tbchatbot-form {
    display: flex;
    border-top: 1px solid #eee;
    padding: 8px;
    gap: 6px;
}

.tbchatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}

.tbchatbot-input:focus { border-color: var(--tbchatbot-color); }

.tbchatbot-send {
    border: none;
    background: var(--tbchatbot-color);
    color: #fff;
    border-radius: 20px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
}

.tbchatbot-send:hover { opacity: .92; }

@media (max-width: 480px) {
    .tbchatbot-panel,
    .tbchatbot-widget.tbchatbot-max .tbchatbot-panel {
        width: calc(100vw - 24px);
        height: 70vh;
    }

    .tbchatbot-resizer,
    .tbchatbot-maximize {
        display: none;
    }
}
