/* ========================================================================== */
/* Content Markup - AI Agent V2                                               */
/* Unified markdown rendering styles adapted from ProjectManager              */
/* Scope: .ai-content, .message.ai .content, .grid-message-content            */
/* ========================================================================== */

/* ===================================== */
/* CSS VARIABLES - Design Tokens         */
/* ===================================== */

:root {
    /* Content Area */
    --content-bg: #0f1419;
    --content-text: var(--text-primary);
    --content-padding: 16px;

    /* Typography */
    --heading1-color: var(--text-primary);
    --heading2-color: var(--text-primary);
    --heading3-color: #c9d0dc;
    --paragraph-color: #b8c0cc;
    --muted-color: #8b95a5;

    /* Links */
    --link-color: var(--accent-blue);
    --link-hover-color: #93c5fd;
    --link-visited-color: #a78bfa;

    /* Blockquotes */
    --blockquote-bg: rgba(77, 163, 255, 0.08);
    --blockquote-border: #4da3ff;
    --blockquote-text: #c9d0dc;

    /* Inline Code */
    --inline-code-bg: rgba(255, 255, 255, 0.08);
    --inline-code-text: #f78c6c;
    --inline-code-border: rgba(255, 255, 255, 0.12);

    /* Code Blocks - Dark near-black background */
    --code-bg: #0d0f12;
    --code-border: #1a1d24;
    --code-text: #e4e8ee;
    --code-header-bg: #0a0c0f;
    --code-line-number: #4a5366;

    /* Token Colors (Prism) - Night Owl Vibrant Theme */
    --code-comment: #637777;
    --code-punctuation: #c792ea;
    --code-keyword: #c792ea;
    --code-string: #ecc48d;
    --code-number: #f78c6c;
    --code-function: #82aaff;
    --code-class: #ffcb6b;
    --code-operator: #7fdbca;
    --code-variable: #addb67;
    --code-constant: #f78c6c;
    --code-tag: #ef5350;
    --code-attr-name: #ffcb6b;
    --code-attr-value: #ecc48d;
    --code-boolean: #ff5874;
    --code-builtin: #addb67;
    --code-regex: #80cbc4;

    /* Tables - Black header/white cells theme */
    --table-bg: #ffffff;
    --table-border: #d0d7de;
    --table-text: #1a1a1a;
    --table-header-bg: #1a1a1a;
    --table-header-text: #ffffff;
    --table-header-border: #333333;
    --table-cell-bg: #ffffff;
    --table-cell-text: #1a1a1a;
    --table-stripe-bg: #ffffff;
    --table-hover-bg: #f5f5f5;
    /* Table inline code */
    --table-code-bg: #f0f0f0;
    --table-code-text: #0550ae;
    --table-code-border: #d0d7de;

    /* Lists */
    --list-marker-color: #4da3ff;
    --list-text-color: var(--paragraph-color);

    /* Horizontal Rule */
    --hr-color: #2a3242;

    /* Images */
    --image-border-radius: 8px;
    --image-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --content-bg: var(--text-primary);
    --content-text: #1f2937;

    --heading1-color: #111827;
    --heading2-color: #1f2937;
    --heading3-color: #374151;
    --paragraph-color: #4b5563;
    --muted-color: #6b7280;

    --link-color: #4f46e5;
    --link-hover-color: #4338ca;
    --link-visited-color: #7c3aed;

    --blockquote-bg: rgba(99, 102, 241, 0.08);
    --blockquote-border: #6366f1;
    --blockquote-text: #4b5563;

    --inline-code-bg: rgba(0, 0, 0, 0.06);
    --inline-code-text: #dc2626;
    --inline-code-border: rgba(0, 0, 0, 0.1);

    --code-bg: #1e1e1e;
    --code-border: #333333;
    --code-header-bg: #252526;

    --hr-color: #e5e7eb;
}

/* ===================================== */
/* BASE CONTENT STYLES                   */
/* ===================================== */

.ai-content,
.message.ai .content,
.grid-message-content,
.markdown-content {
    font-family:
        "Roboto",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--content-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===================================== */
/* TYPOGRAPHY - Headings                 */
/* ===================================== */

.ai-content h1,
.message.ai .content h1,
.grid-message-content h1,
.markdown-content h1 {
    color: var(--heading1-color);
    font-size: 1.75em;
    font-weight: 700;
    margin: 1.5em 0 0.75em 0;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--hr-color);
    line-height: 1.3;
}

.ai-content h2,
.message.ai .content h2,
.grid-message-content h2,
.markdown-content h2 {
    color: var(--heading2-color);
    font-size: 1.4em;
    font-weight: 700;
    margin: 1.25em 0 0.6em 0;
    padding-bottom: 0.2em;
    border-bottom: 1px solid var(--hr-color, rgba(255, 255, 255, 0.1));
    line-height: 1.35;
}

.ai-content h3,
.message.ai .content h3,
.grid-message-content h3,
.markdown-content h3 {
    color: var(--heading3-color);
    font-size: 1.2em;
    font-weight: 600;
    margin: 1em 0 0.5em 0;
    line-height: 1.4;
}

.ai-content h4,
.message.ai .content h4,
.grid-message-content h4,
.markdown-content h4 {
    color: var(--heading3-color);
    font-size: 1.1em;
    font-weight: 600;
    margin: 1em 0 0.4em 0;
}

.ai-content h5,
.message.ai .content h5,
.grid-message-content h5,
.markdown-content h5 {
    color: var(--heading3-color);
    font-size: 1em;
    font-weight: 600;
    margin: 0.8em 0 0.3em 0;
}

.ai-content h6,
.message.ai .content h6,
.grid-message-content h6,
.markdown-content h6 {
    color: var(--muted-color);
    font-size: 0.9em;
    font-weight: 600;
    margin: 0.8em 0 0.3em 0;
}

/* First heading - no top margin */
.ai-content > h1:first-child,
.ai-content > h2:first-child,
.ai-content > h3:first-child,
.message.ai .content > h1:first-child,
.message.ai .content > h2:first-child,
.message.ai .content > h3:first-child,
.grid-message-content > h1:first-child,
.grid-message-content > h2:first-child,
.grid-message-content > h3:first-child {
    margin-top: 0;
}

/* ===================================== */
/* TYPOGRAPHY - Paragraphs               */
/* ===================================== */

.ai-content p,
.message.ai .content p,
.grid-message-content p,
.markdown-content p {
    color: var(--paragraph-color);
    font-size: 1em;
    line-height: 1.65;
    margin: 0.8em 0;
}

.ai-content p:first-child,
.message.ai .content p:first-child {
    margin-top: 0;
}

.ai-content p:last-child,
.message.ai .content p:last-child {
    margin-bottom: 0;
}

/* ===================================== */
/* TYPOGRAPHY - Text Formatting          */
/* ===================================== */

.ai-content strong,
.message.ai .content strong,
.grid-message-content strong {
    font-weight: 600;
    color: var(--heading2-color);
}

/* Strong inside tables — inherit cell text color */
.ai-content table strong,
.message.ai .content table strong,
.grid-message-content table strong,
.markdown-content table strong,
.markdown-table strong,
table.agent-table strong,
table.managed-table strong {
    color: inherit !important;
}

.ai-content em,
.message.ai .content em,
.grid-message-content em {
    font-style: italic;
}

.ai-content del,
.message.ai .content del,
.grid-message-content del {
    text-decoration: line-through;
    color: var(--muted-color);
}

.ai-content mark,
.message.ai .content mark {
    background: rgba(255, 235, 59, 0.3);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* ===================================== */
/* LINKS                                 */
/* ===================================== */

.ai-content a,
.message.ai .content a,
.grid-message-content a,
.markdown-content a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition:
        color 0.15s ease,
        text-decoration 0.15s ease;
}

.ai-content a:hover,
.message.ai .content a:hover,
.grid-message-content a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.ai-content a:visited,
.message.ai .content a:visited {
    color: var(--link-visited-color);
}

/* External link indicator */
.ai-content a[target="_blank"]::after,
.message.ai .content a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
}

/* ===================================== */
/* BLOCKQUOTES                           */
/* ===================================== */

.ai-content blockquote,
.message.ai .content blockquote,
.grid-message-content blockquote,
.markdown-content blockquote,
.markdown-blockquote {
    background: var(--blockquote-bg);
    border-left: 4px solid var(--blockquote-border);
    margin: 1em 0;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    color: var(--blockquote-text);
    font-style: normal;
}

.ai-content blockquote p,
.message.ai .content blockquote p,
.markdown-blockquote p {
    margin: 0.5em 0;
    color: inherit;
}

.ai-content blockquote p:first-child,
.markdown-blockquote p:first-child {
    margin-top: 0;
}

.ai-content blockquote p:last-child,
.markdown-blockquote p:last-child {
    margin-bottom: 0;
}

/* Nested blockquotes */
.ai-content blockquote blockquote,
.message.ai .content blockquote blockquote {
    margin-left: 0.5em;
    border-left-color: var(--link-color);
}

/* ===================================== */
/* LISTS                                 */
/* ===================================== */

.ai-content ul,
.ai-content ol,
.message.ai .content ul,
.message.ai .content ol,
.grid-message-content ul,
.grid-message-content ol,
.markdown-content ul,
.markdown-content ol {
    margin: 0.75em 0;
    padding-left: 1.75em;
    color: var(--list-text-color);
}

.ai-content li,
.message.ai .content li,
.grid-message-content li {
    margin: 0.35em 0;
    line-height: 1.6;
}

.ai-content ul > li,
.message.ai .content ul > li {
    list-style-type: disc;
}

.ai-content ul > li::marker,
.message.ai .content ul > li::marker {
    color: var(--list-marker-color);
}

.ai-content ol > li,
.message.ai .content ol > li {
    list-style-type: decimal;
}

.ai-content ol > li::marker,
.message.ai .content ol > li::marker {
    color: var(--list-marker-color);
    font-weight: 600;
}

/* Nested lists */
.ai-content li > ul,
.ai-content li > ol,
.message.ai .content li > ul,
.message.ai .content li > ol {
    margin: 0.25em 0;
}

.ai-content ul ul > li {
    list-style-type: circle;
}

.ai-content ul ul ul > li {
    list-style-type: square;
}

/* Task lists (GFM) */
.ai-content ul.task-list,
.message.ai .content ul.task-list {
    list-style: none;
    padding-left: 0;
}

.ai-content .task-list-item,
.message.ai .content .task-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
}

.ai-content .task-list-item input[type="checkbox"],
.message.ai .content .task-list-item input[type="checkbox"] {
    margin-top: 0.35em;
    accent-color: var(--link-color);
}

/* ===================================== */
/* HORIZONTAL RULE                       */
/* ===================================== */

.ai-content hr,
.message.ai .content hr,
.grid-message-content hr,
.markdown-content hr {
    border: none;
    height: 1px;
    background: var(--hr-color);
    margin: 1.5em 0;
}

/* ===================================== */
/* INLINE CODE                           */
/* ===================================== */

.ai-content code:not(pre code),
.message.ai .content code:not(pre code),
.grid-message-content code:not(pre code),
.markdown-content code:not(pre code),
.inline-code {
    background: var(--inline-code-bg);
    color: var(--inline-code-text);
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-weight: 400;
    font-size: 0.875em;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--inline-code-border);
    white-space: nowrap;
}

/* ===================================== */
/* CODE BLOCKS                           */
/* ===================================== */

.code-block,
.code-block-wrapper {
    position: relative;
    margin: 1em 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--code-header-bg);
    border-bottom: 1px solid var(--code-border);
    font-size: 12px;
}

.code-block-lang,
.code-lang-badge {
    color: var(--muted-color);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-block-copy,
.code-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: var(--muted-color);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-block-copy:hover,
.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--content-text);
}

.code-block-copy.copied,
.code-copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.code-block pre,
.code-block-wrapper pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: var(--code-bg);
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.6;
    tab-size: 2;
}

.code-block code,
.code-block-wrapper code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--code-text);
    font-family: inherit;
    font-size: inherit;
    white-space: pre;
}

/* Scrollbar for code blocks */
.code-block pre::-webkit-scrollbar,
.code-block-wrapper pre::-webkit-scrollbar {
    height: 8px;
}

.code-block pre::-webkit-scrollbar-track {
    background: var(--code-bg);
}

.code-block pre::-webkit-scrollbar-thumb {
    background: var(--code-border);
    border-radius: 4px;
}

.code-block pre::-webkit-scrollbar-thumb:hover {
    background: var(--bg-surface);
}

/* Fallback for pre without code-block wrapper */
.ai-content pre:not(.code-block pre):not(.code-block-wrapper pre),
.message.ai .content pre:not(.code-block pre):not(.code-block-wrapper pre),
.grid-message-content pre:not(.code-block pre):not(.code-block-wrapper pre),
.markdown-content pre:not(.code-block pre):not(.code-block-wrapper pre) {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 1em 0;
}

/* ===================================== */
/* PRISM.JS SYNTAX HIGHLIGHTING          */
/* IntelliJ Darcula Theme - No italics   */
/* ===================================== */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #808080;
}

.token.punctuation {
    color: #a9b7c6;
}

.token.property {
    color: #b267e6;
}

.token.tag {
    color: #e8bf6a;
}

.token.boolean {
    color: #b267e6;
}

.token.number {
    color: #6897bb;
}

.token.constant {
    color: #b267e6;
}

.token.symbol {
    color: #6a8759;
}

.token.selector {
    color: #b267e6;
}

.token.attr-name {
    color: #bababa;
}

.token.string,
.token.char {
    color: #6a8759;
}

.token.builtin {
    color: #ffc66d;
}

.token.operator {
    color: #a9b7c6;
}

.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #6a8759;
}

.token.atrule,
.token.attr-value {
    color: #6a8759;
}

.token.keyword {
    color: #b267e6;
}

.token.function {
    color: #ffc66d;
}

.token.class-name {
    color: #a9b7c6;
}

.token.regex {
    color: #6a8759;
}

.token.important {
    color: #b267e6;
    font-weight: bold;
}

.token.variable {
    color: #a9b7c6;
}

.token.bold {
    font-weight: bold;
}

.token.italic {
    font-style: normal;
}

.token.entity {
    cursor: help;
}

.token.deleted {
    color: #6a8759;
    background: rgba(106, 135, 89, 0.15);
}

.token.inserted {
    color: #6a8759;
    background: rgba(106, 135, 89, 0.15);
}

/* Java/Kotlin specific */
.token.annotation {
    color: #bbb529;
}

.token.namespace {
    color: #a9b7c6;
}

/* XML/HTML specific */
.token.doctype,
.token.prolog {
    color: #808080;
}

.token.tag .token.punctuation {
    color: #e8bf6a;
}

.token.tag .token.attr-name {
    color: #bababa;
}

.token.tag .token.attr-value {
    color: #6a8759;
}

/* ===================================== */
/* TABLES                                */
/* ===================================== */

.table-wrapper {
    overflow-x: auto;
    margin: 1em 0;
    border-radius: 8px;
    min-width: 0;
}

.ai-content table,
.message.ai .content table,
.grid-message-content table,
.markdown-content table,
.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--table-bg, #0d1b2a);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--table-border, #1b3a5c);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    table-layout: auto;
}

.ai-content table th,
.ai-content table td,
.message.ai .content table th,
.message.ai .content table td,
.grid-message-content table th,
.grid-message-content table td,
.markdown-table th,
.markdown-table td {
    border: 1px solid var(--table-border, #1b3a5c);
    padding: 8px 14px;
    text-align: left;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Table Header — dark blue */
.ai-content table th,
.message.ai .content table th,
.grid-message-content table th,
.markdown-table th {
    background: var(--table-header-bg, #0a2540);
    color: var(--table-header-text, #e0e6ed);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    border-color: var(--table-header-border, #1b3a5c);
    font-size: 13px;
}

/* Table Body Cells — dark blue theme */
.ai-content table tbody td,
.message.ai .content table tbody td,
.grid-message-content table tbody td,
.markdown-table tbody td {
    background-color: var(--table-cell-bg, #0f2234) !important;
    color: var(--table-cell-text, #c8d6e5) !important;
}

/* Striped Rows — subtle alternation */
.ai-content table tbody tr:nth-child(even) td,
.message.ai .content table tbody tr:nth-child(even) td,
.grid-message-content table tbody tr:nth-child(even) td,
.markdown-table tbody tr:nth-child(even) td {
    background: var(--table-stripe-bg, #122a3e) !important;
}

/* Row Hover */
.ai-content table tbody tr:hover td,
.message.ai .content table tbody tr:hover td,
.grid-message-content table tbody tr:hover td,
.markdown-table tbody tr:hover td {
    background: var(--table-hover-bg, #163350) !important;
}

/* Table inline code — dark blue */
.ai-content table code,
.message.ai .content table code,
.grid-message-content table code,
.markdown-table code {
    background: var(--table-code-bg, #1b3a5c) !important;
    color: var(--table-code-text, #7ec8e3) !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--table-code-border, #254a6e);
}

/* ===================================== */
/* FORCE OVERRIDE - Inline Styles       */
/* ===================================== */
/* Override inline styles from JS renderer with CSS-controlled dark blue theme */
.ai-content table th,
.message.ai .content table th,
.grid-message-content table th,
.markdown-content table th,
.markdown-table th {
    background-color: var(--table-header-bg, #0a2540) !important;
    color: var(--table-header-text, #e0e6ed) !important;
    border-color: var(--table-header-border, #1b3a5c) !important;
}

.ai-content table td,
.message.ai .content table td,
.grid-message-content table td,
.markdown-content table td,
.markdown-table td {
    background-color: var(--table-cell-bg, #0f2234) !important;
    color: var(--table-cell-text, #c8d6e5) !important;
    border-color: var(--table-border, #1b3a5c) !important;
}

/* First column cells — slightly bolder */
.ai-content table td:first-child,
.message.ai .content table td:first-child,
.grid-message-content table td:first-child,
.markdown-table td:first-child {
    font-weight: 500;
}

/* ===================================== */
/* IMAGES                                */
/* ===================================== */

.ai-content img,
.message.ai .content img,
.grid-message-content img,
.markdown-content img,
.markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--image-border-radius);
    margin: 1em 0;
    box-shadow: var(--image-shadow);
}

.ai-content img[alt],
.message.ai .content img[alt] {
    display: block;
}

/* Image caption (if using figure) */
.ai-content figure,
.message.ai .content figure {
    margin: 1em 0;
    text-align: center;
}

.ai-content figcaption,
.message.ai .content figcaption {
    font-size: 0.875em;
    color: var(--muted-color);
    margin-top: 0.5em;
    font-style: italic;
}

/* ===================================== */
/* KEYBOARD KEYS                         */
/* ===================================== */

.ai-content kbd,
.message.ai .content kbd {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-family: var(--font-mono, monospace);
    font-size: 0.85em;
    color: var(--content-text);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* ===================================== */
/* ABBREVIATIONS                         */
/* ===================================== */

.ai-content abbr[title],
.message.ai .content abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

/* ===================================== */
/* SUBSCRIPT / SUPERSCRIPT               */
/* ===================================== */

.ai-content sub,
.ai-content sup,
.message.ai .content sub,
.message.ai .content sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.ai-content sup {
    top: -0.5em;
}

.ai-content sub {
    bottom: -0.25em;
}

/* ===================================== */
/* DEFINITION LISTS                      */
/* ===================================== */

.ai-content dl,
.message.ai .content dl {
    margin: 1em 0;
}

.ai-content dt,
.message.ai .content dt {
    font-weight: 600;
    color: var(--heading3-color);
    margin-top: 0.75em;
}

.ai-content dd,
.message.ai .content dd {
    margin-left: 1.5em;
    color: var(--paragraph-color);
}

/* ===================================== */
/* FOOTNOTES                             */
/* ===================================== */

.ai-content .footnote-ref,
.message.ai .content .footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    color: var(--link-color);
}

.ai-content .footnotes,
.message.ai .content .footnotes {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--hr-color);
    font-size: 0.9em;
    color: var(--muted-color);
}

/* ===================================== */
/* UTILITY CLASSES                       */
/* ===================================== */

.text-muted {
    color: var(--muted-color);
}

.text-small {
    font-size: 0.875em;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* ===================================== */
/* RESPONSIVE ADJUSTMENTS                */
/* ===================================== */

@media (max-width: 768px) {
    .ai-content,
    .message.ai .content,
    .grid-message-content {
        font-size: 14px;
    }

    .ai-content h1 {
        font-size: 1.5em;
    }

    .ai-content h2 {
        font-size: 1.25em;
    }

    .ai-content h3 {
        font-size: 1.1em;
    }

    .code-block pre,
    .code-block-wrapper pre {
        font-size: 12px;
        padding: 12px;
    }

    .ai-content table,
    .message.ai .content table {
        font-size: 13px;
    }

    .ai-content table th,
    .ai-content table td,
    .message.ai .content table th,
    .message.ai .content table td {
        padding: 8px 10px;
    }
}

/* ===================================== */
/* PRINT STYLES                          */
/* ===================================== */

@media print {
    .ai-content,
    .message.ai .content,
    .grid-message-content {
        color: var(--bg-base);
        background: var(--text-primary);
    }

    .ai-content a {
        color: var(--bg-base);
        text-decoration: underline;
    }

    .ai-content a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    .code-block-copy,
    .code-copy-btn {
        display: none;
    }

    .ai-content table {
        border: 1px solid var(--bg-base);
    }

    .ai-content table th,
    .ai-content table td {
        border: 1px solid var(--bg-base);
    }
}

/* ===================================== */
/* TYPING INDICATOR - Streaming Status   */
/* ===================================== */

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(99, 148, 255, 0.1);
    border-radius: 8px;
    color: var(--muted-color);
    font-size: 14px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
