.public-chatbot {
    --chat-green: #08783f;
    --chat-green-dark: #17452e;
    --chat-orange: #f58220;
    --chat-ink: #10251b;
    --chat-muted: #687a70;
    --chat-border: #dfe8e2;
    position: fixed;
    right: 24px;
    bottom: 108px;
    z-index: 1000;
    font-family: inherit;
}

.public-chatbot[hidden],
.public-chatbot-panel[hidden] {
    display: none !important;
}

.public-chatbot-launcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--chat-orange), #ed6d16);
    color: #fff;
    box-shadow: 0 12px 30px rgba(29, 63, 44, .28);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.public-chatbot-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(29, 63, 44, .36);
}

.public-chatbot-launcher i {
    font-size: 21px;
}

.public-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    flex-direction: column;
    width: min(405px, calc(100vw - 32px));
    height: min(600px, calc(100dvh - 120px));
    overflow: hidden;
    border: 1px solid rgba(18, 53, 34, .12);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(14, 34, 23, .28);
    transform-origin: bottom right;
    animation: chat-panel-in .18s ease-out;
}

@keyframes chat-panel-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.public-chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(120deg, var(--chat-green-dark), var(--chat-green));
    color: #fff;
}

.public-chatbot-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .16);
    font-size: 19px;
}

.public-chatbot-title-wrap {
    min-width: 0;
    flex: 1;
}

.public-chatbot-header strong,
.public-chatbot-header small {
    display: block;
}

.public-chatbot-header strong {
    font-size: 15px;
    line-height: 1.25;
}

.public-chatbot-header small {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: rgba(255, 255, 255, .84);
    font-size: 11px;
}

.public-chatbot-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .22);
}

.public-chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.public-chatbot-icon-btn,
.public-chatbot-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.public-chatbot-icon-btn {
    font-size: 13px;
}

.public-chatbot-close {
    font-size: 22px;
    line-height: 1;
}

.public-chatbot-icon-btn:hover,
.public-chatbot-close:hover {
    border-color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .16);
}

.public-chatbot-quickbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--chat-border);
    background: #eef6f1;
    overflow-x: auto;
}

.public-chatbot-quicklink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid #cce0d3;
    border-radius: 999px;
    background: #fff;
    color: var(--chat-green-dark) !important;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.public-chatbot-quicklink:hover {
    border-color: var(--chat-green);
    background: #f4faf6;
}

.public-chatbot-quicklink.is-whatsapp {
    border-color: rgba(22, 163, 74, .35);
    background: #ecfdf3;
    color: #14532d !important;
}

.public-chatbot-quicklink.is-whatsapp i {
    color: #16a34a;
    font-size: 13px;
}

.public-chatbot-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px;
    overflow-y: auto;
    background: #f5f8f6;
    scroll-behavior: smooth;
}

.public-chatbot-message {
    max-width: 90%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.58;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.public-chatbot-message strong {
    font-weight: 700;
    color: var(--chat-green-dark);
}

.public-chatbot-message.is-bot {
    align-self: flex-start;
    border: 1px solid var(--chat-border);
    border-top-left-radius: 5px;
    background: #fff;
    color: var(--chat-ink);
    box-shadow: 0 2px 8px rgba(16, 37, 27, .04);
}

.public-chatbot-message.is-user {
    align-self: flex-end;
    border-top-right-radius: 5px;
    background: linear-gradient(135deg, var(--chat-green-dark), var(--chat-green));
    color: #fff;
}

.public-chatbot-message.is-error {
    border: 1px solid #f3d1c7;
    background: #fff7f4;
    color: #9b351b;
}

.public-chatbot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: -2px;
}

.public-chatbot-links a,
.public-chatbot-suggestions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #c9dfd0;
    border-radius: 999px;
    background: #fff;
    color: #17633b;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.public-chatbot-links a:hover,
.public-chatbot-suggestions button:hover {
    border-color: var(--chat-green);
    background: #edf7f0;
    transform: translateY(-1px);
}

.public-chatbot-links a.is-whatsapp {
    border-color: rgba(22, 163, 74, .4);
    background: #ecfdf3;
    color: #14532d;
}

.public-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.public-chatbot-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--chat-border);
    background: #fff;
}

.public-chatbot-form input {
    min-width: 0;
    flex: 1;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    outline: none;
    color: var(--chat-ink);
    font: inherit;
    font-size: 13px;
}

.public-chatbot-form input:focus {
    border-color: #65a77d;
    box-shadow: 0 0 0 3px rgba(8, 120, 63, .1);
}

.public-chatbot-form button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 12px;
    background: var(--chat-green);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background .15s ease;
}

.public-chatbot-form button:hover:not(:disabled) {
    background: var(--chat-green-dark);
}

.public-chatbot-form button:disabled {
    opacity: .55;
    cursor: wait;
}

.public-chatbot-note {
    margin: 0;
    padding: 0 14px 10px;
    background: #fff;
    color: var(--chat-muted);
    font-size: 10.5px;
    text-align: center;
}

.public-chatbot-typing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 9px 13px;
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    background: #fff;
    color: var(--chat-muted);
    font-size: 12px;
}

.public-chatbot-dots {
    display: inline-flex;
    gap: 4px;
}

.public-chatbot-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chat-green);
    opacity: .4;
    animation: chatbot-dot-pulse 1.2s infinite ease-in-out;
}

.public-chatbot-dots span:nth-child(2) {
    animation-delay: .2s;
}

.public-chatbot-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes chatbot-dot-pulse {
    0%, 80%, 100% {
        transform: scale(.85);
        opacity: .35;
    }
    40% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    .public-chatbot {
        right: 14px;
        bottom: 108px;
    }
    .public-chatbot-launcher {
        width: 58px;
        height: 58px;
        min-height: 58px;
        padding: 0;
        border-radius: 50%;
    }
    .public-chatbot-launcher-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
    .public-chatbot-panel {
        position: fixed;
        right: 8px;
        bottom: 176px;
        width: calc(100vw - 16px);
        height: min(600px, calc(100dvh - 192px));
        border-radius: 18px;
    }
    .public-chatbot-header {
        padding: 14px;
    }
    .public-chatbot-messages {
        padding: 14px 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .public-chatbot-panel,
    .public-chatbot-dots span {
        animation: none;
    }
    .public-chatbot-launcher {
        transition: none;
    }
}
