.support-chat {
    --support-ink: #102b43;
    --support-muted: #526c80;
    --support-line: #d8e5ee;
    --support-accent: #007980;
    color: var(--support-ink);
}

.support-chat > h2 {
    margin: 0 0 14px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
    font-weight: 750;
    letter-spacing: -.03em;
}

.support-chat-workspace {
    display: grid;
    grid-template-columns: minmax(235px, 29%) minmax(0, 1fr);
    min-height: 560px;
    border: 1px solid var(--support-line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.support-chat-history {
    min-width: 0;
    border-right: 1px solid var(--support-line);
}

.support-chat-list-header,
.support-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 68px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--support-line);
}

.support-chat h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.25;
}

.support-chat-button,
.support-chat-notices summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px 12px;
    color: #00636a;
    background: #fff;
    border: 1px solid #bdd4db;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.support-chat-button:hover,
.support-chat-notices summary:hover {
    background: #eff9f9;
}

.support-chat-save {
    background: var(--support-accent);
    color: #fff;
    border-color: var(--support-accent);
}

.support-chat-save:hover {
    background: #00686e;
}

.support-chat button:disabled {
    opacity: .55;
    cursor: default;
}

.support-chat :is(button, input, textarea, a, summary):focus-visible {
    outline: 2px solid var(--support-accent);
    outline-offset: 2px;
}

.support-chat-list {
    max-height: 445px;
    overflow: auto;
}

.support-chat-item {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid #e6eef3;
    border-left: 4px solid transparent;
    overflow-wrap: anywhere;
}

.support-chat-item[aria-pressed="true"] {
    border-left-color: #05aaa9;
    background: #e4f6f5;
}

.support-chat-item span,
.support-chat-state,
.support-chat-bubble time {
    font-size: 12px;
    color: var(--support-muted);
}

.support-chat-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.support-chat-team {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-chat-team > i {
    color: var(--support-accent);
    font-size: 24px;
}

.support-chat-state::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #b47718;
}

.support-chat-notices {
    position: relative;
    flex-shrink: 0;
}

.support-chat-notices summary {
    list-style: none;
}

.support-chat-notices summary::-webkit-details-marker {
    display: none;
}

.support-chat-notices > div {
    position: absolute;
    z-index: 2;
    top: calc(100% + 8px);
    right: 0;
    width: min(260px, 65vw);
    padding: 14px;
    border: 1px solid var(--support-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 18px #102b4319;
}

.support-chat-notices label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    font-weight: 650;
}

.support-chat-notices input {
    accent-color: var(--support-accent);
}

.support-chat-notices p,
.support-chat-composer > p {
    margin: 8px 0 0;
    color: var(--support-muted);
    font-size: 12px;
    line-height: 1.45;
}

.support-chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-height: 200px;
    max-height: 390px;
    overflow: auto;
    padding: 16px;
    background: #f8fbfd;
}

.support-chat-empty {
    width: 100%;
    padding: 16px;
    margin: 0;
    color: var(--support-muted);
    font-size: 14px;
    line-height: 1.5;
}

.support-chat-messages .support-chat-empty {
    margin: auto;
    text-align: center;
}

.support-chat-bubble {
    display: grid;
    gap: 6px;
    max-width: min(86%, 520px);
    padding: 10px 14px;
    border-radius: 10px 10px 2px 10px;
    background: #e2f5f3;
    overflow-wrap: anywhere;
}

.support-chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
}

.support-chat-bubble time {
    text-align: right;
}

.support-chat-image img {
    max-height: 160px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.support-chat-feedback {
    padding: 7px 16px;
    margin: 0;
    color: #17666a;
    background: #f0fafa;
    font-size: 13px;
}

.support-chat-feedback:empty {
    display: none;
}

.support-chat-composer {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--support-line);
}

.support-chat-composer > label {
    display: grid;
    gap: 5px;
    font-size: 13px;
    font-weight: 650;
}

.support-chat-composer :is(input[type="text"], textarea, input:not([type])) {
    width: 100%;
    min-width: 0;
    border: 1px solid #bbcedb;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 400;
}

.support-chat-controls,
.support-chat-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.support-chat-preview {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.support-chat-preview img {
    max-width: 84px;
    max-height: 52px;
    border-radius: 5px;
}

.support-chat-composer > p {
    margin: 0;
}

.support-chat-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.support-chat-toolbar:has(button:not([hidden])) {
    padding: 7px 16px;
}

.support-chat-bubble.is-reply {
    align-self: flex-start;
    background: #edf2f8;
}

.support-chat-item .support-chat-unread {
    color: #00666c;
    font-weight: 750;
}

.cf-page:has(#cf-tab-soporte[aria-selected="true"]) :is(.cf-status-grid, .cf-offline, .cf-integration-footer, #cf-reminders) {
    display: none !important;
}

@media (max-width: 767px) {
    .support-chat-workspace {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .support-chat-history {
        border-right: 0;
        border-bottom: 1px solid var(--support-line);
    }

    .support-chat-list {
        max-height: 145px;
    }

    .support-chat-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .support-chat-messages {
        min-height: 165px;
        max-height: 45vh;
    }
}
