:root {
    --sinta-chat-primary: #0f766e;
    --sinta-chat-primary-dark: #0b5f59;
    --sinta-chat-accent: #14b8a6;
    --sinta-chat-ink: #132238;
    --sinta-chat-muted: #64748b;
    --sinta-chat-surface: #ffffff;
    --sinta-chat-soft: #f1f5f9;
    --sinta-chat-border: #dbe4ee;
    --sinta-chat-danger: #b42318;
}

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

.sinta-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1085;
    color: var(--sinta-chat-ink);
    font-family: inherit;
}

.sinta-chatbot-launcher {
    min-width: 60px;
    height: 60px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sinta-chat-primary), var(--sinta-chat-accent));
    color: #fff;
    box-shadow: 0 14px 36px rgba(15, 118, 110, .32);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.sinta-chatbot-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(15, 118, 110, .4);
}

.sinta-chatbot-launcher:focus-visible,
.sinta-chatbot button:focus-visible,
.sinta-chatbot input:focus-visible,
.sinta-chatbot textarea:focus-visible,
.sinta-chatbot summary:focus-visible {
    outline: 3px solid rgba(20, 184, 166, .35);
    outline-offset: 2px;
}

.sinta-chatbot-launcher svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.sinta-chatbot-notification {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #f04438;
}

.sinta-chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(400px, calc(100vw - 32px));
    height: min(650px, calc(100vh - 120px));
    min-height: 500px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 22px;
    background: var(--sinta-chat-surface);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
    overflow: hidden;
    transform-origin: bottom right;
    animation: sinta-chatbot-open .2s ease-out;
}

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

@keyframes sinta-chatbot-open {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sinta-chatbot-header {
    height: 76px;
    padding: 14px 15px 14px 17px;
    background: linear-gradient(135deg, #0b625c, #0f766e 56%, #0d9488);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sinta-chatbot-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.sinta-chatbot-brand > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sinta-chatbot-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.35;
}

.sinta-chatbot-brand small {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .84);
    font-size: 12px;
}

.sinta-chatbot-brand small i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #86efac;
    box-shadow: 0 0 0 3px rgba(134, 239, 172, .16);
}

.sinta-chatbot-brand small.is-busy i { background: #fde68a; }
.sinta-chatbot-brand small.is-error i { background: #fda29b; }

.sinta-chatbot-avatar {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 14px;
    background: rgba(255, 255, 255, .95);
    color: var(--sinta-chat-primary);
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 20px;
    font-weight: 800;
}

.sinta-chatbot-avatar img {
    width: 100%;
    height: 100%;
    padding: 5px;
    object-fit: contain;
}

.sinta-chatbot-header-actions {
    display: flex;
    gap: 4px;
}

.sinta-chatbot-header-actions button {
    width: 34px;
    height: 34px;
    padding: 7px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.sinta-chatbot-header-actions button:hover { background: rgba(255, 255, 255, .14); }
.sinta-chatbot-header-actions svg { width: 100%; height: 100%; fill: currentColor; }

.sinta-chatbot-start {
    height: calc(100% - 76px);
    padding: 28px 24px 22px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 90% 8%, rgba(20, 184, 166, .12), transparent 34%),
        #fff;
}

.sinta-chatbot-welcome-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #ccfbf1;
    color: var(--sinta-chat-primary);
    display: grid;
    place-items: center;
    font-size: 24px;
}

.sinta-chatbot-start h2 {
    margin: 0 0 9px;
    font-size: 21px;
    font-weight: 750;
}

.sinta-chatbot-start > p {
    margin: 0 0 22px;
    color: var(--sinta-chat-muted);
    font-size: 14px;
    line-height: 1.55;
}

.sinta-chatbot-contact {
    margin-bottom: 14px;
    border: 1px solid var(--sinta-chat-border);
    border-radius: 13px;
    background: #fff;
}

.sinta-chatbot-contact summary {
    padding: 13px 14px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.sinta-chatbot-contact-fields {
    padding: 2px 14px 14px;
    display: grid;
    gap: 10px;
}

.sinta-chatbot-contact-fields label:not(.sinta-chatbot-consent) {
    display: grid;
    gap: 5px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
}

.sinta-chatbot-contact-fields input[type="text"],
.sinta-chatbot-contact-fields input[type="email"],
.sinta-chatbot-contact-fields input[type="tel"] {
    width: 100%;
    height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--sinta-chat-border);
    border-radius: 9px;
    color: var(--sinta-chat-ink);
    font: inherit;
}

.sinta-chatbot-consent {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 8px;
    color: var(--sinta-chat-muted);
    font-size: 11px;
    line-height: 1.4;
}

.sinta-chatbot-consent input { margin-top: 2px; accent-color: var(--sinta-chat-primary); }

.sinta-chatbot-primary {
    width: 100%;
    min-height: 46px;
    padding: 10px 15px;
    border: 0;
    border-radius: 12px;
    background: var(--sinta-chat-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    cursor: pointer;
}

.sinta-chatbot-primary:hover { background: var(--sinta-chat-primary-dark); }
.sinta-chatbot-primary:disabled { opacity: .65; cursor: wait; }
.sinta-chatbot-primary svg { width: 18px; height: 18px; fill: currentColor; }

.sinta-chatbot-contact-note {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    font-size: 12px;
}

.sinta-chatbot-contact-note a { color: var(--sinta-chat-primary); text-decoration: none; }

.sinta-chatbot-conversation {
    height: calc(100% - 76px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    background: #f8fafc;
}

.sinta-chatbot-messages {
    padding: 18px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.sinta-chatbot-message {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sinta-chatbot-message.is-visitor { align-items: flex-end; }

.sinta-chatbot-message-meta {
    margin: 0 4px 4px;
    color: #94a3b8;
    font-size: 10px;
}

.sinta-chatbot-message-bubble {
    max-width: 85%;
    padding: 10px 12px;
    border: 1px solid var(--sinta-chat-border);
    border-radius: 5px 15px 15px 15px;
    background: #fff;
    color: #253449;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.sinta-chatbot-message.is-visitor .sinta-chatbot-message-bubble {
    border-color: var(--sinta-chat-primary);
    border-radius: 15px 5px 15px 15px;
    background: var(--sinta-chat-primary);
    color: #fff;
}

.sinta-chatbot-message.is-agent .sinta-chatbot-message-bubble {
    border-color: #99f6e4;
    background: #ecfdf5;
}

.sinta-chatbot-message.is-error .sinta-chatbot-message-bubble {
    border-color: #fecdca;
    background: #fff4f2;
    color: var(--sinta-chat-danger);
}

.sinta-chatbot-typing {
    display: flex;
    gap: 4px;
}

.sinta-chatbot-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: sinta-chatbot-typing 1s infinite ease-in-out;
}

.sinta-chatbot-typing i:nth-child(2) { animation-delay: .15s; }
.sinta-chatbot-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes sinta-chatbot-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.sinta-chatbot-products {
    width: 100%;
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.sinta-chatbot-product {
    width: min(310px, 100%);
    padding: 9px;
    border: 1px solid var(--sinta-chat-border);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.sinta-chatbot-product:hover {
    border-color: var(--sinta-chat-accent);
    color: inherit;
    transform: translateY(-1px);
}

.sinta-chatbot-product-image {
    width: 58px;
    height: 58px;
    border-radius: 9px;
    background: var(--sinta-chat-soft);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
}

.sinta-chatbot-product-image img { width: 100%; height: 100%; object-fit: cover; }
.sinta-chatbot-product-info { min-width: 0; }
.sinta-chatbot-product-info strong { display: block; overflow: hidden; color: #1e293b; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sinta-chatbot-product-price { margin-top: 5px; color: var(--sinta-chat-primary); font-size: 13px; font-weight: 750; }
.sinta-chatbot-product-stock { color: var(--sinta-chat-muted); font-size: 10px; }

.sinta-chatbot-quick-prompts {
    padding: 8px 12px;
    border-top: 1px solid #e8eef5;
    background: #fff;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.sinta-chatbot-quick-prompts button {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid #bfe8e2;
    border-radius: 999px;
    background: #f0fdfa;
    color: var(--sinta-chat-primary-dark);
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.sinta-chatbot-quick-prompts button:hover { background: #ccfbf1; }
.sinta-chatbot-quick-prompts button:disabled { opacity: .55; cursor: wait; }

.sinta-chatbot-composer {
    padding: 10px 12px;
    border-top: 1px solid #e8eef5;
    background: #fff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
    gap: 8px;
}

.sinta-chatbot-composer textarea {
    width: 100%;
    max-height: 100px;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid var(--sinta-chat-border);
    border-radius: 12px;
    resize: none;
    color: var(--sinta-chat-ink);
    font: inherit;
    font-size: 13px;
    line-height: 20px;
}

.sinta-chatbot-composer button {
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: var(--sinta-chat-primary);
    color: #fff;
    cursor: pointer;
}

.sinta-chatbot-composer button:disabled { opacity: .5; cursor: wait; }
.sinta-chatbot-composer svg { width: 100%; height: 100%; fill: currentColor; }

.sinta-chatbot-disclaimer {
    padding: 0 12px 8px;
    background: #fff;
    color: #94a3b8;
    font-size: 9px;
    text-align: center;
}

@media (max-width: 575.98px) {
    .sinta-chatbot { right: 12px; bottom: 12px; }
    .sinta-chatbot-launcher { width: 58px; min-width: 58px; height: 58px; padding: 0; }
    .sinta-chatbot-launcher-label { display: none; }
    .sinta-chatbot-panel {
        position: fixed;
        inset: 10px 10px 80px;
        width: auto;
        height: auto;
        min-height: 0;
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sinta-chatbot-panel,
    .sinta-chatbot-launcher,
    .sinta-chatbot-typing i,
    .sinta-chatbot-product { animation: none; transition: none; scroll-behavior: auto; }
}

@media print {
    .sinta-chatbot { display: none !important; }
}
