/* Structured writing uses the incumbent reading measure, palette and controls. */
.answer-prose { white-space:normal; overflow-wrap:anywhere; min-width:0; max-width:72ch; line-height:1.8 }
.answer-prose>:first-child { margin-top:0 }
.answer-prose>:last-child { margin-bottom:0 }
.answer-prose p { margin:0 0 16px }
.answer-prose h1,.answer-prose h2,.answer-prose h3,.answer-prose h4,.answer-prose h5,.answer-prose h6 { font-family:var(--font); font-weight:650; letter-spacing:-.02em; line-height:1.35; margin:30px 0 12px; text-wrap:balance; color:var(--ink) }
.answer-prose h1,.answer-prose h2 { font-size:1.3rem }
.answer-prose h3 { font-size:1.1rem }
.answer-prose h4,.answer-prose h5,.answer-prose h6 { font-size:1rem }
.answer-prose strong { font-weight:650 }
.answer-prose ul,.answer-prose ol { padding-left:24px; margin:14px 0 22px }
.answer-prose ul { list-style-type:disc }
.answer-prose ol { list-style-type:decimal }
.answer-prose li { padding-left:4px; margin:5px 0 }
.answer-prose li p { margin:5px 0 }
.answer-prose li>ul,.answer-prose li>ol { margin:7px 0 }
.answer-prose blockquote { margin:22px 0; border-inline-start:1px solid var(--muted); padding:2px 0 2px 20px; color:var(--muted); font-size:inherit }
.answer-prose blockquote>:last-child { margin-bottom:0 }
.answer-prose a:not(.citation) { color:var(--accent); text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px }
.answer-prose :not(pre)>code,.rich-editor :not(pre)>code { background:var(--surface-2); padding:2px 5px; border-radius:4px; color:var(--ink); font-size:.88em; font-family:ui-monospace,monospace }
.answer-prose hr { margin:26px 0; border:0; border-top:1px solid var(--line) }
.answer-prose .answer-artifact { margin:18px 0; max-width:100%; overflow:hidden }
.answer-prose .answer-artifact pre { margin:0; padding:17px; white-space:pre; overflow-x:auto; font-size:.83rem; line-height:1.7; max-height:480px; color:var(--ink); background:transparent; tab-size:2 }
.answer-prose .answer-artifact pre code { font-family:ui-monospace,monospace; background:none; color:inherit; border:0; padding:0; font-size:inherit }
.answer-prose .artifact-toolbar { font-size:.73rem; line-height:1.5 }
.answer-prose .artifact-toolbar button { min-height:32px; padding:5px 8px }
.prose-table { max-width:100%; overflow-x:auto; margin:20px 0 24px; border:1px solid var(--line); border-radius:8px; scrollbar-color:var(--line) transparent }
.prose-table table { border-collapse:collapse; width:100%; min-width:430px; font-size:.85rem; line-height:1.6; font-variant-numeric:tabular-nums }
.prose-table th,.prose-table td { text-align:left; padding:12px 15px; border-bottom:1px solid var(--line); vertical-align:top }
.prose-table th { font-weight:600; background:var(--surface-2) }
.prose-table tr:last-child td { border-bottom:0 }
.prose-table:focus-visible { outline:2px solid var(--accent); outline-offset:4px }
.message-user .answer-prose { font-size:inherit }
.message-user .answer-prose p { margin-bottom:10px }
.message-user .answer-prose .answer-artifact { background:var(--surface) }
.draft-content.answer-prose { white-space:normal }
.rich-original { display:none!important }
.rich-writing { min-width:0; width:100%; border:1px solid var(--line); border-radius:8px; padding:8px 12px 6px; background:var(--surface); color:var(--ink) }
.rich-writing--chat { border:0; background:none; padding:0 }
.writing-tools { display:flex; align-items:center; gap:3px; flex-wrap:wrap; padding-bottom:6px }
.writing-tools button { width:32px; min-width:32px; min-height:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; border:0; background:transparent; color:var(--muted); padding:7px; border-radius:6px; transform:none; transition:none }
.writing-tools button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round }
.writing-tools button[aria-pressed=true] { color:var(--accent); background:var(--accent-soft) }
.writing-tools button:disabled { opacity:.45; cursor:not-allowed }
.writing-tools button:focus-visible { outline:2px solid var(--accent); outline-offset:2px }
.rich-editor { position:relative; min-height:130px; max-height:380px; overflow-y:auto; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; padding:8px 4px 14px; outline:none; font-size:.95rem; scrollbar-color:var(--line) transparent; cursor:text }
.rich-writing--chat .rich-editor { min-height:60px; max-height:180px; padding:5px 5px 10px }
.rich-editor:focus-visible { outline:none }
.composer:has(.rich-editor:focus-visible),.rich-writing:not(.rich-writing--chat):has(.rich-editor:focus-visible) { outline:2px solid var(--accent); outline-offset:-1px; border-color:transparent }
.writing-toggle[aria-expanded=true] { color:var(--accent); background:var(--accent-soft) }
.writing-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round }
.rich-editor[data-empty=true]::before { content:attr(data-placeholder); position:absolute; pointer-events:none; color:var(--subtle); white-space:normal }
.rich-editor p { margin:0 0 10px; min-height:1.65em }
.rich-editor p:last-child { margin-bottom:0 }
.rich-editor ul,.rich-editor ol { margin:6px 0; padding-left:25px; list-style:revert }
.rich-editor li { margin:3px 0; padding-left:3px }
.rich-editor li p { margin:0 }
.rich-editor h1,.rich-editor h2,.rich-editor h3 { font:650 1.1rem/1.45 var(--font); margin:12px 0 8px }
.rich-editor blockquote { margin:10px 0; padding:2px 0 2px 14px; border-inline-start:1px solid var(--muted); color:var(--muted) }
.rich-editor pre { padding:12px 14px; margin:8px 0; border-radius:8px; background:var(--surface-2); color:var(--ink); font:.83rem/1.7 ui-monospace,monospace; white-space:pre; overflow-x:auto; tab-size:2 }
.rich-editor pre>code { color:inherit; background:none; font:inherit }
.rich-editor a { color:var(--accent); text-decoration:underline }
.rich-editor table { border-collapse:collapse; min-width:430px; max-width:100%; font-size:.85rem; line-height:1.7; margin:14px 0; white-space:normal }
.rich-editor th,.rich-editor td { padding:9px 12px; border:1px solid var(--line); min-width:95px; vertical-align:top; position:relative }
.rich-editor th { background:var(--surface-2); font-weight:600 }
.rich-editor .selectedCell { background:var(--accent-soft) }
.rich-editor .tableWrapper { overflow-x:auto; max-width:100% }
.writing-hint { margin:3px 4px 8px!important; font-size:.67rem!important; color:var(--muted); line-height:1.5; font-weight:400 }
.rich-writing--chat:has(.writing-tools[hidden]) .writing-hint { display:none }
@media(hover:hover) and (pointer:fine) { .writing-tools button:hover:not(:disabled) { background:var(--surface-2); color:var(--ink) } }
@media(max-width:760px) {
 .writing-tools { gap:2px; padding-bottom:3px }
 .writing-tools button { width:44px; min-width:44px; height:44px; min-height:44px; padding:12px }
 .rich-editor { font-size:1rem }
 .rich-writing--chat .rich-editor { min-height:49px; max-height:155px }
 .writing-hint { font-size:.65rem!important; margin-bottom:6px!important }
 .rich-writing--chat .writing-hint { display:none }
 .answer-prose .artifact-toolbar button { min-height:44px }
 .prose-table th,.prose-table td { padding:10px 12px }
}
