.ch-support-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 80;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ch-hero, #ff2d55), #ff5a7a);
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(255, 45, 85, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ch-support-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(255, 45, 85, 0.45);
}

.ch-support-fab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.ch-support-fab[hidden] {
    display: none !important;
}

.ch-support-panel {
    position: fixed;
    right: 20px;
    bottom: 88px;
    z-index: 81;
    width: min(420px, calc(100vw - 24px));
    max-height: min(78vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--ch-panel, #0f1528);
    border: 1px solid var(--ch-edge, #1e2a45);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    color: var(--ch-text, #eef2ff);
}

.ch-support-panel[hidden] {
    display: none !important;
}

.ch-support-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ch-edge, #1e2a45);
    background: rgba(255, 255, 255, 0.02);
}

.ch-support-panel__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.ch-support-panel__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ch-text, #eef2ff);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.ch-support-panel__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 16px 16px;
    overflow: auto;
    min-height: 0;
}

.ch-support-guest {
    margin: 0;
    color: var(--ch-muted, #8b9dc3);
    font-size: 14px;
    line-height: 1.45;
}

.ch-support-guest a {
    color: var(--ch-hero, #ff2d55);
}

.ch-support-meta {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
}

.ch-support-meta strong {
    font-weight: 700;
}

.ch-support-meta-id {
    display: block;
    margin-top: 2px;
    color: var(--ch-muted, #8b9dc3);
    font-size: 12px;
}

.ch-support-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-support-field label {
    font-size: 13px;
    color: var(--ch-muted, #8b9dc3);
}

.ch-support-field input[type='text'],
.ch-support-field textarea {
    width: 100%;
    border: 1px solid var(--ch-edge, #1e2a45);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--ch-text, #eef2ff);
    font: inherit;
    padding: 11px 12px;
    resize: vertical;
    box-sizing: border-box;
}

.ch-support-field input[type='text']:focus,
.ch-support-field textarea:focus {
    outline: none;
    border-color: rgba(255, 45, 85, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.12);
}

.ch-support-field textarea {
    min-height: 96px;
}

.ch-support-file {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px dashed rgba(255, 45, 85, 0.35);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    color: var(--ch-muted, #8b9dc3);
    font-size: 13px;
}

.ch-support-file input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ch-support-file__icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.ch-support-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ch-support-file-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(61, 139, 255, 0.16);
    color: #cfe2ff;
    font-size: 12px;
}

.ch-support-file-list button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.ch-support-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ch-support-send {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 11px 18px;
    background: linear-gradient(135deg, var(--ch-hero, #ff2d55), #ff5a7a);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ch-support-send:disabled {
    opacity: 0.55;
    cursor: default;
}

.ch-support-status {
    margin: 0;
    min-height: 1.2em;
    font-size: 13px;
    color: var(--ch-muted, #8b9dc3);
}

.ch-support-status.is-error {
    color: #ff8f8f;
}

.ch-support-status.is-ok {
    color: #7ddea8;
}

.ch-support-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.ch-support-msg {
    border: 1px solid var(--ch-edge, #1e2a45);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
}

.ch-support-msg--admin {
    border-left: 3px solid var(--ch-power, #3d8bff);
}

.ch-support-msg__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ch-support-msg__avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(61, 139, 255, 0.2);
    color: #cfe2ff;
    font-size: 16px;
}

.ch-support-msg__avatar--logo {
    background: #0a0e18;
    padding: 0;
    overflow: hidden;
}

.ch-support-msg__avatar--logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ch-support-msg--user .ch-support-msg__avatar {
    background: rgba(255, 45, 85, 0.2);
    color: #ffd0da;
}

.ch-support-msg__who {
    min-width: 0;
}

.ch-support-msg__name {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.ch-support-msg__sub {
    display: block;
    font-size: 12px;
    color: var(--ch-muted, #8b9dc3);
}

.ch-support-msg__body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.45;
}

.ch-support-msg__files {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ch-support-msg__files a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(61, 139, 255, 0.16);
    color: #cfe2ff;
    text-decoration: none;
    font-size: 12px;
}

.ch-support-msg__foot {
    margin-top: 10px;
    font-size: 12px;
    color: var(--ch-muted, #8b9dc3);
}

@media (max-width: 560px) {
    .ch-support-fab {
        right: 14px;
        bottom: 14px;
    }

    .ch-support-panel {
        right: 12px;
        left: 12px;
        bottom: 78px;
        width: auto;
        max-height: min(82vh, 720px);
    }
}
