/* Стили шаренной разметки чата 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; }
.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;
}
.markdown-content table {
    width: 100%;
    margin: 0.75rem 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;
}
.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;
}
