#telarsys-chat-web-root {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: Arial, Helvetica, sans-serif;
}

.telarsys-chat-web {
    --telarsys-chat-primary: #1f6feb;
    --telarsys-chat-primary-dark: #1f6feb;
    color: #1f2937;
}

.telarsys-chat-web *,
.telarsys-chat-web *::before,
.telarsys-chat-web *::after {
    box-sizing: border-box;
}

.telarsys-chat-web [hidden] {
    display: none !important;
}

.telarsys-chat-web__bubble {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 999px;
    background: var(--telarsys-chat-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.30);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.telarsys-chat-web__bubble:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.34);
}

.telarsys-chat-web__bubble-icon {
    position: relative;
    width: 30px;
    height: 22px;
    border: 2px solid #ffffff;
    border-radius: 10px;
}

.telarsys-chat-web__bubble-icon::after {
    content: "";
    position: absolute;
    left: 7px;
    bottom: -7px;
    width: 10px;
    height: 10px;
    background: var(--telarsys-chat-primary);
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-35deg);
}

.telarsys-chat-web__window {
    display: none;
    width: 410px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 110px);
    overflow: hidden;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.32);
    margin-bottom: 14px;
    animation: telarsysChatWebIn 0.22s ease-out;
}

.telarsys-chat-web.is-open .telarsys-chat-web__window {
    display: flex;
    flex-direction: column;
}

.telarsys-chat-web.is-open .telarsys-chat-web__bubble {
    display: none;
}

.telarsys-chat-web__header {
    background: var(--telarsys-chat-primary);
    color: #ffffff;
    padding: 18px 18px 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex: 0 0 auto;
}

.telarsys-chat-web__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.telarsys-chat-web__subtitle {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.92;
}

.telarsys-chat-web__close {
    width: 31px;
    height: 31px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    font-size: 24px;
    line-height: 28px;
    cursor: pointer;
    flex: 0 0 auto;
}

.telarsys-chat-web__body {
    padding: 16px;
    background: #f5f7fb;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.telarsys-chat-web__message {
    background: #ffffff;
    border-radius: 16px 16px 16px 5px;
    padding: 13px 15px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
}

.telarsys-chat-web__diagnostic {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #eef2f7;
    color: #475569;
    font-size: 11px;
    line-height: 1.45;
}

.telarsys-chat-web__initial,
.telarsys-chat-web__active {
    margin-top: 13px;
}

.telarsys-chat-web__form {
    position: relative;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}

.telarsys-chat-web__field {
    min-width: 0;
    margin-bottom: 11px;
}

.telarsys-chat-web__field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.telarsys-chat-web__field label {
    display: block;
    margin-bottom: 5px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.telarsys-chat-web__optional {
    color: #64748b;
    font-size: 11px;
    font-weight: 400;
}

.telarsys-chat-web__field input,
.telarsys-chat-web__field textarea,
.telarsys-chat-web__composer textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    padding: 9px 10px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.telarsys-chat-web__field textarea,
.telarsys-chat-web__composer textarea {
    display: block;
    resize: vertical;
    min-height: 72px;
}

.telarsys-chat-web__field input:focus,
.telarsys-chat-web__field textarea:focus,
.telarsys-chat-web__composer textarea:focus,
.telarsys-chat-web button:focus-visible,
.telarsys-chat-web a:focus-visible {
    outline: 3px solid rgba(31, 111, 235, 0.28);
    outline-offset: 2px;
    border-color: var(--telarsys-chat-primary);
}

.telarsys-chat-web__help {
    margin: -2px 0 11px 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.telarsys-chat-web__counter {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    text-align: right;
}

.telarsys-chat-web__honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.telarsys-chat-web__privacy {
    margin: 2px 0 10px 0;
    padding: 9px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.telarsys-chat-web__privacy-check {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #334155;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.telarsys-chat-web__privacy-check input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--telarsys-chat-primary);
}

.telarsys-chat-web__privacy-info {
    margin: 6px 0 0 22px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.4;
}

.telarsys-chat-web__privacy-info strong {
    color: #475569;
}

.telarsys-chat-web__privacy a {
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.telarsys-chat-web__form-status,
.telarsys-chat-web__conversation-status {
    min-height: 18px;
    margin: 8px 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
}

.telarsys-chat-web__form-status--error,
.telarsys-chat-web__conversation-status--error {
    color: #b42318;
}

.telarsys-chat-web__form-status--success,
.telarsys-chat-web__conversation-status--success {
    color: #137333;
}

.telarsys-chat-web__form-status--info,
.telarsys-chat-web__conversation-status--info {
    color: #334155;
}

.telarsys-chat-web__button {
    border: 0;
    border-radius: 11px;
    padding: 10px 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}

.telarsys-chat-web__button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.telarsys-chat-web__button--primary {
    width: 100%;
    background: var(--telarsys-chat-primary);
    color: #ffffff;
}

.telarsys-chat-web__button--primary:hover:not(:disabled) {
    filter: brightness(0.94);
}

.telarsys-chat-web__history {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 300px;
    min-height: 90px;
    overflow-y: auto;
    padding: 2px 3px 10px 3px;
    scroll-behavior: smooth;
}

.telarsys-chat-web__chat-message {
    width: fit-content;
    max-width: 82%;
    padding: 9px 11px;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.telarsys-chat-web__chat-message--visitante {
    align-self: flex-end;
    border-radius: 14px 14px 5px 14px;
    background: var(--telarsys-chat-primary);
    color: #ffffff;
}

.telarsys-chat-web__chat-message--soporte {
    align-self: flex-start;
    border-radius: 14px 14px 14px 5px;
    background: #ffffff;
    color: #1f2937;
}

.telarsys-chat-web__chat-message--sistema {
    align-self: center;
    max-width: 92%;
    background: #e9eef5;
    color: #475569;
    text-align: center;
    box-shadow: none;
}

.telarsys-chat-web__chat-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    opacity: 0.78;
}

.telarsys-chat-web__chat-text {
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.telarsys-chat-web__composer {
    margin-top: 9px;
    padding: 10px;
    border: 1px solid #dbe3ec;
    border-radius: 13px;
    background: #ffffff;
}

.telarsys-chat-web__composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
}

.telarsys-chat-web__composer-footer .telarsys-chat-web__counter {
    margin-top: 0;
    text-align: left;
}

.telarsys-chat-web__button--send {
    width: auto;
    min-width: 90px;
}

.telarsys-chat-web__closed {
    margin-top: 8px;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #eef2f7;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.telarsys-chat-web__finish {
    display: block;
    margin: 8px auto 0 auto;
    padding: 5px 4px;
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    text-decoration: underline;
}

.telarsys-chat-web__finish:hover {
    color: #334155;
}

.telarsys-chat-web__finish-confirm {
    margin-top: 9px;
    padding: 11px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
}

.telarsys-chat-web__finish-confirm p {
    margin: 0 0 9px 0;
    color: #7f1d1d;
    font-size: 12px;
    line-height: 1.4;
}

.telarsys-chat-web__finish-actions {
    display: flex;
    gap: 8px;
}

.telarsys-chat-web__button--danger {
    flex: 1;
    background: #b42318;
    color: #ffffff;
}

.telarsys-chat-web__button--plain {
    flex: 1;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.telarsys-chat-web__secondary {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #dbe3ec;
}

.telarsys-chat-web__secondary-link {
    color: #475569;
    font-size: 11px;
    text-decoration: underline;
}

.telarsys-chat-web__secondary-link:hover {
    color: #1f2937;
}

.telarsys-chat-web__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;
}

@keyframes telarsysChatWebIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    #telarsys-chat-web-root {
        right: 16px;
        bottom: 16px;
    }

    .telarsys-chat-web__window {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 94px);
    }

    .telarsys-chat-web__body {
        padding: 13px;
    }

    .telarsys-chat-web__field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .telarsys-chat-web__history {
        max-height: 250px;
    }
}
