.cs-widget-toggle {
    position: fixed;
    right: 16px;
    bottom: 86px;
    z-index: 999;
    border: 0;
    border-radius: 999px;
    background: #de2f2f;
    color: #fff;
    width: 54px;
    height: 54px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.cs-widget-toggle.has-unread {
    box-shadow: 0 8px 24px rgba(222, 47, 47, 0.36);
}

.cs-widget-unread {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 999px;
    padding: 0 5px;
    background: #ff2f2f;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 47, 47, .34);
}

.cs-widget-panel {
    position: fixed;
    right: 12px;
    bottom: 146px;
    z-index: 1000;
    width: min(360px, calc(100vw - 24px));
    max-height: 65vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cs-widget-panel[hidden] {
    display: none !important;
}

.cs-widget-head {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.cs-widget-head button {
    border: 0;
    background: transparent;
    color: #666;
}

.cs-widget-head strong {
    margin-right: auto;
}

.cs-widget-sound {
    min-width: 56px;
    height: 28px;
    border-radius: 999px !important;
    background: #f5f5f5 !important;
    color: #333 !important;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.cs-widget-sound[data-muted="1"] {
    color: #999 !important;
}

.cs-widget-volume {
    width: 74px;
    accent-color: #de2f2f;
    cursor: pointer;
}

.cs-widget-status {
    padding: 8px 12px;
    font-size: 12px;
    color: #666;
    background: #fafafa;
}

.cs-widget-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 8px 12px;
    background: #f8f8f8;
    min-height: 160px;
}

.cs-bubble {
    width: fit-content;
    max-width: 80%;
    margin: 0 auto 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.cs-bubble.user {
    margin-left: auto;
    margin-right: 0;
    background: #de2f2f;
    color: #fff;
}

.cs-bubble.agent {
    margin-right: auto;
    background: #fff;
    border: 1px solid #eee;
}

.cs-bubble.cs-bubble-image {
    padding: 4px;
    background: transparent;
    border: 0;
}

.cs-bubble.cs-bubble-image .support-message-image {
    max-width: min(240px, 100%);
    max-height: 240px;
}

.cs-widget-form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

.cs-widget-input {
    resize: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    min-width: 0;
}

.cs-widget-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-widget-form button {
    border: 0;
    border-radius: 8px;
    background: #111;
    color: #fff;
    min-width: 46px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
}

.cs-widget-form button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cs-widget-image-btn {
    background: #666 !important;
}
