/* Стили шаренной разметки чата console_shell/_chat.html. Используются
   и в LK 1С code console, и в admin dev-task workspace — должны жить
   рядом с partial, чтобы не зависеть от страницы-хоста. */

/* ----- Markdown: чат и превью редактора (#code-preview) ----- */
/* Tailwind preflight сбрасывает списки/заголовки — типографику задаём явно. */
.markdown-content {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.65;
    color: #e2e8f0;
}
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }

.md-mermaid {
    margin: 0.75rem 0;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 0.75rem;
    background: rgba(2, 6, 23, 0.65);
}
.md-mermaid-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
    padding: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.md-mermaid-toolbar button {
    padding: 0.22rem 0.48rem;
    border-radius: 0.35rem;
    color: #94a3b8;
    font-size: 0.7rem;
}
.md-mermaid-toolbar button:hover { color: #e2e8f0; background: rgba(255, 255, 255, 0.08); }
.md-mermaid-canvas { overflow: auto; padding: 0.75rem; }
.md-mermaid-canvas svg { display: block; max-width: 100%; height: auto; margin: auto; }
.md-mermaid-source { margin: 0; border: 0; border-radius: 0; }
.md-mermaid-error { margin: 0; padding: 0.5rem 0.75rem; color: #fda4af; font-size: 0.75rem; }
.md-mermaid-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.92);
}
.md-mermaid-lightbox > button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.6rem;
}
.md-mermaid-lightbox > div { width: min(96vw, 1200px); max-height: 92vh; overflow: auto; }
.md-mermaid-lightbox svg { width: 100%; height: auto; }

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.3;
}
.markdown-content h1 { font-size: 1.35rem; margin: 1.25rem 0 0.65rem; }
.markdown-content h2 { font-size: 1.15rem; margin: 1.1rem 0 0.55rem; }
.markdown-content h3 { font-size: 1rem; margin: 0.95rem 0 0.45rem; }
.markdown-content h4 { font-size: 0.92rem; margin: 0.85rem 0 0.4rem; }
.markdown-content p { margin: 0.55rem 0; }
.markdown-content ul,
.markdown-content ol {
    margin: 0.55rem 0;
    padding-left: 1.35rem;
}
.markdown-content ul { list-style: disc; }
.markdown-content ol { list-style: decimal; }
.markdown-content li { margin: 0.2rem 0; }
.markdown-content li > ul,
.markdown-content li > ol { margin: 0.2rem 0; }
.markdown-content blockquote {
    margin: 0.75rem 0;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 3px solid rgba(148, 163, 184, 0.45);
    color: #94a3b8;
}
.markdown-content hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.markdown-content a {
    color: #67e8f9;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.markdown-content a:hover { color: #a5f3fc; }
.markdown-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: 0.875em;
}
.markdown-content :not(pre) > code {
    padding: 0.12rem 0.35rem;
    border-radius: 0.35rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: normal;
    overflow-wrap: anywhere;
}
.markdown-content pre {
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    white-space: pre;
}
.markdown-content pre code {
    display: block;
    min-width: max-content;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    line-height: 1.55;
}
/* Таблица заворачивается в .md-table-wrap рендерером (markdown.js): на узких экранах
   скроллится вбок сама, а не распирает сообщение и страницу целиком. */
.md-table-wrap {
    max-width: 100%;
    margin: 0.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.markdown-content table {
    width: 100%;
    min-width: max-content;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.markdown-content th,
.markdown-content td {
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    white-space: nowrap;
}
.markdown-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}
.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(14, 116, 144, 0.95));
    color: #e0f2fe;
    transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
}
.chat-send-btn:hover { filter: brightness(1.08); }
.chat-send-btn:active { transform: translateY(1px); }
.chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.chat-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.65);
    color: #cbd5e1;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.chat-attach-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #f1f5f9;
    border-color: rgba(56, 189, 248, 0.45);
}
.chat-attach-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Скроллбар истории чата убран — нет дёрганья при появлении. */
.chat-scroll-area {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.chat-scroll-area::-webkit-scrollbar { display: none; }

/* Markdown внутри пузыря чата не должен расширять сообщение шире колонки. */
.chat-scroll-area .markdown-content {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.chat-scroll-area .markdown-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    border-radius: 0.5rem;
    background: rgba(2, 6, 23, 0.45);
}
.chat-scroll-area .markdown-content pre code {
    display: block;
    min-width: max-content;
}
.chat-scroll-area .markdown-content :not(pre) > code {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Кнопка «вложения и режимы», пункт вложения в ней и чипы включённых режимов —
   только для узкого экрана: на широком видны отдельная скрепка и строка переключателей. */
button.chat-plus-btn,
button.chat-modes-attach,
div.chat-mode-chips {
    display: none;
}

/* ===== Мобильная адаптация (< lg): крупнее тач-таргеты, компактнее типографика ===== */
@media (max-width: 1023px) {
    /* Кнопки отправки/аттача — палец должен попадать уверенно. */
    .chat-send-btn,
    .chat-attach-btn {
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 999px;
    }
    /* Заголовки в чате чуть меньше, чтобы не съедали узкий экран. */
    .markdown-content h1 { font-size: 1.2rem; }
    .markdown-content h2 { font-size: 1.05rem; }
    .markdown-content h3 { font-size: 0.98rem; }
    /* Тонкий видимый скроллбар для кода — на тач-экране полосу проще ухватить. */
    .chat-scroll-area .markdown-content pre {
        scrollbar-width: thin;
    }
}

@media (max-width: 640px) {
    /* Tailwind-утилиты подключаются рантаймом после файла, поэтому селекторы усилены тегом. */
    /* На узком экране лента важнее полей формы: вертикальные поля композера ужаты. */
    form.chat-composer {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    /* Меньше 16px мобильный Safari трактует как повод зазумить страницу при фокусе. */
    textarea.chat-message-input {
        font-size: 16px;
        line-height: 1.35;
        border-radius: 1.25rem;
    }

    /* Вложения и режимы живут в меню кнопки «+»: в строке остаются поле и отправка. */
    div.chat-modes {
        display: none;
    }

    div.chat-modes.open {
        position: absolute;
        left: 0.75rem;
        bottom: calc(100% - 0.5rem);
        z-index: 30;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        width: max-content;
        min-width: 13rem;
        padding: 12px 14px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: #0f172a;
        box-shadow: 0 16px 38px rgba(2, 6, 23, 0.6);
    }

    div.chat-modes.open > label > span:last-child {
        font-size: 14px;
        color: #cbd5f5;
    }

    button.chat-modes-attach {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        color: #cbd5f5;
        font-size: 14px;
    }

    button.chat-modes-attach svg {
        width: 1.05rem;
        height: 1.05rem;
        color: #94a3b8;
    }

    button.chat-plus-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        flex: none;
        border-radius: 999px;
        color: #94a3b8;
        background: rgba(255, 255, 255, 0.05);
    }

    button.chat-plus-btn svg {
        width: 1.3rem;
        height: 1.3rem;
    }

    button.chat-plus-btn.open {
        color: #e2e8f0;
        background: rgba(255, 255, 255, 0.12);
        transform: rotate(45deg);
    }

    /* Включённый режим виден без раскрытия меню. */
    button.chat-plus-btn.active {
        color: #67e8f9;
        background: rgba(34, 211, 238, 0.14);
    }

    /* Отдельная скрепка не нужна — она пунктом в меню «+». */
    button.chat-attach-btn {
        display: none;
    }

    div.chat-mode-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    div.chat-mode-chips button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 3px 8px 3px 10px;
        border-radius: 8px;
        border: 1px solid rgba(34, 211, 238, 0.3);
        background: rgba(34, 211, 238, 0.1);
        color: #cffafe;
        font-size: 12px;
    }

    div.chat-mode-chips button svg {
        width: 12px;
        height: 12px;
        color: rgba(207, 250, 254, 0.7);
    }

    /* Пустое поле — вся ширина строки: кнопка отправки появляется вместе с текстом
       или вложением, отправить можно и клавишей Enter. */
    form:not(.has-text) button.chat-send-btn {
        display: none;
    }
}

/* ===== Изображения сообщений: превью-сетка и полноэкранный просмотр ===== */
.chat-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chat-image-grid button {
    width: 108px;
    height: 108px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.45);
    transition: border-color 0.15s ease, filter 0.15s ease;
}

.chat-image-grid button:hover {
    border-color: rgba(34, 211, 238, 0.45);
    filter: brightness(1.07);
}

.chat-image-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

/* Картинки внутри markdown кликабельны и не растягивают ленту сообщений. */
.chat-scroll-area .markdown-content img {
    max-height: 18rem;
    width: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    cursor: zoom-in;
    transition: border-color 0.15s ease, filter 0.15s ease;
}

.chat-scroll-area .markdown-content img:hover {
    border-color: rgba(34, 211, 238, 0.4);
    filter: brightness(1.08);
}

.chat-lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    overscroll-behavior: none;
    background: rgba(2, 6, 23, 0.96);
    backdrop-filter: blur(8px);
    user-select: none;
}

.chat-lightbox-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 999px;
    color: #cbd5e1;
    transition: background 0.15s ease, color 0.15s ease;
}

.chat-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chat-lightbox-btn svg {
    width: 20px;
    height: 20px;
}

.chat-lightbox-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.chat-lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.chat-lightbox-nav {
    position: absolute;
    top: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    color: #cbd5e1;
    backdrop-filter: blur(4px);
}

.chat-lightbox-nav:hover {
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
}

.chat-lightbox-nav svg {
    width: 20px;
    height: 20px;
}

.chat-lightbox-nav.prev { left: 12px; }
.chat-lightbox-nav.next { right: 12px; }

/* На тач-экране листаем свайпом, стрелки нужны только на мыши. */
@media (min-width: 641px) {
    .chat-lightbox-nav { display: inline-flex; }
}

.chat-lightbox-strip {
    flex: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: thin;
}

.chat-lightbox-strip > div {
    display: flex;
    gap: 8px;
    width: max-content;
    margin: 0 auto;
}

.chat-lightbox-strip button {
    width: 56px;
    height: 56px;
    flex: none;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    opacity: 0.55;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.chat-lightbox-strip button.active {
    border-color: rgba(34, 211, 238, 0.75);
    opacity: 1;
}

.chat-lightbox-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Хештеги-уточнения ===== */
.chat-hashtag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-hashtag-chips.message {
    margin-top: 8px;
}

.chat-hashtag-chips span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 8px;
    border: 1px solid rgba(34, 211, 238, 0.32);
    border-radius: 8px;
    background: rgba(34, 211, 238, 0.1);
    color: #cffafe;
    font-size: 11.5px;
}

.chat-hashtag-chips.message span {
    padding: 2px 8px;
}

.chat-hashtag-chips button {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    color: rgba(207, 250, 254, 0.7);
}

.chat-hashtag-chips button:hover {
    color: #fca5a5;
}

.chat-hashtag-chips svg {
    width: 11px;
    height: 11px;
}

.chat-hashtag-menu {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(100% - 0.5rem);
    z-index: 30;
    max-width: 28rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.97);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(6px);
}

.chat-hashtag-menu > div {
    max-height: 16rem;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
}

.chat-hashtag-menu button {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    color: #e2e8f0;
    text-align: left;
}

.chat-hashtag-menu button.active {
    background: rgba(34, 211, 238, 0.18);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.chat-hashtag-menu button b {
    flex: none;
    font-size: 13px;
    font-weight: 600;
}

.chat-hashtag-menu button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8296ad;
    font-size: 12px;
}

.chat-hashtag-menu p {
    padding: 8px 10px;
    color: #8296ad;
    font-size: 12px;
}

/* ----- Панель регламентов агента в шапке чата ----- */
.console-chat-header { position: relative; }
.chat-sched { display: inline-flex; }
.chat-sched .tb-icon { position: relative; }
.chat-sched .tb-icon.active { background: rgba(255, 255, 255, 0.1); color: #f1f5f9; }

.chat-sched-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 14px;
    padding: 0 3px;
    border: 2px solid #0b1220;
    border-radius: 9999px;
    background: #22d3ee;
    color: #062024;
    font-size: 9px;
    font-weight: 600;
    line-height: 12px;
    text-align: center;
}

.chat-sched-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 8px;
    right: 8px;
    z-index: 30;
    max-height: min(560px, 70vh);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: #0b1220;
}

.chat-sched-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-sched-title { color: #fff; font-size: 16px; font-weight: 600; }

.chat-sched-total {
    flex: none;
    padding: 3px 12px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 13px;
}

.chat-sched-list { padding: 0 16px; }

.chat-sched-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.chat-sched-item:last-child { border-bottom: 0; }

.chat-sched-item-main { display: flex; flex-direction: column; min-width: 0; }
.chat-sched-name { overflow: hidden; color: #f1f5f9; font-size: 14px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.chat-sched-schedule { margin-top: 4px; color: #94a3b8; font-size: 13px; }
.chat-sched-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chat-sched-facts > span { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 12px; }
.chat-sched-facts svg { flex: none; color: #64748b; }
.chat-sched-facts i { width: 6px; height: 6px; border-radius: 9999px; background: #64748b; }
.chat-sched-facts .status-ok { padding: 3px 12px; border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 9999px; background: rgba(52, 211, 153, 0.1); color: #6ee7b7; }
.chat-sched-facts .status-ok i { background: #34d399; }
.chat-sched-facts .status-error, .chat-sched-facts .status-no_access { padding: 3px 12px; border: 1px solid rgba(251, 113, 133, 0.3); border-radius: 9999px; background: rgba(251, 113, 133, 0.1); color: #fda4af; }
.chat-sched-facts .status-error i, .chat-sched-facts .status-no_access i { background: #fb7185; }
.chat-sched-facts .status-silent { padding: 3px 12px; border: 1px solid rgba(99, 102, 241, 0.3); border-radius: 9999px; background: rgba(99, 102, 241, 0.1); color: #c7d2fe; }
.chat-sched-facts .status-silent i { background: #818cf8; }

.chat-sched-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.chat-sched-delete:hover { background: rgba(255, 255, 255, 0.1); color: #f1f5f9; }
.chat-sched-delete:disabled { cursor: wait; opacity: 0.5; }

.chat-sched-empty { padding: 32px; color: #cbd5e1; font-size: 14px; text-align: center; }
.chat-sched-loading { display: flex; gap: 8px; justify-content: center; padding: 32px; }
.chat-sched-loading span { width: 40px; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); animation: pulse 1.6s cubic-bezier(.4,0,.6,1) infinite; }

.chat-sched .tb-icon:focus-visible,
.chat-sched-delete:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.4);
}

.chat-sched-delete {
    width: 44px;
    height: 44px;
    margin: -6px;
}

@media (max-width: 640px) {
    .chat-sched-panel {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 50;
        max-height: 72dvh;
    }
}

.chat-sched-mobile-panel { display: none; }

@media (max-width: 640px) {
    .chat-sched-close:focus-visible {
        outline: none;
        box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.4);
    }

    .chat-sched-mobile-panel {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 50;
        display: block;
        max-height: 72dvh;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        background: #0b1220;
    }

    .chat-sched-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        background: transparent;
        color: #cbd5e1;
    }
}
.chat-document-chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.chat-document-chip { display:inline-flex; min-width:0; max-width:16rem; align-items:center; border:1px solid rgba(255,255,255,.1); border-radius:8px; background:rgba(15,23,42,.5); color:#e2e8f0; font-size:11px; }
.chat-document-chip a { display:flex; min-width:0; align-items:center; gap:6px; padding:4px 8px; color:inherit; }
.chat-document-chip a span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-document-chip > button { padding:4px 7px; color:#94a3b8; }
@media (max-width: 640px) { .chat-image-grid button { width:84px; height:84px; } .chat-document-chip { max-width:13rem; } }
