.customer-support-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: #132d53;
    color: #fff;
    box-shadow: 0 14px 38px rgba(18, 48, 91, .26);
    font: inherit;
    cursor: pointer;
}

.customer-support-launcher span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2f6fed;
    font-weight: 900;
}

.customer-support-widget[data-authenticated="true"] .customer-support-launcher {
    right: calc(24px + max(104px, 6.5rem) + 8px);
    bottom: 24px;
    box-sizing: border-box;
    width: max(104px, 6.5rem);
    min-width: max(104px, 6.5rem);
    min-height: 44px;
    display: inline-flex;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    font-size: .8125rem;
    border-color: rgba(255, 255, 255, .3);
    background: linear-gradient(135deg, #1767df, #2f80ed);
    box-shadow: 0 16px 38px rgba(37, 99, 235, .3);
}

.customer-support-widget[data-authenticated="true"] .customer-support-launcher span {
    width: 18px;
    height: 18px;
    background: #fff;
    color: #1d4ed8;
}

.customer-support-widget[data-authenticated="true"] .customer-support-launcher strong {
    white-space: nowrap;
}

.customer-support-topbar-trigger {
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.public-login-unified-theme .customer-support-launcher {
    border-color: rgba(255, 255, 255, .22);
    background: linear-gradient(135deg, #0b1f3a, #173d73);
    box-shadow: 0 16px 38px rgba(11, 31, 58, .28);
}

.public-login-unified-theme .customer-support-launcher span {
    background: #2f6fed;
}

.customer-support-widget .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;
}

.customer-support-dialog {
    width: min(440px, calc(100vw - 32px));
    height: min(760px, calc(100dvh - 32px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    color: #17243a;
    box-shadow: 0 24px 80px rgba(13, 32, 60, .28);
}

.customer-support-dialog::backdrop {
    background: rgba(15, 30, 52, .42);
    backdrop-filter: blur(3px);
}

.customer-support-panel {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dce6f3;
    border-radius: 24px;
    background: #f7faff;
}

.customer-support-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(135deg, #102c50, #1d4c86);
    color: #fff;
}

.customer-support-kicker {
    display: block;
    margin-bottom: 5px;
    color: #bed8ff;
    font-size: 12px;
    font-weight: 800;
}

.customer-support-head h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
}

.customer-support-head p {
    margin: 7px 0 0;
    color: #dbeaff;
    font-size: 13px;
    line-height: 1.5;
}

.customer-support-close {
    min-width: 48px;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.customer-support-ticket {
    margin: 12px 16px 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: #e7f0ff;
    color: #1c4f92;
    font-size: 12px;
    font-weight: 800;
}

.customer-support-body {
    position: relative;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.customer-support-messages {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 16px;
    overscroll-behavior: contain;
}

.customer-support-message {
    width: fit-content;
    max-width: 86%;
    margin: 0 0 12px;
    padding: 11px 13px;
    border: 1px solid #dce5f0;
    border-radius: 15px 15px 15px 4px;
    background: #fff;
    color: #24344d;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.customer-support-message-label,
.customer-support-message-text {
    display: block;
}

.customer-support-message-label {
    margin-bottom: 3px;
    color: #4e6581;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.25;
}

.customer-support-message.customer .customer-support-message-label {
    color: #1c6090;
    text-align: right;
}

.customer-support-message.ai .customer-support-message-label {
    color: #14746f;
}

.customer-support-message.customer {
    margin-left: auto;
    border-color: #b9d5f2;
    border-radius: 15px 15px 4px 15px;
    background: #eaf6fb;
}

.customer-support-message.is-sending {
    opacity: .72;
}

.customer-support-message.is-failed {
    border-color: #e5a39d;
    background: #fff4f2;
}

.customer-support-message-state {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    color: #6f7d90;
    font-size: 11px;
    font-weight: 700;
}

.customer-support-message.is-failed .customer-support-message-state {
    color: #b4322c;
}

.customer-support-message-state button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #dc8f88;
    border-radius: 9px;
    background: #fff;
    color: #a82c27;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.customer-support-message.operator {
    border-color: #9db8dc;
    border-left: 4px solid #244f88;
    background: #eaf1fb;
    color: #172e4c;
}

.customer-support-message.operator .customer-support-message-label {
    color: #244f88;
}

.customer-support-message.system {
    max-width: 92%;
    margin-right: auto;
    margin-left: auto;
    padding: 8px 11px;
    border-style: solid;
    border-color: #d8dee8;
    border-radius: 10px;
    background: #f1f4f8;
    color: #53647b;
    font-size: 13px;
    text-align: center;
}

.customer-support-message.system .customer-support-message-label {
    color: #6b7788;
}

.customer-support-human-card {
    position: absolute;
    top: 8px;
    right: 16px;
    bottom: auto;
    left: 16px;
    z-index: 2;
    max-height: calc(100% - 16px);
    margin: 0;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #c9d9ee;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(17, 45, 82, .16);
}

.customer-support-human-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.customer-support-human-dismiss {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid #c4d3e7;
    border-radius: 10px;
    background: #f5f8fc;
    color: #345170;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.customer-support-human-card p {
    margin: 4px 0 0;
    color: #66768c;
    font-size: 13px;
}

.customer-support-identity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.customer-support-identity-grid label {
    display: grid;
    gap: 5px;
    color: #41536b;
    font-size: 12px;
    font-weight: 800;
}

.customer-support-identity-wide {
    grid-column: 1 / -1;
}

.customer-support-identity-grid input,
.customer-support-compose textarea,
.support-thread-reply textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bdcce0;
    border-radius: 11px;
    background: #fff;
    color: #15253c;
    font: inherit;
}

.customer-support-identity-grid input {
    min-height: 44px;
    padding: 0 11px;
}

.customer-support-human-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border: 0;
    border-radius: 11px;
    background: #183c6c;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.customer-support-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
    padding: 0 16px 7px;
}

.customer-support-status {
    flex: 1 1 auto;
    min-height: 19px;
    color: #68778d;
    font-size: 12px;
}

.customer-support-status.error {
    color: #c63232;
}

.customer-support-human-toggle,
.customer-support-resume-ai {
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid #b9cbe3;
    border-radius: 9px;
    background: #fff;
    color: #2c527f;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.customer-support-resume-ai {
    border-color: #9bb4d5;
    background: #eef4fc;
    color: #244f88;
}

.customer-support-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    padding: 12px 16px 8px;
    border-top: 1px solid #dce5f0;
    background: #fff;
}

.customer-support-compose textarea {
    min-height: 44px;
    max-height: 96px;
    padding: 9px 11px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.45;
    resize: none;
}

.customer-support-compose button {
    min-width: 72px;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: #2f6fed;
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.customer-support-compose button:disabled,
.customer-support-human-submit:disabled {
    opacity: .55;
    cursor: wait;
}

.customer-support-security {
    margin: 0;
    padding: 0 16px 12px;
    background: #fff;
    color: #78869a;
    font-size: 11px;
}

html.customer-support-modal-open,
body.customer-support-modal-open {
    overflow: hidden;
}

.public-login-unified-theme .customer-support-panel {
    border-color: #c9d7e9;
    background: #f5f8fd;
}

.public-login-unified-theme .customer-support-head {
    background: linear-gradient(145deg, #0b1f3a 0%, #102b51 58%, #173d73 100%);
}

.public-login-unified-theme .customer-support-ticket {
    background: #e8f0ff;
    color: #1f53cf;
}

.public-login-unified-theme .customer-support-message.customer {
    border-color: #bfd1f2;
    background: #edf3ff;
}

.public-login-unified-theme .customer-support-message.operator {
    border-color: #a9c2f2;
    background: #e8f0ff;
}

.public-login-unified-theme .customer-support-human-submit {
    background: #173d73;
}

.public-login-unified-theme .customer-support-compose button {
    background: #2f6fed;
}

.support-inbox-shell {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    min-height: 680px;
    overflow: hidden;
    border: 1px solid #dbe5f1;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(30, 58, 97, .08);
}

.support-inbox-list {
    border-right: 1px solid #dbe5f1;
    background: #f6f9fd;
}

.support-inbox-list-head,
.support-thread-head {
    padding: 20px;
    border-bottom: 1px solid #dbe5f1;
}

.support-inbox-list-head div,
.support-thread-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.support-inbox-list-head p,
.support-thread-head p {
    margin: 6px 0 0;
    color: #6b7a90;
    font-size: 13px;
}

.support-ticket-list {
    max-height: 720px;
    overflow-y: auto;
}

.support-ticket-row {
    display: grid;
    gap: 5px;
    padding: 16px 18px;
    border-bottom: 1px solid #e3eaf3;
    color: #21334d;
    text-decoration: none;
}

.support-ticket-row.active {
    background: #eaf2ff;
    box-shadow: inset 4px 0 #2f6fed;
}

.support-ticket-row > span:not(.support-ticket-state),
.support-ticket-row p {
    overflow: hidden;
    color: #697a91;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-ticket-row p {
    margin: 0;
}

.support-ticket-state {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf1f6;
    color: #566579;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.support-ticket-state.waiting_human {
    background: #fff0df;
    color: #a25800;
}

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

.support-thread-head h2 {
    margin: 3px 0 0;
    font-size: 20px;
}

.support-thread-messages {
    min-height: 420px;
    max-height: 580px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px;
    background: #f8fafd;
}

.support-thread-message {
    max-width: 76%;
    margin-bottom: 14px;
    padding: 13px 15px;
    border: 1px solid #dce5f0;
    border-radius: 15px;
    background: #fff;
}

.support-thread-message.customer {
    margin-left: auto;
    background: #eaf6fb;
}

.support-thread-message.operator {
    border-color: #a9c6f7;
    background: #edf4ff;
}

.support-thread-message p {
    margin: 5px 0;
    line-height: 1.55;
    white-space: pre-wrap;
}

.support-thread-message time {
    color: #8290a2;
    font-size: 11px;
}

.support-thread-reply {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 18px 20px;
    border-top: 1px solid #dbe5f1;
}

.support-thread-reply label {
    grid-column: 1 / -1;
    font-size: 13px;
    font-weight: 800;
}

.support-thread-reply textarea {
    min-height: 44px;
    padding: 10px 12px;
    resize: vertical;
}

.support-inbox-back {
    display: none;
}

.support-thread-tools {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid #dbe5f1;
}

.support-thread-tools button {
    min-height: 44px;
    margin-left: auto;
    padding: 0 12px;
    border: 1px solid #cbd9ec;
    border-radius: 10px;
    background: #fff;
    color: #244f88;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

/* The same help dialog opens from the toolbar, clear of the reply controls. */
body:has(.support-inbox-shell.has-selection) .help-manual-launcher {
    display: none;
}

.support-inbox-empty {
    padding: 24px;
    color: #718096;
    text-align: center;
}

.support-inbox-empty-main {
    margin: auto;
}

@media (max-width: 760px) {
    .mobile-nav-footer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .customer-support-launcher {
        right: 14px;
        bottom: calc(78px + env(safe-area-inset-bottom, 0px));
        min-height: 44px;
        padding: 0 14px;
    }

    .customer-support-widget[data-authenticated="true"] .customer-support-launcher {
        right: calc(14px + max(80px, 4.75rem) + 8px);
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        width: max(80px, 4.75rem);
        min-width: max(80px, 4.75rem);
        min-height: 44px;
        padding: 0 10px;
    }
    .customer-support-widget[data-authenticated="true"] .customer-support-launcher span {
        display: none;
    }

    .public-login-page .customer-support-launcher {
        top: calc(24px + env(safe-area-inset-top, 0px));
        right: 24px;
        bottom: auto;
        width: 44px;
        min-width: 44px;
        justify-content: center;
        padding: 0;
    }

    .public-login-page .customer-support-launcher strong {
        display: none;
    }

    .customer-support-dialog {
        width: 100%;
        height: calc(100dvh - 16px);
        max-height: none;
        margin: auto 0 0;
        border-radius: 22px 22px 0 0;
    }

    .customer-support-panel {
        height: 100%;
        border-radius: 22px 22px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .customer-support-head {
        padding: 16px;
    }

    .customer-support-head h2 {
        font-size: 18px;
    }

    .customer-support-identity-grid {
        grid-template-columns: 1fr;
    }

    .customer-support-identity-wide {
        grid-column: auto;
    }

    .customer-support-compose textarea {
        font-size: 16px;
    }

    .support-inbox-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .support-inbox-list {
        border-right: 0;
        border-bottom: 1px solid #dbe5f1;
    }

    .support-ticket-list,
    .support-thread-messages {
        max-height: 44dvh;
    }

    .support-thread-reply {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 12px;
        gap: 8px;
    }

    .support-inbox-shell.has-selection {
        height: calc(100dvh - 156px);
        min-height: 340px;
    }

    .support-inbox-shell.has-selection .support-inbox-list {
        display: none;
    }

    .support-inbox-shell.has-selection .support-inbox-thread {
        min-height: 0;
        display: grid;
        grid-template-rows: 48px auto minmax(0, 1fr) auto;
    }

    .support-inbox-back {
        display: flex;
        align-items: center;
        padding: 0 14px;
        color: #244f88;
        font-weight: 700;
        text-decoration: none;
        min-height: 44px;
    }

    .support-thread-head {
        padding: 12px 14px;
    }

    .support-thread-head h2 {
        font-size: 17px;
    }

    .support-inbox-shell.has-selection .support-thread-messages {
        min-height: 0;
        max-height: none;
        padding: 14px;
        overscroll-behavior: contain;
    }

    .support-thread-message {
        max-width: 90%;
        overflow-wrap: anywhere;
    }

    .support-thread-reply textarea {
        font-size: 16px;
    }

    .support-thread-reply button {
        min-height: 44px;
    }
}
