/* ============================================================
   Клиентский чат Tdpr CHAT — v1.9.1
   Изменения:
     • v1.9.1 — узкие фото обхватываются превью по размеру
       (align-items: flex-start у контейнера), без пустой
       полосы справа.
   ============================================================ */

.tdpr-chat-wrapper {
    margin: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.tdpr-chat-wrapper *,
.tdpr-chat-wrapper *::before,
.tdpr-chat-wrapper *::after { box-sizing: border-box; }

.tdpr-chat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    min-width: 0;
    max-width: 100%;
}
.tdpr-chat-title {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-weight: 700;
    font-size: clamp(17px, 0.6vw + 15px, 19px);
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    overflow-wrap: anywhere;
}

.tdpr-chat-messages {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
    max-height: 520px;
    border-radius: 8px;
    margin-bottom: 12px;
    min-width: 0;
}
.tdpr-chat-empty {
    text-align: center;
    color: #666;
    padding: 30px 15px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin: auto;
    max-width: 90%;
    font-size: 15px;
}

.tdpr-chat-message {
    max-width: min(82%, 720px);
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    font-size: clamp(15px, 0.35vw + 14px, 16.5px);
    line-height: 1.55;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tdpr-message-customer {
    background: #dcf8c6;
    color: #1a1a1a;
    align-self: flex-end;
    border: 1px solid #b9f5a9;
    border-bottom-right-radius: 3px;
}
.tdpr-message-admin {
    background: #fff;
    color: #333;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 3px;
}
.tdpr-message-content {
    margin-bottom: 5px;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    font-size: inherit;
}
.tdpr-message-content .tdpr-chat-link:not(.tdpr-chat-link--badge):not(.tdpr-chat-link--og) {
    color: #2d9d78;
    text-decoration: underline;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tdpr-message-content .tdpr-chat-link:not(.tdpr-chat-link--badge):not(.tdpr-chat-link--og):hover { color: #247a5c; }

.tdpr-message-meta {
    font-size: 12.5px;
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}
.tdpr-message-customer .tdpr-message-meta { color: #666; justify-content: flex-end; }
.tdpr-message-admin .tdpr-message-meta    { color: #999; justify-content: flex-start; }

/* ============================================================
   OG-КАРТОЧКА
   ============================================================ */
.tdpr-chat-link--og {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #2d9d78;
    border-radius: 10px;
    text-decoration: none !important;
    color: #1d2327 !important;
    margin: 10px 0;
    max-width: 100%;
    overflow: hidden;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-width: 0;
}
.tdpr-chat-link--og:hover {
    background: #f8f9fa;
    border-color: #2d9d78;
    border-left-color: #247a5c;
    box-shadow: 0 4px 12px rgba(45, 157, 120, 0.15);
    text-decoration: none !important;
    color: #1d2327 !important;
    transform: translateY(-1px);
}
.tdpr-chat-og__image {
    flex-shrink: 0;
    width: 130px;
    min-height: 100px;
    background: #f0f6fc;
    overflow: hidden;
    position: relative;
}
.tdpr-chat-og__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.tdpr-chat-og__body {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
}
.tdpr-chat-og__title {
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.tdpr-chat-og__description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.tdpr-chat-og__domain {
    font-size: 11.5px;
    color: #2d9d78;
    font-weight: 500;
    margin-top: 2px;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

/* Fallback */
.tdpr-chat-link--og-fallback {
    align-items: center;
    border-left-color: #c5d9ed;
    padding: 12px 16px;
    gap: 14px;
}
.tdpr-chat-link--og-fallback:hover { border-left-color: #2d9d78; }

.tdpr-chat-og__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f6fc 0%, #e2edf7 100%);
    border-radius: 10px;
    overflow: hidden;
}
.tdpr-chat-og__icon img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
    position: static;
}
.tdpr-chat-og__placeholder {
    font-size: 24px;
    line-height: 1;
    color: #2d9d78;
    user-select: none;
}
.tdpr-chat-link--og-fallback .tdpr-chat-og__body { padding: 0; justify-content: center; gap: 3px; }
.tdpr-chat-link--og-fallback .tdpr-chat-og__title { font-size: 15px; -webkit-line-clamp: 1; }
.tdpr-chat-link--og-fallback .tdpr-chat-og__domain { font-size: 12px; margin-top: 0; }

@media (max-width: 600px) {
    .tdpr-chat-link--og-fallback { padding: 10px 12px; gap: 10px; }
    .tdpr-chat-og__icon { width: 40px; height: 40px; }
    .tdpr-chat-og__icon img { width: 24px; height: 24px; }
    .tdpr-chat-og__placeholder { font-size: 20px; }
    .tdpr-chat-link--og-fallback .tdpr-chat-og__title { font-size: 14px; }

    .tdpr-chat-link--og:not(.tdpr-chat-link--og-fallback) { flex-direction: column; }
    .tdpr-chat-link--og:not(.tdpr-chat-link--og-fallback) .tdpr-chat-og__image {
        width: 100%;
        min-height: 160px;
        aspect-ratio: 16/9;
    }
}

/* ============================================================
   БЕЙДЖ
   ============================================================ */
.tdpr-chat-link--badge,
.tdpr-chat-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f0f6fc 0%, #e2edf7 100%);
    border: 1px solid #c5d9ed;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #0a4b78 !important;
    text-decoration: none !important;
    line-height: 1.4;
    margin: 10px 0;
    width: fit-content;
    max-width: 100%;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    box-shadow: 0 1px 3px rgba(10, 75, 120, 0.08);
}
.tdpr-chat-link--badge:hover {
    background: linear-gradient(135deg, #e2edf7 0%, #d0e2f3 100%);
    border-color: #2d9d78;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(10, 75, 120, 0.15);
    color: #0a4b78 !important;
    text-decoration: none !important;
}
.tdpr-chat-badge--icon-right { flex-direction: row-reverse; }
.tdpr-chat-badge--icon-left  { flex-direction: row; }

.tdpr-chat-badge__icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}
.tdpr-chat-badge__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(360px, 60vw);
    min-width: 0;
    font-size: inherit;
}

/* ============================================================
   ЦИТИРОВАНИЕ
   ============================================================ */
.tdpr-chat-message-quote-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    border: 1px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.tdpr-chat-message:hover .tdpr-chat-message-quote-btn { opacity: 1; }
.tdpr-chat-message-quote-btn:hover {
    background: #2d9d78;
    color: #fff;
    border-color: #2d9d78;
}
.tdpr-chat-message-quote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid #2d9d78;
    background: rgba(45, 157, 120, 0.08);
    border-radius: 3px;
    font-size: 13.5px;
    line-height: 1.45;
    min-width: 0;
}
.tdpr-chat-message-quote__author {
    font-weight: 700;
    color: #2d9d78;
    margin-bottom: 3px;
    font-size: 12.5px;
}
.tdpr-chat-message-quote__text {
    color: #50575e;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-height: 100px;
    overflow: hidden;
}

/* ============================================================
   ВЛОЖЕНИЯ
   v1.9.1 — align-items: flex-start: узкие фото обхватываются
   контейнером по размеру, без пустой полосы справа.
   ============================================================ */
.tdpr-chat-msg-attachments {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.tdpr-chat-msg-images,
.tdpr-chat-msg-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    align-items: flex-start;
}
.tdpr-chat-msg-images:empty,
.tdpr-chat-msg-files:empty { display: none; }

.tdpr-chat-image-thumb {
    display: block;
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background: #f6f7f7;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}
.tdpr-chat-image-thumb:hover {
    transform: scale(1.02);
    border-color: #2d9d78;
    box-shadow: 0 4px 12px rgba(45, 157, 120, 0.15);
}
.tdpr-chat-image-thumb img {
    display: block;
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.tdpr-chat-image-thumb--more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
    color: #50575e;
    font-weight: 600;
    font-size: 18px;
    cursor: default;
    min-width: 200px;
    min-height: 200px;
    max-width: 200px;
    max-height: 200px;
}

.tdpr-chat-file-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14.5px;
    color: #1d2327;
    text-decoration: none;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    transition: background 0.15s, border-color 0.15s;
    font-weight: 500;
}
.tdpr-chat-file-link:hover { background: #fff; border-color: #2d9d78; }
.tdpr-chat-file-link__icon { font-size: 20px; flex-shrink: 0; line-height: 1; }
.tdpr-chat-file-link__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(300px, 45vw);
    min-width: 0;
    font-size: inherit;
}
.tdpr-chat-file-link__size {
    color: #999;
    font-size: 12.5px;
    flex-shrink: 0;
    margin-left: 4px;
}
.tdpr-chat-msg-more {
    font-size: 12.5px;
    color: #787c82;
    margin-top: 4px;
    font-style: italic;
}

/* ============================================================
   ФОРМА
   ============================================================ */
.tdpr-chat-input-container {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    position: relative;
    min-width: 0;
}
.tdpr-chat-drag-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 157, 120, 0.1);
    border: 2px dashed #2d9d78;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}
.tdpr-chat-drag-overlay.active { opacity: 1; }
.tdpr-chat-drag-overlay__inner {
    background: #fff;
    padding: 16px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    text-align: center;
    max-width: calc(100% - 24px);
}
.tdpr-chat-drag-overlay__icon { font-size: 32px; margin-bottom: 6px; }
.tdpr-chat-drag-overlay__text { font-size: 14px; font-weight: 600; color: #2d9d78; }

.tdpr-chat-quote-preview {
    position: relative;
    margin-bottom: 8px;
    padding: 10px 34px 10px 14px;
    border-left: 3px solid #2d9d78;
    background: rgba(45, 157, 120, 0.08);
    border-radius: 4px;
    font-size: 13.5px;
    line-height: 1.45;
    min-width: 0;
}
.tdpr-chat-quote-preview__author {
    font-weight: 700;
    color: #2d9d78;
    margin-bottom: 3px;
    font-size: 12.5px;
}
.tdpr-chat-quote-preview__text {
    color: #50575e;
    max-height: 80px;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.tdpr-chat-quote-preview__cancel {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    line-height: 22px;
    text-align: center;
}
.tdpr-chat-quote-preview__cancel:hover { background: rgba(0, 0, 0, 0.06); color: #d63638; }

.tdpr-input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 6px;
    min-height: 50px;
    min-width: 0;
}
.tdpr-chat-attach {
    flex-shrink: 0;
    width: 50px;
    min-height: 50px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    font-size: 20px;
    padding: 0;
    cursor: pointer;
    color: #666;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tdpr-chat-attach:hover { background: #eef1f4; color: #2d9d78; }
.tdpr-chat-input {
    flex: 1;
    min-width: 0;
    min-height: 50px;
    max-height: 140px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 13px 16px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    box-sizing: border-box;
    overflow-y: auto;
    transition: border-color 0.2s;
    background: #fff;
}
.tdpr-chat-input:focus {
    outline: none;
    border-color: #2d9d78;
    box-shadow: 0 0 0 3px rgba(45, 157, 120, 0.1);
}
.tdpr-chat-send {
    flex-shrink: 0;
    min-width: 110px;
    min-height: 50px;
    background: #2d9d78;
    color: #fff;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 0 20px;
    transition: background 0.2s;
    white-space: nowrap;
}
.tdpr-chat-send:hover { background: #247a5c; }

.tdpr-chat-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.4;
    min-width: 0;
}
.tdpr-chat-form-hint {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 12px;
    overflow-wrap: anywhere;
}
.tdpr-char-counter {
    flex-shrink: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 12.5px;
}

.tdpr-chat-files-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-width: 0;
}
.tdpr-chat-files-preview:empty { display: none; }
.tdpr-chat-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #eaf6f0;
    border: 1px solid #a7e0c4;
    border-radius: 20px;
    font-size: 13px;
    color: #1d2327;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}
.tdpr-chat-file-chip.uploading { opacity: 0.7; font-style: italic; }
.tdpr-chat-file-chip-remove {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.tdpr-chat-file-chip-remove:hover { color: #d63638; }

.tdpr-chat-readonly-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    text-align: center;
    font-size: 15px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    justify-content: center;
    flex-wrap: wrap;
}
.tdpr-chat-readonly-icon { font-size: 20px; }
.tdpr-chat-readonly-text a { color: #2d9d78; font-weight: 600; text-decoration: underline; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.tdpr-chat-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}
.tdpr-chat-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
}
.tdpr-chat-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    opacity: 0.8;
}
.tdpr-chat-lightbox-close:hover { opacity: 1; }

/* ============================================================
   СИСТЕМНЫЕ СООБЩЕНИЯ
   ============================================================ */
.tdpr-message-system {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    align-self: center;
    max-width: min(520px, 100%);
    width: 100%;
    margin: 12px auto;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--tdpr-system-border, #cfe3f5);
    background: var(--tdpr-system-bg, #f0f6fc);
    color: var(--tdpr-system-text, #0a4b78);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    font-size: 14px;
    line-height: 1.55;
    min-width: 0;
    overflow-wrap: anywhere;
}
.tdpr-message-system__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}
.tdpr-message-system__body { flex: 1; min-width: 0; }
.tdpr-message-system__title {
    font-weight: 700;
    font-size: 14.5px;
    margin-bottom: 4px;
    color: var(--tdpr-system-title, #0a4b78);
    letter-spacing: 0.01em;
    overflow-wrap: anywhere;
}
.tdpr-message-system__text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: inherit;
}
.tdpr-message-system__time {
    font-size: 11.5px;
    color: rgba(0, 0, 0, 0.35);
    margin-top: 6px;
}
.tdpr-message-system--info    { --tdpr-system-bg: #f0f6fc; --tdpr-system-border: #cfe3f5; --tdpr-system-text: #0a4b78; --tdpr-system-title: #0a4b78; }
.tdpr-message-system--success { --tdpr-system-bg: #f0fdf4; --tdpr-system-border: #a7e0b8; --tdpr-system-text: #065f46; --tdpr-system-title: #065f46; }
.tdpr-message-system--warning { --tdpr-system-bg: #fffbeb; --tdpr-system-border: #fcd34d; --tdpr-system-text: #92400e; --tdpr-system-title: #92400e; }
.tdpr-message-system--error   { --tdpr-system-bg: #fef2f2; --tdpr-system-border: #fca5a5; --tdpr-system-text: #991b1b; --tdpr-system-title: #991b1b; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 782px) {
    .tdpr-chat-card { padding: 16px; border-radius: 10px; }
    .tdpr-chat-title { margin-bottom: 12px; padding-bottom: 10px; }
    .tdpr-chat-messages { padding: 12px; gap: 10px; max-height: 55vh; }

    .tdpr-chat-input-container { padding: 12px; }
    .tdpr-input-wrapper { min-height: 48px; }
    .tdpr-chat-attach { width: 48px; min-height: 48px; font-size: 19px; }
    .tdpr-chat-input { padding: 12px 14px; min-height: 48px; font-size: 15px; }
    .tdpr-chat-send { min-height: 48px; min-width: 96px; padding: 0 16px; font-size: 14px; }

    .tdpr-chat-form-hint__enter { display: none; }
}

@media (max-width: 600px) {
    .tdpr-chat-card { padding: 14px; }
    .tdpr-chat-messages { padding: 10px; gap: 8px; max-height: 60vh; }
    .tdpr-chat-message { max-width: 94%; padding: 10px 13px; }
    .tdpr-chat-message-quote-btn { top: 6px; right: 6px; width: 26px; height: 26px; line-height: 24px; font-size: 13px; }

    .tdpr-chat-image-thumb,
    .tdpr-chat-image-thumb img { max-width: 160px; max-height: 160px; }
    .tdpr-chat-image-thumb--more { min-width: 160px; min-height: 160px; max-width: 160px; max-height: 160px; font-size: 16px; }

    .tdpr-chat-file-link {
        width: 100%;
        max-width: 100%;
        font-size: 14px;
        padding: 9px 14px;
    }
    .tdpr-chat-file-link__icon { font-size: 18px; }
    .tdpr-chat-file-link__name { max-width: 100%; flex: 1; }
    .tdpr-chat-file-link__size { font-size: 12px; }

    .tdpr-chat-badge,
    .tdpr-chat-link--badge {
        width: 100%;
        max-width: 100%;
        font-size: 14px;
        padding: 11px 15px;
        gap: 10px;
    }
    .tdpr-chat-badge__icon { width: 22px; height: 22px; }
    .tdpr-chat-badge__label { max-width: none; white-space: normal; }

    .tdpr-chat-input-container { padding: 10px; }
    .tdpr-input-wrapper { min-height: 46px; gap: 4px; }
    .tdpr-chat-attach { width: 46px; min-height: 46px; font-size: 18px; }
    .tdpr-chat-input { min-height: 46px; padding: 11px 13px; font-size: 15px; }

    /* Кнопка «Отправить» превращается в иконку ➤. */
    .tdpr-chat-send {
        min-width: 46px;
        min-height: 46px;
        padding: 0;
        width: 46px;
        font-size: 0;
        position: relative;
    }
    .tdpr-chat-send::before {
        content: '➤';
        font-size: 20px;
        line-height: 1;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #fff;
    }

    .tdpr-chat-form-meta { font-size: 12px; flex-wrap: wrap; row-gap: 2px; }

    .tdpr-message-system { padding: 12px 14px; gap: 10px; }
    .tdpr-message-system__icon { width: 34px; height: 34px; font-size: 17px; }
}

@media (max-width: 420px) {
    .tdpr-chat-card { padding: 12px; border-radius: 8px; }
    .tdpr-chat-messages { padding: 8px; }

    .tdpr-input-wrapper { min-height: 44px; }
    .tdpr-chat-attach { width: 44px; min-height: 44px; font-size: 17px; }
    .tdpr-chat-input { min-height: 44px; padding: 10px 12px; font-size: 15px; }

    .tdpr-chat-send {
        min-width: 42px;
        min-height: 44px;
        width: 42px;
        padding: 0;
    }
    .tdpr-chat-send::before { font-size: 18px; }

    .tdpr-chat-image-thumb,
    .tdpr-chat-image-thumb img { max-width: 140px; max-height: 140px; }
    .tdpr-chat-image-thumb--more { min-width: 140px; min-height: 140px; max-width: 140px; max-height: 140px; }
}