/* Flat conversation surface; all rules scoped to chat. */
body.chat-page{background:#f2f5f1;display:flex;flex-direction:column}
body.chat-page>header{height:auto;min-height:0;width:100%;max-width:1320px;margin:0 auto;padding:30px 32px 20px;flex-shrink:0}
body.chat-page .app-status{width:calc(100% - 40px);margin:0 auto;flex-shrink:0}
main.page-chat{width:100%;max-width:1320px;height:auto;min-height:0;flex:1;padding:0 32px 32px}
.chat-page .chat-view{max-width:none;border:1px solid #dde7df;border-radius:16px;background:#fff;box-shadow:none}
.chat-page .chat-top{padding:14px 24px 8px;min-height:48px;border:0}
.chat-page .chat-top #chat-model{font-size:12px;color:#8a8a8a}
.chat-page .chat-top button{color:#777}
.chat-page .chat-top button:hover{background:#f4f4f4;color:#222}
.chat-page #chat-messages{padding:24px max(24px,calc((100% - 760px)/2)) 30px;gap:32px;scrollbar-gutter:auto}
.chat-page #chat-empty{color:#353535;font-size:24px;font-weight:500;letter-spacing:0}
.chat-page .chat-message{position:relative;flex-shrink:0}
.chat-page .chat-message.assistant{padding:0;background:none;border:0}
.chat-page .message-role{margin-bottom:12px;line-height:1}
.chat-page .message-role .icon{width:21px;height:21px;color:#737373}
.chat-page .chat-message.user{max-width:85%;padding:12px 18px;background:#f3f3f3;border:0;border-radius:22px;color:#262626}
.chat-page .chat-message .message-body{font-size:15px;line-height:1.85;color:#292929}
.chat-page .message-actions{margin-top:8px;gap:6px;color:#929292}
.chat-page .message-actions button{color:#929292}
.chat-page .message-actions button:hover{background:#f2f2f2;color:#333}
.chat-page .message-actions .icon{width:16px;height:16px}
.chat-page .chat-message.user .message-actions{position:static;margin-top:8px;opacity:1;justify-content:flex-start}
.chat-page .message-actions button.icon-button{width:34px;height:34px;padding:7px}

.chat-page .generating .message-actions span::before{background:#555}
.chat-page #chat-form{width:min(808px,100%);align-self:center;padding:8px 24px 22px;background:#fff}
.chat-page .composer{border:1px solid #e8e8e8;border-radius:24px;background:#f6f6f6;box-shadow:none}
.chat-page .composer:focus-within{border-color:#d2d2d2;box-shadow:none}
.chat-page #chat-input{min-height:58px;padding:16px 20px 4px;font-size:15px;color:#262626}
.chat-page #chat-input::placeholder{color:#969696}
.chat-page .composer-bottom{padding:4px 12px 10px 20px}
.chat-page .composer-hint{font-size:11px;color:#a0a0a0}
.chat-page .composer-bottom #send-chat{border-radius:50%;width:34px;height:34px;background:#252525;color:#fff}
.chat-page .composer-bottom #send-chat:disabled{background:#dfdfdf;color:#fff;opacity:1}
.chat-page #stop-chat{background:#e7e7e7;color:#444}
.chat-page #chat-bottom{width:34px;height:34px;padding:7px;border-radius:50%;background:white;border:1px solid #e4e4e4;color:#555;box-shadow:0 2px 6px #00000008}
.chat-page .markdown h1,.chat-page .markdown h2,.chat-page .markdown h3,.chat-page .markdown h4{color:#222;font-weight:600;letter-spacing:0;margin-top:26px;margin-bottom:12px}
.chat-page .markdown>:first-child{margin-top:0}
.chat-page .markdown h1{font-size:23px}.chat-page .markdown h2{font-size:20px}.chat-page .markdown h3{font-size:17px}
.chat-page .markdown p{margin-bottom:16px}
.chat-page .markdown strong{font-weight:600}
.chat-page .markdown li{margin:5px 0}.chat-page .markdown li>p{margin:0}
.chat-page .markdown blockquote{background:none;border-left:3px solid #d5d5d5;border-radius:0;color:#707070;padding:2px 16px}
.chat-page .markdown a{color:#366ca7}
.chat-page .markdown hr{border-color:#e8e8e8}
.chat-page .markdown :not(pre)>code{color:#333;background:#f0f0f0;border-radius:4px;padding:2px 5px}
.chat-page .md-table{border:0;border-radius:0;margin:20px 0}
.chat-page .markdown table{font-size:14px}
.chat-page .markdown th{background:none;color:#333;border-bottom:1px solid #cfcfcf}
.chat-page .markdown th,.chat-page .markdown td{padding:11px 14px;border-color:#e5e5e5}
.chat-page .markdown tr:last-child td{border-bottom:1px solid #e5e5e5}
.chat-page .code-block{border:0;border-radius:10px;background:#202123;margin:20px 0}
.chat-page .code-toolbar{background:#2c2d30;color:#c3c3c3;padding:7px 14px}
.chat-page .markdown .code-block pre{background:#202123;color:#e8e8e8;font-size:13px;line-height:1.7;padding:18px}
.chat-page .code-toolbar button{color:#bbb}
.chat-page .markdown del{color:#909090}

@media(max-width:600px){
 .chat-page .chat-top{padding:12px 16px 6px;min-height:42px}
 .chat-page #chat-messages{padding:18px 18px 28px;gap:30px}
 .chat-page #chat-form{padding:6px 12px 12px}
 .chat-page .chat-message.user{max-width:90%;padding:10px 15px}
 .chat-page .chat-message .message-body{font-size:15px}
 .chat-page .composer{border-radius:22px}
}

@media(max-width:850px){body.chat-page>header{padding:24px 18px}main.page-chat{padding:0 14px 14px}}

main.page-chat{display:flex;flex-direction:column;gap:0}
.chat-page article.chat-view{flex:1;min-height:0;height:auto;width:100%}
.chat-page header.page-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;width:100%;height:auto;min-height:0;max-width:none;margin:0 0 20px;padding:16px 22px;border:1px solid #dde7df;border-radius:14px;flex-shrink:0;overflow:visible}
.chat-page header.page-toolbar h2{font-size:16px;color:#213b35;margin:0}
@media(max-width:850px){.chat-page header.page-toolbar{padding:14px 18px}}

/* Use the same outer spacing and toolbar actions on all three pages. */
body>header,body.chat-page>header{width:100%;max-width:1320px;height:auto;min-height:0;margin:0 auto;padding:22px 32px 18px}
main,main.page-chat{width:100%;max-width:1320px;margin:0 auto;padding:0 32px 32px}
.chat-page .chat-top #clear-chat{font:inherit;padding:10px 14px;background:#eaf1eb;color:#39654f;border-radius:8px;flex-shrink:0;white-space:nowrap}
.chat-page .chat-top #clear-chat:hover{background:#e2ece4;color:#39654f}
@media(max-width:850px){body>header,body.chat-page>header{padding:24px 18px}main,main.page-chat{padding:0 14px 14px}}

body .app-status,body.chat-page .app-status{position:fixed;top:24px;left:50%;transform:translateX(-50%);z-index:1000;width:max-content;max-width:calc(100% - 32px);margin:0;padding:12px 20px;border:1px solid #efd8cf;border-radius:12px;background:#fff6f2;color:#a64d3e;box-shadow:0 6px 24px #41281d14;overflow-wrap:anywhere;pointer-events:none}

body .app-status[data-kind="success"]{background:#f2faf5;border-color:#d5e6da;color:#39654f}
