.support-nav-badge {
    position: absolute;
    top: -6px;
    left: 100%;
    transform: translateX(-65%);
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

.support-tab-badge {
    display: inline-block;
    margin-left: 5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
}
.js-support-toggle .mobile-menu-item-icon {
    position: relative;
}

.support-mobile-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
.support-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10550;
    width: 400px;
    max-width: calc(100vw - 32px);
}
.support-widget.is-expanded {
    width: 900px;
}

.support-panel {
    display: flex;
    flex-direction: column;
    height: min(640px, 82vh);
    max-height: calc(100vh - 90px);
    background: var(--sbd-bg-surface, #111118);
    border: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.support-widget.is-expanded .support-panel {
    height: min(680px, 78vh);
    max-height: calc(100vh - 120px);
}

.support-widget.is-open .support-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.support-bubble {
    display: none;
    position: relative;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.support-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.support-bubble-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--sbd-bg-deep, #08080f);
    color: var(--sbd-accent, #E1BDB1);
    border: 1.5px solid var(--sbd-accent, #E1BDB1);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.support-widget.is-minimized {
    width: auto;
}

.support-widget.is-minimized .support-panel {
    display: none;
}

.support-widget.is-minimized .support-bubble {
    display: inline-flex;
}

.support-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
}

.support-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.support-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--sbd-bg-deep);
    font-size: 0.85rem;
}
.support-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    padding: 1px 6px;
    color: var(--sbd-bg-deep);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.support-icon-btn:hover,
.support-icon-btn:focus,
.support-icon-btn:focus-visible {
    color: var(--sbd-bg-deep);
    text-decoration: none;
    opacity: 0.7;
}
.support-tabs {
    display: flex;
    border-bottom: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    background: var(--sbd-bg-deep, #08080f);
}

.support-tab {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--sbd-text-secondary, rgba(255, 255, 255, 0.65));
    font-size: 0.9rem;
    cursor: pointer;
}

.support-tab.active {
    color: var(--sbd-text, #fff);
    border-bottom-color: var(--sbd-accent, #E1BDB1);
}
.support-tab-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.support-banner {
    padding: 10px 14px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.support-banner-human {
    background: var(--sbd-accent-soft, rgba(225, 189, 177, 0.12));
    color: var(--sbd-text, #fff);
    border-bottom: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
}

.support-banner-closed {
    background: rgba(120, 120, 120, 0.15);
    color: var(--sbd-text-secondary, rgba(255, 255, 255, 0.65));
    border-bottom: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
}
.support-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: var(--sbd-bg-deep, #08080f);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-empty {
    margin: auto;
    text-align: center;
    color: var(--sbd-text-secondary, rgba(255, 255, 255, 0.65));
    font-size: 0.9rem;
}
.support-empty-cost {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    margin: 12px auto 0;
    max-width: 30ch;
    color: var(--sbd-text-muted, rgba(255, 255, 255, 0.5));
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: left;
}

.support-empty-badge {
    margin: 0 auto 12px;
    border-color: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-accent, #E1BDB1);
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
}

.support-msg {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.support-msg-body p:last-child {
    margin-bottom: 0;
}

.support-msg-user {
    align-self: flex-end;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    border-bottom-right-radius: 4px;
}

.support-msg-bot,
.support-msg-human {
    align-self: flex-start;
    background: var(--sbd-bg-surface, #111118);
    color: var(--sbd-text, #fff);
    border: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    border-bottom-left-radius: 4px;
}

.support-msg-human {
    border-color: var(--sbd-accent, #E1BDB1);
}

.support-msg-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--sbd-accent, #E1BDB1);
    margin-bottom: 4px;
}

.support-msg-error {
    align-self: center;
    background: rgba(220, 53, 69, 0.12);
    color: #ff8189;
    font-size: 0.82rem;
}
.support-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.support-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sbd-text-muted, rgba(255, 255, 255, 0.45));
    animation: support-blink 1.2s infinite ease-in-out;
}

.support-typing span:nth-child(2) { animation-delay: 0.2s; }
.support-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes support-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}
.support-discussions-actions {
    padding: 12px 12px;
}

.support-newdisc-btn {
    width: 100%;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.support-newdisc-btn:hover {
    background: var(--sbd-accent-hover, #edd9d1);
}
.support-input-bar {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    background: var(--sbd-bg-surface, #111118);
}
.support-input-warning {
    position: absolute;
    bottom: calc(100% - 2px);
    left: 12px;
    right: 12px;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep, #08080f);
    font-size: 0.78rem;
    line-height: 1.3;
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.support-input-bar textarea {
    flex: 1;
    resize: none;
    max-height: 120px;
    overflow-y: hidden;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    background: var(--sbd-bg-deep, #08080f);
    color: var(--sbd-text, #fff);
    font-size: 0.9rem;
    line-height: 1.4;
    outline: none;
}

.support-input-bar textarea:focus {
    border-color: var(--sbd-accent, #E1BDB1);
}

.support-send-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: var(--sbd-accent, #E1BDB1);
    color: var(--sbd-bg-deep);
    cursor: pointer;
}
.support-input-bar {
    flex-wrap: wrap;
}
.support-input-bar.is-dragover {
    box-shadow: inset 0 0 0 2px var(--sbd-accent, #E1BDB1);
}

.support-attach-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    background: var(--sbd-bg-deep, #08080f);
    color: var(--sbd-text-secondary, rgba(255, 255, 255, 0.65));
    cursor: pointer;
}

.support-attach-btn:hover {
    color: var(--sbd-accent, #E1BDB1);
    border-color: var(--sbd-accent, #E1BDB1);
}
.support-attach-preview {
    position: relative;
    flex-basis: 100%;
    width: 70px;
    margin-bottom: 8px;
}

.support-attach-preview img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
}

.support-attach-remove {
    position: absolute;
    top: -6px;
    left: 58px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: var(--sbd-bg-deep, #08080f);
    color: var(--sbd-text, #fff);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.support-msg-attachment {
    display: block;
    margin-top: 6px;
}

.support-msg-attachment img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 10px;
    display: block;
}
.support-discussions {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background: var(--sbd-bg-deep, #08080f);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-discussion-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: left;
    padding: 10px 32px 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    background: var(--sbd-bg-surface, #111118);
    color: var(--sbd-text, #fff);
    cursor: pointer;
}

.support-disc-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: 0;
    color: var(--sbd-text-muted, rgba(255, 255, 255, 0.45));
    font-size: 0.78rem;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

.support-disc-delete:hover {
    color: var(--sbd-accent, #E1BDB1);
}
.support-discussion-item.has-unread::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--sbd-accent, #E1BDB1);
}

.support-discussion-item:hover,
.support-discussion-item.active {
    border-color: var(--sbd-accent, #E1BDB1);
}

.support-discussion-title {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-discussion-meta {
    font-size: 0.74rem;
    color: var(--sbd-text-muted, rgba(255, 255, 255, 0.45));
}

.support-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
}
.support-handoff {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: stretch;
    margin: 2px 0;
    padding: 6px 10px;
    border-top: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    border-bottom: 1px solid var(--sbd-border, rgba(255, 255, 255, 0.08));
    color: var(--sbd-accent, #E1BDB1);
    font-size: 0.74rem;
    font-weight: 600;
    text-align: center;
}

.support-pill-human {
    background: var(--sbd-accent-soft, rgba(225, 189, 177, 0.12));
    color: var(--sbd-accent, #E1BDB1);
}

.support-pill-closed {
    background: rgba(120, 120, 120, 0.2);
    color: var(--sbd-text-secondary, rgba(255, 255, 255, 0.65));
}
.support-pill-expert {
    background: rgba(245, 197, 24, 0.16);
    color: #f5c518;
}
.support-expert-banner {
    padding: 9px 14px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #f5c518;
    background: rgba(245, 197, 24, 0.1);
    border-bottom: 1px solid rgba(245, 197, 24, 0.25);
}
.support-expert-badge {
    border-color: #f5c518;
    color: #f5c518;
}
.support-msg-expert {
    align-self: flex-start;
    background: var(--sbd-bg-surface, #111118);
    color: var(--sbd-text, #fff);
    border: 1px solid rgba(245, 197, 24, 0.4);
    border-left: 3px solid #f5c518;
    border-bottom-left-radius: 4px;
}

.support-msg-expert .support-msg-label {
    color: #f5c518;
}

.support-muted {
    color: var(--sbd-text-muted, rgba(255, 255, 255, 0.45));
    font-size: 0.85rem;
    text-align: center;
    padding: 16px;
}
@media (max-width: 1199.98px) {
    body:has(#mobile-navbar) .support-widget.is-minimized {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 575.98px) {
    .support-widget,
    .support-widget.is-expanded {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        max-width: none;
    }
    .support-widget.is-minimized {
        left: auto;
    }

    .support-panel,
    .support-widget.is-expanded .support-panel {
        height: 78vh;
        max-height: calc(100vh - 16px);
    }
    .js-support-expand {
        display: none;
    }
}
