/* ── Streaming markdown prose (streaming-markdown output) ─────────────────── */

.chat-with-file .cwf-md {
    font-size: .95rem;
    line-height: 1.75;
    color: var(--text, #111827);
    word-break: break-word;
}

.chat-with-file .cwf-md__fallback {
    white-space: pre-wrap;
}

.chat-with-file .cwf-md--rendered .cwf-md__fallback {
    display: none;
}

.chat-with-file .cwf-md > :first-child {
    margin-top: 0;
}

.chat-with-file .cwf-md > :last-child {
    margin-bottom: 0;
}

.chat-with-file .cwf-md p {
    margin: 0 0 .85rem;
}

.chat-with-file .cwf-md h1,
.chat-with-file .cwf-md h2,
.chat-with-file .cwf-md h3,
.chat-with-file .cwf-md h4,
.chat-with-file .cwf-md h5,
.chat-with-file .cwf-md h6 {
    margin: 1.25rem 0 .55rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text, #111827);
}

.chat-with-file .cwf-md h1 { font-size: 1.35rem; }
.chat-with-file .cwf-md h2 { font-size: 1.2rem; }
.chat-with-file .cwf-md h3 { font-size: 1.08rem; }
.chat-with-file .cwf-md h4 { font-size: 1rem; }

.chat-with-file .cwf-md strong {
    font-weight: 700;
}

.chat-with-file .cwf-md em {
    font-style: italic;
}

.chat-with-file .cwf-md del {
    opacity: .75;
}

.chat-with-file .cwf-md a {
    color: var(--brand, #6366f1);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-with-file .cwf-md a:hover {
    color: #4f46e5;
}

.chat-with-file .cwf-md ul,
.chat-with-file .cwf-md ol {
    margin: 0 0 .85rem;
    padding-inline-start: 1.35rem;
}

.chat-with-file .cwf-md li {
    margin: .25rem 0;
}

.chat-with-file .cwf-md li > ul,
.chat-with-file .cwf-md li > ol {
    margin-bottom: 0;
}

.chat-with-file .cwf-md blockquote {
    margin: .85rem 0;
    padding: .55rem .85rem;
    border-inline-start: 3px solid rgba(99, 102, 241, .45);
    background: rgba(99, 102, 241, .06);
    border-radius: .35rem;
    color: var(--text-muted, #4b5563);
}

.chat-with-file .cwf-md hr {
    margin: 1.1rem 0;
    border: 0;
    border-top: 1px solid var(--surface-border, #e5e7eb);
}

.chat-with-file .cwf-md code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86em;
    padding: .12rem .35rem;
    border-radius: .35rem;
    background: rgba(15, 23, 42, .07);
    color: #0f172a;
}

.chat-with-file .cwf-md pre {
    margin: .85rem 0;
    padding: .85rem 1rem;
    border-radius: .75rem;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}

.chat-with-file .cwf-md pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: .84rem;
    line-height: 1.65;
}

.chat-with-file .cwf-md table {
    width: 100%;
    margin: .85rem 0;
    border-collapse: collapse;
    font-size: .88rem;
    display: block;
    overflow-x: auto;
}

.chat-with-file .cwf-md th,
.chat-with-file .cwf-md td {
    border: 1px solid var(--surface-border, #e5e7eb);
    padding: .45rem .65rem;
    text-align: start;
}

.chat-with-file .cwf-md th {
    background: var(--surface-alt, #f3f4f6);
    font-weight: 600;
}

.chat-with-file .cwf-md img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
}

.chat-with-file .cwf-md input[type="checkbox"] {
    margin-inline-end: .4rem;
    vertical-align: middle;
}

.chat-with-file .cwf-msg--user .cwf-msg__text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-with-file .cwf-msg--assistant .cwf-msg__bubble {
    max-width: 100%;
}
