.tx-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tx-chat-icon {
    width: 55px;
    height: 55px;
    background: #ffdd22;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.tx-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tx-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.tx-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffdd22;
    font-weight: 600;
}

.tx-chat-messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f8f8f8;
}

.tx-chat-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    word-break: break-word;
    clear: both;
}

.tx-chat-message-mine {
    background: #ffdd22;
    color: #000;
    border-bottom-right-radius: 4px;
    float: right;
}

.tx-chat-message-their {
    background: white;
    border: 1px solid #eee;
    border-bottom-left-radius: 4px;
    float: left;
}

.tx-chat-message-time {
    font-size: 0.6rem;
    color: #888;
    margin-top: 4px;
    text-align: right;
}

.tx-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fff;
}

.tx-chat-input-area textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

.tx-chat-input-area button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0066cc;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
}

.tx-chat-dialog {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.tx-chat-dialog:hover {
    background: #f8f8f8;
}

.tx-chat-dialog-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.tx-chat-unread {
    background: #dc3545;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.7rem;
}

.tx-chat-message-menu {
    position: absolute;
    top: -20px;
    right: 0;
    display: none;
    gap: 4px;
    background: white;
    border-radius: 8px;
    padding: 2px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tx-chat-message-mine:hover .tx-chat-message-menu {
    display: flex;
}

.tx-chat-message-menu button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.tx-new-dialog-btn {
    width: 100%;
    padding: 8px;
    background: #28a745;
    color: white;
    border: none;
    cursor: pointer;
}

/* Исправления для правильного отображения */
#tx-chat-messages {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100% - 50px) !important;
}

#tx-chat-messages-list {
    flex: 1 !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

#tx-chat-input-area {
    display: flex !important;
    padding: 10px !important;
    border-top: 1px solid #ddd !important;
    background: white !important;
}

.tx-message {
    max-width: 80% !important;
    margin-bottom: 8px !important;
}

.tx-message-mine {
    align-self: flex-end !important;
    background: #dcf8c5 !important;
}

.tx-message-their {
    align-self: flex-start !important;
    background: white !important;
}
