.chat-view { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.message-scroll { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; overscroll-behavior: contain; }
.messages { width: min(100%,848px); margin: 0 auto; padding: 36px 24px 24px; }
.empty-chat { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; width: min(100%,800px); margin: 0 auto; padding: 32px 24px 8vh; }
.empty-chat .brand-mark { margin-bottom: 28px; width: 32px; height: 30px; }
.empty-chat h1 { font-size: 28px; font-weight: 550; margin-bottom: 12px; }
.empty-chat p { color: var(--text-muted); font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.empty-chat .empty-meta { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); width: min(320px,100%); font-size: 12px; color: var(--text-secondary); }
.message { margin-bottom: 32px; min-width: 0; }
.message.user { display: flex; flex-direction: column; align-items: flex-end; }
.user .message-content { max-width: 82%; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--accent-08); padding: 13px 18px; border-radius: 14px 14px 3px 14px; font-size: 15px; }
.assistant .message-content { line-height: 1.78; font-size: 16px; color: var(--text-strong); overflow-wrap: anywhere; }
.message-label { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.message-label .small-trace { display: inline-block; width: 16px; height: 1px; background: var(--accent); }
.message-actions { display: flex; align-items: center; margin-top: 9px; gap: 2px; color: var(--text-muted); }
.message-actions .icon-button { color: var(--text-muted); }
.message-state { font-size: 12px; margin-left: 6px; }
.message-content>:first-child { margin-top: 0; }
.message-content>:last-child { margin-bottom: 0; }
.message-content p { margin-bottom: 16px; }
.message-content h1 { font-size: 24px; margin-top: 28px; }
.message-content h2 { font-size: 21px; margin-top: 26px; }
.message-content h3 { font-size: 18px; margin-top: 24px; }
.message-content ul,.message-content ol { padding-left: 24px; }
.message-content li { padding-left: 2px; margin: 5px 0; }
.message-content blockquote { margin: 20px 0; padding-left: 18px; border-left: 2px solid var(--line-strong); color: var(--text-secondary); }
.message-content code { font-family: var(--mono); font-size: .88em; background: var(--bg-soft); padding: 2px 5px; border: 1px solid var(--line-faint); border-radius: 4px; }
.message-content pre { position: relative; margin: 20px 0; border: 1px solid var(--line); background: var(--bg-raised); border-radius: var(--radius-md); overflow: hidden; max-width: 100%; }
.message-content pre>code { display: block; padding: 16px; overflow-x: auto; white-space: pre; border: 0; border-radius: 0; background: transparent; font-size: 13px; line-height: 1.7; }
.code-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-faint); padding: 0 6px 0 16px; font-family: var(--font); font-size: 12px; color: var(--text-muted); height: 44px; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 20px 0; }
.message-content table { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.message-content th,.message-content td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.message-content th { background: var(--bg-soft); font-weight: 600; }
.plain-fallback { white-space: pre-wrap; }
.message.generating .message-content::after { content: ''; display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 4px; vertical-align: -.12em; }
.composer-area { padding: 12px 24px max(16px,env(safe-area-inset-bottom)); background: var(--bg); flex-shrink: 0; }
.composer { width: min(100%,840px); margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 10px 10px 18px; display: flex; gap: 12px; align-items: flex-end; background: var(--bg-raised); }
.composer:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 4px var(--accent-04); }
.composer textarea { border: 0; box-shadow: none; background: transparent; padding: 10px 0; min-height: 44px; height: 44px; max-height: 208px; resize: none; overflow-y: auto; line-height: 24px; }
.send-button { width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent); color: var(--bg-deep); flex-shrink: 0; }
.send-button:disabled { background: var(--bg-soft); color: var(--text-disabled); opacity: 1; border: 1px solid var(--line-faint); }
.composer-foot { width: min(100%,810px); margin: 10px auto 0; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--text-muted); }
.to-bottom { position: absolute; bottom: 12px; right: 28px; background: var(--bg-soft); box-shadow: var(--shadow-soft); border: none; border-radius: 50%; color: var(--text); z-index: 2; }
.scroll-wrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.connection-required { padding: 16px 24px; text-align: center; font-size: 14px; color: var(--text-secondary); }
.empty-chat { padding-left: 28px; padding-bottom: 12vh; }
.empty-chat h1 { font-size: clamp(25px,2.1vw,30px); line-height: 1.5; }
.empty-chat .empty-meta { border-top: none; border-left: 1px solid var(--line-strong); padding: 2px 0 2px 15px; width: auto; line-height: 1.9; margin-top: 23px; }
.message-label { margin-bottom: 14px; font-size: 12px; gap: 10px; }
.message-label .small-trace { width: 18px; transform: rotate(-18deg); transform-origin: left center; }
.composer { box-shadow: inset 0 1px 0 var(--bg-hover); }
.composer:focus-within { box-shadow: 0 0 0 4px var(--accent-04),inset 0 1px 0 var(--bg-hover); }
.composer-foot { align-items: center; min-height: 24px; margin-top: 8px; }
.composer-foot>[data-chat-settings] { min-height: 44px; padding: 2px 0 2px 10px; border-left: 1px solid var(--line-faint); }
