/* Prose — markdown-rendered assistant message styles */

/* ----- Rendered markdown (assistant final state) ---------------------- */
.chat-msg-prose {
    /* override pre-wrap from the streaming view */
    white-space: normal;
}
.chat-msg-prose > * + * { margin-top: 10px; }
.chat-msg-prose p { line-height: 1.6; }
.chat-msg-prose h1, .chat-msg-prose h2, .chat-msg-prose h3, .chat-msg-prose h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 14px;
}
.chat-msg-prose h1 { font-size: 18px; }
.chat-msg-prose h2 { font-size: 16.5px; }
.chat-msg-prose h3 { font-size: 15px; }
.chat-msg-prose h4 { font-size: 14.5px; }
.chat-msg-prose ul, .chat-msg-prose ol {
    padding-left: 22px;
    line-height: 1.6;
}
.chat-msg-prose li + li { margin-top: 4px; }
.chat-msg-prose code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 12.5px;
    background: var(--bg-surface);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
}
.chat-msg-prose pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.55;
}
.chat-msg-prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
    border-radius: 0;
}
.chat-msg-prose blockquote {
    border-left: 3px solid var(--primary-light);
    padding: 2px 0 2px 12px;
    color: var(--text-secondary);
    font-style: italic;
}
.chat-msg-prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.chat-msg-prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}
.chat-msg-prose table {
    border-collapse: collapse;
    font-size: 13px;
}
.chat-msg-prose th, .chat-msg-prose td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
}
.chat-msg-prose th { background: var(--bg-surface); font-weight: 700; }

/* ----- Reusable data-table: sort + live-search -------------------------------- */
.data-table-wrap { overflow-x: auto; }
.data-table-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12.5px;
    background: var(--bg);
    color: var(--text);
    outline: none;
}
.data-table-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.data-table-search::placeholder { color: var(--text-dim); }

/* Make wrapped prose tables fill the scroll container */
.chat-msg-prose .data-table-wrap table { width: 100%; }

.data-table-wrap th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.data-table-wrap th:hover { background: var(--bg-hover); }
.dt-th-inner { display: flex; align-items: center; gap: 5px; }
.dt-sort-icon {
    font-style: normal;
    font-size: 10px;
    color: var(--text-dim);
    flex-shrink: 0;
    line-height: 1;
}
.dt-sort-icon::after { content: "\21C5"; }           /* ⇅ default */
[data-sort="asc"]  .dt-sort-icon::after { content: "\2191"; color: var(--primary); }  /* ↑ */
[data-sort="desc"] .dt-sort-icon::after { content: "\2193"; color: var(--primary); }  /* ↓ */

.dt-row-hidden { display: none !important; }

/* CSV file viewer in the files modal */
.files-viewer-csv {
    padding: 12px 16px;
    overflow-x: auto;
}
.files-viewer-csv table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 13px;
}
.files-viewer-csv th,
.files-viewer-csv td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
}
.files-viewer-csv th {
    background: var(--bg-surface);
    font-weight: 700;
}

