
.tm-chat-center,
.tm-chat-center * {
    box-sizing: border-box;
}

.tm-chat-center {
    scroll-margin-top: 24px;
}

.tm-chat-center-layout {
    display: grid;
    grid-template-columns: 265px minmax(0, 1fr);
    gap: 13px;
    margin-top: 16px;
    min-height: 620px;
}

.tm-chat-conversation-list {
    overflow: hidden;
    align-self: start;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
}

.tm-chat-conversation-list a {
    display: flex;
    gap: 10px;
    padding: 13px;
    border-bottom: 1px solid #eef2f7;
    color: #334155;
    text-decoration: none;
    justify-content: space-between;
    align-items: center;
}

.tm-chat-conversation-list a:last-child {
    border-bottom: 0;
}

.tm-chat-conversation-list a:hover,
.tm-chat-conversation-list a.is-active {
    border-left: 4px solid #FF7A00;
    background: #fef2f2;
    color: #991b1b;
}

.tm-chat-conversation-list strong,
.tm-chat-conversation-list small {
    display: block;
}

.tm-chat-conversation-list small {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

.tm-chat-conversation-list a > span {
    display: flex;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: #FF7A00;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}

.tm-chat-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #fff;
}

.tm-chat-panel-head {
    display: flex;
    gap: 15px;
    padding: 17px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #081521, #1e293b);
    color: #fff;
    justify-content: space-between;
    align-items: center;
}

.tm-chat-panel-head p,
.tm-chat-panel-head h3,
.tm-chat-panel-head span {
    margin: 0;
}

.tm-chat-panel-head p {
    color: #FF8F26;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.tm-chat-panel-head h3 {
    margin-top: 4px;
    color: #fff;
    font-size: 20px;
}

.tm-chat-panel-head > div:first-child > span {
    display: block;
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 11px;
}

.tm-chat-panel-status {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tm-chat-panel-status > span {
    display: inline-flex;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    align-items: center;
    font-size: 9px;
    font-weight: 800;
}

.tm-chat-availability i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tm-chat-availability-available {
    color: #86efac;
}

.tm-chat-availability-busy {
    color: #fde68a;
}

.tm-chat-availability-offline {
    color: #cbd5e1;
}

.tm-chat-success,
.tm-chat-warning {
    margin: 12px;
    padding: 10px 12px;
    border-left: 4px solid #16a34a;
    border-radius: 8px;
    background: #ecfdf5;
    color: #166534;
    font-weight: 800;
}

.tm-chat-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.tm-chat-message-list {
    display: flex;
    min-height: 330px;
    max-height: 520px;
    overflow-y: auto;
    padding: 18px;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 122, 0, .04), transparent 22%),
        #f8fafc;
    flex-direction: column;
    gap: 12px;
}

.tm-chat-message {
    display: flex;
    gap: 8px;
    max-width: 78%;
    align-self: flex-start;
}

.tm-chat-message.is-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.tm-chat-message.tm-chat-role-system {
    max-width: 100%;
    align-self: center;
}

.tm-chat-message-avatar {
    display: flex;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #081521;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.tm-chat-role-system .tm-chat-message-avatar {
    display: none;
}

.tm-chat-message-bubble {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 13px 13px 13px 4px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

.tm-chat-message.is-own .tm-chat-message-bubble {
    border-color: #bfdbfe;
    border-radius: 13px 13px 4px 13px;
    background: rgba(255,122,0,0.12);
}

.tm-chat-role-system .tm-chat-message-bubble {
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: none;
    color: #475569;
    text-align: center;
    font-size: 10px;
}

.tm-chat-message-bubble header {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
    justify-content: space-between;
    align-items: center;
}

.tm-chat-message-bubble header strong {
    color: #081521;
    font-size: 11px;
}

.tm-chat-message-bubble header time {
    color: #94a3b8;
    font-size: 8px;
    white-space: nowrap;
}

.tm-chat-message-bubble p {
    margin: 0;
    color: #334155;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.tm-chat-image {
    display: block;
    margin-top: 8px;
}

.tm-chat-image img {
    display: block;
    max-width: 280px;
    height: auto;
    border-radius: 10px;
}

.tm-chat-location {
    display: inline-flex;
    min-height: 36px;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #FF7A00;
    color: #fff;
    align-items: center;
    text-decoration: none;
    font-size: 10px;
    font-weight: 900;
}

.tm-chat-report {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #e2e8f0;
}

.tm-chat-report summary {
    color: #64748b;
    cursor: pointer;
    font-size: 9px;
}

.tm-chat-report form {
    display: grid;
    gap: 6px;
    margin-top: 7px;
}

.tm-chat-report select,
.tm-chat-report textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
}

.tm-chat-report button,
.tm-chat-admin-message-actions a {
    display: inline-flex;
    min-height: 31px;
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    background: #FF7A00;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 9px;
    font-weight: 900;
}

.tm-chat-hidden-copy {
    color: #991b1b !important;
    font-style: italic;
}

.tm-chat-quick-replies {
    display: flex;
    gap: 6px;
    padding: 10px 13px;
    overflow-x: auto;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    align-items: center;
}

.tm-chat-quick-replies > span {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.tm-chat-quick-replies button {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: 1px solid #dbe3ec;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
}

.tm-chat-compose {
    padding: 13px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.tm-chat-compose > textarea {
    width: 100%;
    min-height: 94px;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    resize: vertical;
}

.tm-chat-compose-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 9px;
}

.tm-chat-compose-tools label {
    display: block;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
}

.tm-chat-compose-tools label > span {
    display: block;
    margin-bottom: 6px;
    color: #475569;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.tm-chat-compose-tools input {
    width: 100%;
}

.tm-chat-compose footer {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    justify-content: space-between;
    align-items: center;
}

.tm-chat-compose footer small {
    color: #64748b;
}

.tm-chat-compose footer button,
.tm-chat-status-form button {
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: #FF7A00;
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.tm-chat-read-only {
    padding: 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: center;
}

.tm-chat-read-only strong {
    display: block;
    color: #081521;
}

.tm-chat-read-only p {
    margin: 5px 0 0;
    color: #64748b;
}

.tm-chat-status-form {
    display: flex;
    gap: 9px;
    padding: 12px 13px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    justify-content: flex-end;
    align-items: end;
}

.tm-chat-status-form label {
    color: #475569;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.tm-chat-status-form select {
    display: block;
    min-width: 180px;
    margin-top: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.tm-chat-empty {
    padding: 38px 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
}

.tm-chat-empty strong {
    display: block;
    color: #081521;
}

.tm-chat-empty p {
    margin: 6px 0 0;
    color: #64748b;
}

@media (max-width: 850px) {
    .tm-chat-center-layout {
        grid-template-columns: 1fr;
    }

    .tm-chat-conversation-list {
        display: flex;
        overflow-x: auto;
    }

    .tm-chat-conversation-list a {
        flex: 0 0 230px;
        border-right: 1px solid #eef2f7;
        border-bottom: 0;
    }
}

@media (max-width: 620px) {
    .tm-chat-panel-head,
    .tm-chat-compose footer,
    .tm-chat-status-form {
        align-items: flex-start;
        flex-direction: column;
    }

    .tm-chat-panel-status {
        justify-content: flex-start;
    }

    .tm-chat-message {
        max-width: 94%;
    }

    .tm-chat-compose-tools {
        grid-template-columns: 1fr;
    }

    .tm-chat-compose footer button,
    .tm-chat-status-form button,
    .tm-chat-status-form label,
    .tm-chat-status-form select {
        width: 100%;
    }
}
