.support-chat-widget, .support-chat-workspace {
    --chat-green: #00795e;
    --chat-ink: #243731;
    --chat-muted: #586b65;
    --chat-line: #dce7e2;
    --chat-wash: #f3f8f6;
    color: var(--chat-ink);
}
.support-chat-widget [hidden], .support-chat-workspace [hidden] { display: none !important; }
.support-chat-widget button, .support-chat-workspace button,
.support-chat-widget textarea, .support-chat-workspace textarea { font: inherit; }
.support-chat-widget button, .support-chat-workspace button { cursor: pointer; }
.support-chat-widget :focus-visible, .support-chat-workspace :focus-visible {
    outline: 2px solid var(--chat-green);
    outline-offset: 3px;
}
.support-chat-bar {
    position: fixed;
    right: max(12px, calc((100vw - 1280px) / 2 - 54px));
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 50px);
    z-index: 70;
    display: grid;
    width: 46px;
    background: #fff;
    border: 1px solid var(--chat-line);
    border-radius: 9px;
    box-shadow: 0 4px 16px #14372b22;
}
.support-chat-bar > * {
    position: relative;
    background: none;
    border: 0;
    color: var(--chat-green);
    text-decoration: none;
    min-height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
}
.support-chat-bar > :first-child { border-radius: 8px 8px 0 0; }
.support-chat-bar > :last-child { border-radius: 0 0 8px 8px; }
.support-chat-bar > * + * { border-top: 1px solid var(--chat-line); }
.support-chat-bar > *:hover { background: var(--chat-wash); }
.support-chat-bar .fa { font-size: 21px; }
.support-chat-bar > *::after {
    content: attr(aria-label);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    display: none;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--chat-green);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
}
.support-chat-bar > :focus-visible::after { display: block; }
@media (hover: hover) {
    .support-chat-bar > :hover::after { display: block; }
}
.support-chat-panel {
    position: fixed;
    z-index: 71;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    right: max(102px, calc((100vw - 1280px) / 2 + 2px));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(418px, calc(100vw - 124px));
    height: min(515px, calc(100vh - 40px));
    background: #fff;
    border: 1px solid var(--chat-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 42px #15372c35;
    font-size: 14px;
}
.support-chat-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 11px 17px;
    background: var(--chat-green);
    color: #fff;
}
.support-chat-panel-head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.support-chat-panel-head p { color: #e6f6f0; font-size: 12px; margin: 4px 0 0; }
.support-chat-panel-head button {
    border: 0; background: transparent; color: #fff; min-width: 36px; min-height: 36px;
}
.support-chat-panel-head button:focus-visible { outline-color: #fff; }
.support-chat-scroller {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 16px;
    background: var(--chat-wash);
}
.support-chat-empty {
    text-align: center;
    line-height: 1.65;
    color: var(--chat-muted);
    padding: 22px 9px;
    margin: 0;
}
.support-chat-earlier {
    display: block;
    margin: 0 auto 12px;
    background: #fff;
    border: 1px solid var(--chat-line);
    border-radius: 5px;
    padding: 5px 10px;
    color: var(--chat-green);
}
.support-chat-message { display: grid; justify-items: start; margin-bottom: 14px; }
.support-chat-unread {
    margin: 0 0 12px; text-align: center; color: var(--chat-green); font-size: 12px;
    border-top: 1px solid var(--chat-line); padding-top: 6px;
}
.support-chat-message.is-own { justify-items: end; }
.support-chat-message-meta { font-size: 11px; color: var(--chat-muted); padding: 0 3px 4px; }
.support-chat-bubble {
    max-width: 86%;
    padding: 8px 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #fff;
    border: 1px solid var(--chat-line);
    border-radius: 4px 9px 9px 9px;
}
.support-chat-message.is-own .support-chat-bubble {
    background: #d9f1e8;
    border-color: #d0e8df;
    border-radius: 9px 4px 9px 9px;
}
.support-chat-compose { padding: 11px 14px; border-top: 1px solid var(--chat-line); background: #fff; }
.support-chat-compose > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; }
.support-chat-compose textarea {
    min-height: 46px;
    resize: vertical;
    max-height: 120px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #c9d9d3;
    border-radius: 6px;
    background: #fff;
    color: var(--chat-ink);
    padding: 7px 9px;
}
.support-chat-compose button {
    background: var(--chat-green); color: #fff; border: 0; border-radius: 6px;
    min-height: 40px; padding: 7px 15px; font-weight: 600;
}
.support-chat-compose button:disabled { opacity: .55; cursor: default; }
.support-chat-compose [data-feedback] { font-size: 12px; color: var(--chat-muted); margin: 0 0 6px; }
.support-chat-compose [data-feedback]:empty { display: none; }
.support-chat-compose [data-error=true] { color: #a72920; }
.support-chat-workspace { padding: 18px; max-width: 1440px; margin: auto; }
.support-chat-workspace *, .support-chat-widget * { box-sizing: border-box; }
.support-chat-workspace > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.support-chat-workspace h1 { font-size: 22px; font-weight: 600; }
.support-chat-workspace [data-connection] { color: var(--chat-muted); font-size: 12px; }
.support-chat-desk {
    height: min(710px, calc(100vh - 160px));
    min-height: 380px;
    display: grid; grid-template-columns: minmax(225px, 335px) minmax(0, 1fr);
    border: 1px solid var(--chat-line); border-radius: 8px; overflow: hidden; background: #fff;
}
.support-chat-queue { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border-right: 1px solid var(--chat-line); }
.support-chat-filters { display: flex; gap: 7px; padding: 11px; border-bottom: 1px solid var(--chat-line); }
.support-chat-filters button, .support-chat-back {
    border: 1px solid var(--chat-line); background: #fff; color: var(--chat-ink); padding: 6px 11px; border-radius: 5px;
}
.support-chat-filters button[aria-pressed=true] { background: var(--chat-wash); border-color: #8eb7a7; color: var(--chat-green); font-weight: 600; }
.support-chat-queue-list { overflow: auto; }
.support-chat-queue-entry {
    width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--chat-line);
    padding: 11px 13px; display: grid; gap: 5px; background: #fff; color: var(--chat-ink);
}
.support-chat-queue-entry:hover, .support-chat-queue-entry[aria-current=true] { background: var(--chat-wash); }
.support-chat-queue-entry[aria-current=true] { box-shadow: inset 3px 0 var(--chat-green); }
.support-chat-queue-entry strong { font-size: 13px; overflow-wrap: anywhere; }
.support-chat-queue-details { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--chat-muted); }
.support-chat-queue-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.support-chat-queue-entry.is-unread strong { color: var(--chat-green); }
.support-chat-thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
.support-chat-thread header { min-height: 54px; display: flex; align-items: center; gap: 8px; padding: 10px 15px; border-bottom: 1px solid var(--chat-line); }
.support-chat-thread h2 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.support-chat-back { display: none; }
@media (max-width: 600px) {
    .support-chat-bar { right: 8px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 50px); }
    .support-chat-panel {
        width: auto; height: min(510px, calc(100vh - 28px)); height: min(510px, calc(100dvh - 28px));
        right: 8px; left: 8px; bottom: max(8px, env(safe-area-inset-bottom));
    }
    .support-chat-widget:has(.support-chat-panel:not([hidden])) .support-chat-bar { visibility: hidden; }
    .support-chat-compose textarea { font-size: 16px; }
    .support-chat-workspace { padding: 9px; }
    .support-chat-desk { display: block; height: calc(100dvh - 130px); }
    .support-chat-queue, .support-chat-thread { height: 100%; }
    .support-chat-workspace:not([data-selected=true]) .support-chat-thread,
    .support-chat-workspace[data-selected=true] .support-chat-queue { display: none; }
    .support-chat-back { display: inline-block; flex: none; }
}
