﻿/* Chat Components v0.1.0 */
:root{--chat-bg:#f9fafb;--chat-user-bg:#f5f5f4;--chat-user-border:#e7e5e4;--chat-assistant-bg:transparent;--chat-system-bg:#fef3c7;--chat-debug-bg:#f3f4f6;--chat-border:#e5e7eb;--chat-text:#1a1a1a;--chat-text-secondary:#6b7280;--chat-text-muted:#9ca3af;--chat-accent:#d97706;--chat-accent-hover:#b45309;--chat-code-bg:#fafafa;--chat-code-border:#e5e7eb;--chat-code-header-bg:#f5f5f5;--chat-code-text:#1a1a1a;--chat-inline-code-bg:rgba(0,0,0,.06);--chat-inline-code-text:#b45309;--chat-link-color:#b45309;--chat-shadow:0 1px 2px rgba(0,0,0,.05);--chat-radius:16px;--chat-radius-sm:8px;--chat-spacing:24px;--chat-max-width:800px;--chat-user-max-width:85%;--chat-font-size:16px;--chat-line-height:1.7;--chat-transition:150ms ease;--chat-user-collapse-height:300px}[data-theme="dark"]{--chat-bg:#1a1a1a;--chat-user-bg:#2a2a2a;--chat-user-border:#3a3a3a;--chat-assistant-bg:transparent;--chat-system-bg:#422006;--chat-debug-bg:#262626;--chat-border:#3a3a3a;--chat-text:#f5f5f5;--chat-text-secondary:#a1a1aa;--chat-text-muted:#71717a;--chat-accent:#f59e0b;--chat-accent-hover:#fbbf24;--chat-code-bg:#262626;--chat-code-border:#3a3a3a;--chat-code-header-bg:#2a2a2a;--chat-code-text:#e5e5e5;--chat-inline-code-bg:rgba(255,255,255,.1);--chat-inline-code-text:#fbbf24;--chat-link-color:#fbbf24;--chat-shadow:0 1px 2px rgba(0,0,0,.3)}chat-log{display:flex;flex-direction:column;flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--chat-spacing);scroll-behavior:smooth}chat-log .messages-container{display:flex;flex-direction:column;gap:32px;max-width:var(--chat-max-width);width:100%;margin:0 auto;padding-bottom:24px}chat-log .empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;text-align:center;color:var(--chat-text-muted);padding:48px 24px}chat-log .empty-state-icon{width:64px;height:64px;margin-bottom:16px;opacity:.5}chat-log .empty-state h2{font-size:20px;font-weight:600;color:var(--chat-text-secondary);margin-bottom:8px}chat-log .empty-state p{font-size:14px;max-width:320px}chat-log .message{display:flex;flex-direction:column;animation:messageSlideIn .3s ease-out}@keyframes messageSlideIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}chat-log .message-header{display:none}chat-log .message-content{font-size:var(--chat-font-size);line-height:var(--chat-line-height);color:var(--chat-text);position:relative}chat-log .message.user{align-items:flex-end}chat-log .message.user .message-content{background:var(--chat-user-bg);border:1px solid var(--chat-user-border);border-radius:var(--chat-radius);padding:16px 20px;max-width:var(--chat-user-max-width)}chat-log .message.user .message-content.is-collapsed .message-body{max-height:var(--chat-user-collapse-height);overflow:hidden;position:relative}chat-log .message.user .message-content.is-collapsed .message-body::after{content:'';position:absolute;bottom:0;left:0;right:0;height:80px;background:linear-gradient(to bottom,transparent,var(--chat-user-bg));pointer-events:none}chat-log .message.user .show-more-btn{display:block;width:100%;padding:12px 0 0;margin-top:4px;background:transparent;border:0;border-top:1px solid var(--chat-user-border);font-size:13px;font-weight:500;color:var(--chat-text-secondary);cursor:pointer;text-align:center}chat-log .message.user .show-more-btn:hover{color:var(--chat-accent)}chat-log .message.assistant .message-content{background:transparent;padding:0;border:0}chat-log .message.system .message-header,chat-log .message.debug .message-header,chat-log .message.tool .message-header{display:flex;align-items:center;gap:8px;margin-bottom:8px}chat-log .message-avatar{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:#fff}chat-log .message.system .message-avatar{background:linear-gradient(135deg,#059669,#10b981)}chat-log .message.debug .message-avatar{background:linear-gradient(135deg,#6b7280,#9ca3af)}chat-log .message.tool .message-avatar{background:linear-gradient(135deg,#7c3aed,#a78bfa)}chat-log .message-role{font-size:12px;font-weight:600;color:var(--chat-text-secondary);text-transform:uppercase;letter-spacing:.025em}chat-log .message-meta{font-size:11px;color:var(--chat-text-muted);margin-left:auto}chat-log .message.system .message-content{background:var(--chat-system-bg);border:1px solid #fde68a;border-radius:var(--chat-radius-sm);padding:12px 16px;font-size:13px}chat-log .message.debug .message-content{background:var(--chat-debug-bg);border:1px solid var(--chat-border);border-radius:var(--chat-radius-sm);padding:12px 16px;font-size:13px;font-family:'SF Mono',Monaco,'Courier New',monospace}chat-log .message.tool .message-content{background:#f5f3ff;border:1px solid #ddd6fe;border-radius:var(--chat-radius-sm);padding:12px 16px;font-size:13px}chat-log:not([debug-mode="true"]) .message.system,chat-log:not([debug-mode="true"]) .message.debug,chat-log:not([debug-mode="true"]) .message.tool{display:none}chat-log .message-actions{display:flex;gap:4px;margin-top:12px;opacity:0;transition:opacity var(--chat-transition)}chat-log .message.user .message-actions{justify-content:flex-end}chat-log .message:hover .message-actions{opacity:1}chat-log .message-action-btn{display:flex;align-items:center;justify-content:center;gap:4px;padding:6px 8px;background:transparent;border:0;border-radius:6px;font-size:12px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}chat-log .message-action-btn:hover{background:rgba(0,0,0,.05);color:var(--chat-text-secondary)}chat-log .message-action-btn.copied{color:#059669}chat-log .message-action-btn span{display:none}chat-log .message-action-btn:hover span{display:inline}chat-log .streaming-cursor{display:inline-block;width:2px;height:1.1em;background:var(--chat-accent);margin-left:2px;animation:cursorBlink 1s step-end infinite;vertical-align:text-bottom}@keyframes cursorBlink{50%{opacity:0}}chat-log .jump-to-bottom{position:sticky;bottom:16px;align-self:center;display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding-top:10px;padding-bottom:10px;background:var(--chat-code-bg);border:1px solid var(--chat-border);border-radius:50%;box-shadow:var(--chat-shadow);color:var(--chat-text-secondary);cursor:pointer;opacity:0;visibility:hidden;transform:translateY(10px);transition:all var(--chat-transition)}chat-log .jump-to-bottom span{display:none}chat-log .jump-to-bottom.visible{opacity:1;visibility:visible;transform:translateY(0)}chat-log .jump-to-bottom:hover{background:var(--chat-user-bg);border-color:var(--chat-text-muted);color:var(--chat-text)}chat-log .message-content p{margin:0 0 16px 0}chat-log .message-content p:last-child{margin-bottom:0}chat-log .message-content h1,chat-log .message-content h2,chat-log .message-content h3,chat-log .message-content h4{margin:28px 0 12px 0;font-weight:600;line-height:1.3;color:var(--chat-text)}chat-log .message-content h1:first-child,chat-log .message-content h2:first-child,chat-log .message-content h3:first-child{margin-top:0}chat-log .message-content h1{font-size:1.5em}chat-log .message-content h2{font-size:1.25em}chat-log .message-content h3{font-size:1.1em}chat-log .message-content h4{font-size:1em}chat-log .message-content ul,chat-log .message-content ol{margin:16px 0;padding-left:24px}chat-log .message-content li{margin:8px 0}chat-log .message-content li>p{margin-bottom:8px}chat-log .message-content a{color:var(--chat-link-color);text-decoration:underline;text-decoration-color:rgba(180,83,9,.3);text-underline-offset:2px;transition:text-decoration-color var(--chat-transition)}chat-log .message-content a:hover{text-decoration-color:var(--chat-link-color)}chat-log .message-content strong{font-weight:600;color:var(--chat-text)}chat-log .message-content blockquote{margin:16px 0;padding:2px 0 2px 20px;border-left:3px solid var(--chat-border);color:var(--chat-text-secondary)}chat-log .message-content blockquote p:last-child{margin-bottom:0}chat-log .message-content code{padding:2px 6px;background:var(--chat-inline-code-bg);border-radius:4px;font-family:'SF Mono',Monaco,'Courier New',monospace;font-size:.875em;color:var(--chat-inline-code-text)}chat-log .message-content pre{margin:20px 0;padding:0;background:var(--chat-code-bg);border:1px solid var(--chat-code-border);border-radius:var(--chat-radius-sm);overflow:hidden}chat-log .message-content pre.hljs{padding:0;background:var(--chat-code-bg)}chat-log .message-content pre code,chat-log .message-content pre.hljs code{display:block;padding:16px;background:transparent;color:var(--chat-code-text);font-size:13px;line-height:1.6;overflow-x:auto;border-radius:0}chat-log .code-block-header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;background:var(--chat-code-header-bg);border-bottom:1px solid var(--chat-code-border)}chat-log .code-block-lang{font-size:12px;font-weight:500;color:var(--chat-text-secondary);text-transform:lowercase}chat-log .code-copy-btn{display:flex;align-items:center;gap:4px;padding:4px 10px;background:transparent;border:0;border-radius:4px;font-size:12px;color:var(--chat-text-secondary);cursor:pointer;transition:all var(--chat-transition)}chat-log .code-copy-btn:hover{background:rgba(0,0,0,.05);color:var(--chat-text)}chat-log .code-copy-btn.copied{color:#059669}chat-log .message-content table{width:100%;margin:16px 0;border-collapse:collapse;font-size:14px}chat-log .message-content th,chat-log .message-content td{padding:10px 12px;text-align:left;border:1px solid var(--chat-border)}chat-log .message-content th{background:var(--chat-inline-code-bg);font-weight:600}chat-log .message-content hr{margin:20px 0;border:0;border-top:1px solid var(--chat-border)}chat-log .message-image{margin:12px 0;display:inline-block}chat-log .message-image img{max-width:300px;max-height:300px;border-radius:var(--chat-radius-sm);cursor:pointer;transition:transform var(--chat-transition)}chat-log .message-image img:hover{transform:scale(1.02)}chat-log .message-image-actions{display:flex;gap:8px;margin-top:8px}.chat-image-lightbox{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.chat-image-lightbox.open{opacity:1;visibility:visible}.chat-image-lightbox .lightbox-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.85);cursor:pointer}.chat-image-lightbox .lightbox-content{position:relative;max-width:90vw;max-height:90vh;display:flex;flex-direction:column;align-items:center;gap:16px}.chat-image-lightbox .lightbox-content img{max-width:90vw;max-height:calc(90vh - 60px);object-fit:contain;border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,.3)}.chat-image-lightbox .lightbox-actions{display:flex;gap:12px}.chat-image-lightbox .lightbox-btn{display:flex;align-items:center;gap:6px;padding:10px 16px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.2);border-radius:8px;color:#fff;font-size:14px;cursor:pointer;transition:all var(--chat-transition)}.chat-image-lightbox .lightbox-btn:hover{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.3)}chat-log .special-block{margin:20px 0;border:1px solid var(--chat-code-border);border-radius:var(--chat-radius-sm);overflow:hidden;background:var(--chat-code-bg)}chat-log .special-block-header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;background:var(--chat-code-header-bg);border-bottom:1px solid var(--chat-code-border)}chat-log .special-block-label{font-size:12px;font-weight:500;color:var(--chat-text-secondary)}chat-log .special-block-tabs{display:flex;gap:4px}chat-log .special-block-tab{padding:4px 12px;background:transparent;border:1px solid transparent;border-radius:4px;font-size:12px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}chat-log .special-block-tab:hover{color:var(--chat-text-secondary);background:rgba(0,0,0,.05)}chat-log .special-block-tab.active{color:var(--chat-text);background:var(--chat-bg);border-color:var(--chat-code-border)}chat-log .special-block-content{position:relative}chat-log .special-block-rendered{padding:16px}chat-log .special-block-code{padding:0}chat-log .special-block-code pre{margin:0;border:0;border-radius:0}chat-log .mermaid-container{display:flex;justify-content:center;align-items:center;min-height:100px}chat-log .mermaid-container svg{max-width:100%;height:auto}chat-log .mermaid-loading{color:var(--chat-text-muted);font-size:14px}chat-log .mermaid-error{padding:16px;background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3);border-radius:6px;color:#dc2626;font-size:13px}chat-log .mermaid-error p{margin:0 0 8px 0}chat-log .mermaid-error p:last-child{margin-bottom:0}chat-log .markdown-doc-rendered{font-size:14px;line-height:1.6}chat-log .markdown-doc-rendered>*:first-child{margin-top:0}chat-log .markdown-doc-rendered>*:last-child{margin-bottom:0}chat-log .markdown-doc-rendered pre{margin:12px 0;font-size:12px}[data-theme="dark"] chat-log .special-block-tab.active{background:var(--chat-code-bg)}[data-theme="dark"] chat-log .mermaid-error{background:rgba(239,68,68,.15);color:#f87171}chat-log .html-container iframe{width:100%;height:400px;border:0;display:block;background:#fff}chat-log .html-loading{padding:16px;color:var(--chat-text-muted);font-size:14px}chat-log .html-error{padding:16px;background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3);border-radius:6px;color:#dc2626;font-size:13px}chat-log .html-error p{margin:0 0 8px 0}chat-log .html-error p:last-child{margin-bottom:0}chat-log .html-block-download-btn{display:flex;align-items:center;gap:4px;padding:4px 10px;background:transparent;border:1px solid transparent;border-radius:4px;font-size:12px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition);margin-left:4px}chat-log .html-block-download-btn:hover{background:rgba(0,0,0,.05);border-color:var(--chat-code-border);color:var(--chat-text-secondary)}[data-theme="dark"] chat-log .html-error{background:rgba(239,68,68,.15);color:#f87171}[data-theme="dark"] chat-log .html-block-download-btn:hover{background:rgba(255,255,255,.05)}chat-log .file-reference{display:flex;flex-direction:column;gap:0;background:var(--chat-code-bg);border:1px solid var(--chat-code-border);border-radius:var(--chat-radius-sm);margin:16px 0;overflow:hidden}chat-log .file-reference-main{display:flex;align-items:center;gap:12px;padding:12px 16px}chat-log .file-reference-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;color:var(--chat-text-secondary);flex-shrink:0}chat-log .file-reference-info{flex:1;min-width:0}chat-log .file-reference-name{font-weight:500;font-size:14px;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}chat-log .file-reference-meta{font-size:12px;color:var(--chat-text-muted);margin-top:2px}chat-log .file-reference-actions{display:flex;gap:4px}chat-log .file-ref-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:6px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}chat-log .file-ref-btn:hover{background:var(--chat-inline-code-bg);color:var(--chat-text)}chat-log .file-reference.expanded .file-ref-preview-btn{transform:rotate(-90deg)}chat-log .file-reference-thumbnail{padding:8px 16px 12px}chat-log .file-reference-thumbnail img{max-width:200px;max-height:150px;border-radius:4px}chat-log .file-reference-preview{border-top:1px solid var(--chat-code-border);max-height:300px;overflow:auto}chat-log .file-preview-content{padding:0}chat-log .file-preview-content pre{margin:0;border:0;border-radius:0}chat-log .file-preview-content pre code{font-size:12px}chat-log .file-preview-loading{padding:24px;text-align:center;color:var(--chat-text-muted);font-size:13px}chat-log .file-preview-image{max-width:100%;display:block}file-panel{display:none;position:relative;width:340px;min-width:20%;max-width:80%;background:var(--chat-code-bg);border-left:1px solid var(--chat-border);flex-direction:column;overflow:hidden;flex-shrink:0}file-panel.open{display:flex}file-panel .file-panel-resize-handle{position:absolute;left:0;top:0;bottom:0;width:4px;cursor:col-resize;background:transparent;transition:background var(--chat-transition);z-index:10}file-panel .file-panel-resize-handle:hover{background:var(--chat-accent)}file-panel .file-panel-container{display:flex;flex-direction:column;height:100%;overflow:hidden}file-panel .file-panel-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--chat-border)}file-panel .file-panel-title{font-size:14px;font-weight:600;color:var(--chat-text);margin:0}file-panel .file-panel-header-actions{display:flex;align-items:center;gap:4px}file-panel .file-panel-refresh-btn,file-panel .file-panel-upload-btn,file-panel .file-panel-close-btn{width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:6px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}file-panel .file-panel-refresh-btn:hover,file-panel .file-panel-upload-btn:hover,file-panel .file-panel-close-btn:hover{background:var(--chat-inline-code-bg);color:var(--chat-text)}file-panel .file-panel-drive-selector{padding:8px 12px;border-bottom:1px solid var(--chat-border);background:var(--chat-code-header-bg)}file-panel .file-panel-drive-dropdown{width:100%;padding:6px 8px;font-size:13px;font-family:inherit;color:var(--chat-text);background:var(--chat-code-bg);border:1px solid var(--chat-border);border-radius:6px;cursor:pointer;outline:0;transition:border-color var(--chat-transition)}file-panel .file-panel-drive-dropdown:hover{border-color:var(--chat-accent)}file-panel .file-panel-drive-dropdown:focus{border-color:var(--chat-accent);box-shadow:0 0 0 2px rgba(217,119,6,.15)}file-panel.read-only-source .file-panel-upload-btn{display:none}file-panel.read-only-source .file-panel-item-action[data-action="delete"]{display:none}file-panel .file-panel-nav{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--chat-border);background:var(--chat-code-header-bg)}file-panel .file-nav-back{width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:4px;color:var(--chat-text-secondary);cursor:pointer;transition:all var(--chat-transition)}file-panel .file-nav-back:hover:not(:disabled){background:var(--chat-inline-code-bg);color:var(--chat-text)}file-panel .file-nav-back:disabled{opacity:.3;cursor:not-allowed}file-panel .file-nav-path{font-size:12px;font-family:'SF Mono',Monaco,'Courier New',monospace;color:var(--chat-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}file-panel .file-panel-content{flex:1;overflow-y:auto;min-height:0}file-panel .file-panel-list{padding:8px}file-panel .file-panel-empty{padding:24px;text-align:center;color:var(--chat-text-muted);font-size:13px}file-panel .file-panel-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:6px;cursor:pointer;transition:background var(--chat-transition)}file-panel .file-panel-item:hover{background:var(--chat-inline-code-bg)}file-panel .file-panel-item.selected{background:var(--chat-inline-code-bg)}file-panel .file-panel-item.is-folder{cursor:pointer}file-panel .file-panel-item.is-folder .file-panel-item-icon{color:var(--chat-accent)}file-panel .file-panel-blob-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}file-panel .blob-status-ready{background-color:#22c55e}file-panel .blob-status-not-ready{background-color:#ef4444}file-panel .file-panel-item-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;color:var(--chat-text-secondary);flex-shrink:0}file-panel .file-panel-item-info{flex:1;min-width:0}file-panel .file-panel-item-name{font-size:13px;font-weight:500;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}file-panel .file-panel-item-meta{font-size:11px;color:var(--chat-text-muted);margin-top:2px}file-panel .file-panel-item-chevron{width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:var(--chat-text-muted);flex-shrink:0}file-panel .file-panel-item-actions{display:flex;align-items:center;gap:2px;flex-shrink:0}file-panel .file-panel-item-action{width:26px;height:26px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:4px;color:var(--chat-text-muted);cursor:pointer;padding:0;transition:all var(--chat-transition)}file-panel .file-panel-item-action:hover{background:var(--chat-inline-code-bg);color:var(--chat-text)}file-panel .file-panel-item-action[data-action="delete"]:hover{color:#e53935;background:rgba(229,57,53,.1)}file-panel .file-panel-item-action.active{color:var(--chat-accent)}file-panel .file-panel-item-action.active:hover{color:var(--chat-accent-hover)}file-panel .file-panel-item-status{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}file-panel .file-panel-item-status.pending{color:var(--chat-accent)}file-panel .file-panel-item-status.error{color:#e53935}file-panel .file-panel-item-progress{height:3px;background:var(--chat-border);border-radius:2px;margin-top:4px;overflow:hidden}file-panel .file-panel-item-progress-bar{height:100%;background:var(--chat-accent);border-radius:2px;transition:width .2s ease}file-panel .file-panel-item.status-pending{opacity:.7;cursor:default}file-panel .file-panel-item.status-pending:hover{background:transparent}file-panel .file-panel-item.status-pending .file-panel-item-name{color:var(--chat-text-muted)}file-panel .file-panel-item.status-error{cursor:pointer}file-panel .file-panel-item.status-error .file-panel-item-name{color:#e53935}file-panel .file-panel-item.status-error .file-panel-item-meta{color:#e53935}file-panel .file-panel-item.status-error:hover{background:rgba(229,57,53,.1)}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}file-panel .file-panel-item-status.pending svg,.spinning{animation:spin 1s linear infinite}file-panel .file-panel-preview{display:none;flex-direction:column;border-top:1px solid var(--chat-border);height:45%;min-height:150px;max-height:60%}file-panel .file-panel-preview.has-file{display:flex}file-panel .file-panel-preview-resize{height:4px;cursor:row-resize;background:transparent;flex-shrink:0;transition:background var(--chat-transition)}file-panel .file-panel-preview-resize:hover{background:var(--chat-accent)}file-panel .file-preview-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--chat-border);background:var(--chat-code-header-bg);flex-shrink:0}file-panel .file-preview-filename{font-size:12px;font-weight:500;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}file-panel .file-preview-actions{display:flex;gap:2px;flex-shrink:0}file-panel .file-preview-action-btn{width:26px;height:26px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:4px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}file-panel .file-preview-action-btn:hover{background:var(--chat-inline-code-bg);color:var(--chat-text)}file-panel .file-preview-body{flex:1;overflow:auto;min-height:0;display:flex;flex-direction:column}file-panel .file-preview-body pre{margin:0;border:0;border-radius:0;height:100%}file-panel .file-preview-body code{font-size:12px}file-panel .file-preview-body img{max-width:100%;max-height:100%;object-fit:contain;display:block;padding:8px;margin:auto}file-panel .file-preview-placeholder,file-panel .file-preview-loading{display:flex;align-items:center;justify-content:center;height:100%;color:var(--chat-text-muted);font-size:13px;padding:24px}file-panel .file-panel-list-view{display:flex;flex-direction:column;flex:1;overflow:hidden}file-panel.full-view-mode .file-panel-header,file-panel.full-view-mode .file-panel-drive-selector,file-panel.full-view-mode .file-panel-nav,file-panel.full-view-mode .file-panel-content,file-panel.full-view-mode .file-panel-preview-resize{display:none}file-panel.full-view-mode .file-panel-preview{flex:1;height:auto;max-height:none;min-height:0;border-top:0}file-panel.full-view-mode .file-preview-action-btn[data-action="close"]{display:none}file-panel .file-panel-full-view{display:none}file-panel .file-full-view-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--chat-border);background:var(--chat-code-header-bg);gap:12px}file-panel .file-full-view-title{flex:1;min-width:0}file-panel .file-full-view-filename{font-size:14px;font-weight:600;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}file-panel .file-full-view-meta{font-size:11px;color:var(--chat-text-muted);margin-top:2px}file-panel .file-full-view-actions{display:flex;gap:4px;flex-shrink:0}file-panel .file-full-view-close{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:6px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}file-panel .file-full-view-close:hover{background:var(--chat-inline-code-bg);color:var(--chat-text)}file-panel .file-full-view-body{flex:1;overflow:auto;min-height:0;display:flex;flex-direction:column}file-panel .file-full-view-body pre{margin:0;border:0;border-radius:0;height:100%}file-panel .file-full-view-body code{font-size:13px;line-height:1.6}file-panel .file-full-view-body img{max-width:100%;max-height:100%;object-fit:contain;display:block;padding:12px;margin:auto}file-panel .file-preview-markdown{padding:12px 16px;font-size:13px;line-height:1.6;color:var(--chat-text-color);overflow:auto}file-panel .file-preview-markdown h1,file-panel .file-preview-markdown h2,file-panel .file-preview-markdown h3,file-panel .file-preview-markdown h4{margin:16px 0 8px;font-weight:600;line-height:1.3}file-panel .file-preview-markdown h1{font-size:1.4em}file-panel .file-preview-markdown h2{font-size:1.2em}file-panel .file-preview-markdown h3{font-size:1.1em}file-panel .file-preview-markdown p{margin:0 0 10px}file-panel .file-preview-markdown ul,file-panel .file-preview-markdown ol{margin:0 0 10px;padding-left:24px}file-panel .file-preview-markdown code{background:var(--chat-code-bg,rgba(0,0,0,.06));padding:2px 5px;border-radius:3px;font-size:.9em}file-panel .file-preview-markdown pre{background:var(--chat-code-bg,rgba(0,0,0,.06));padding:10px 12px;border-radius:4px;overflow-x:auto;margin:0 0 10px}file-panel .file-preview-markdown pre code{background:none;padding:0}file-panel .file-preview-markdown blockquote{border-left:3px solid var(--chat-border);margin:0 0 10px;padding:4px 12px;color:var(--chat-text-muted)}file-panel .file-preview-markdown table{border-collapse:collapse;width:100%;margin:0 0 10px}file-panel .file-preview-markdown th,file-panel .file-preview-markdown td{border:1px solid var(--chat-border);padding:6px 10px;text-align:left;font-size:12px}file-panel .file-preview-markdown th{background:var(--chat-code-bg,rgba(0,0,0,.06));font-weight:600}file-panel .file-preview-markdown a{color:var(--chat-accent)}file-panel .file-preview-markdown hr{border:0;border-top:1px solid var(--chat-border);margin:16px 0}file-panel .file-preview-md-toggle.active{color:var(--chat-accent)}file-panel .file-preview-body iframe{flex:1;width:100%;border:0;min-height:0}chat-input{display:block;max-width:var(--chat-max-width);width:100%;margin:0 auto}chat-input .input-wrapper{display:flex;flex-direction:column;background:var(--chat-user-bg);border:1px solid var(--chat-border);border-radius:var(--chat-radius);box-shadow:var(--chat-shadow);transition:border-color var(--chat-transition),box-shadow var(--chat-transition)}chat-input .input-wrapper:focus-within{border-color:var(--chat-accent);box-shadow:0 0 0 3px rgba(217,119,6,.1)}chat-input .attachments-area{display:none;flex-wrap:wrap;gap:8px;padding:12px 12px 0}chat-input .attachments-area.has-attachments{display:flex}chat-input .attachment-preview{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--chat-inline-code-bg);border-radius:8px;font-size:12px;max-width:200px;position:relative}chat-input .attachment-preview img{width:36px;height:36px;object-fit:cover;border-radius:4px;flex-shrink:0}chat-input .attachment-preview .attachment-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:var(--chat-bg);border-radius:4px;color:var(--chat-text-secondary);flex-shrink:0}chat-input .attachment-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}chat-input .attachment-name{font-weight:500;color:var(--chat-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}chat-input .attachment-status{font-size:11px;color:var(--chat-text-muted)}chat-input .attachment-progress{height:3px;background:var(--chat-border);border-radius:2px;overflow:hidden;margin-top:2px}chat-input .attachment-progress-bar{height:100%;background:var(--chat-accent);border-radius:2px;transition:width .2s ease}chat-input .attachment-remove{display:flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:0;border-radius:50%;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition);flex-shrink:0}chat-input .attachment-remove:hover{background:rgba(0,0,0,.1);color:var(--chat-text)}chat-input .attachment-preview.status-pending{opacity:.8}chat-input .attachment-preview.status-error{background:rgba(229,57,53,.1)}chat-input .attachment-preview.status-error .attachment-name,chat-input .attachment-preview.status-error .attachment-status{color:#e53935}chat-input .attachment-preview.status-ready .attachment-status{color:var(--chat-text-muted)}chat-input .input-row{display:flex;align-items:flex-end;gap:8px;padding:12px}chat-input .input-actions-left{display:flex;gap:4px}chat-input .input-field-wrapper{flex:1;min-width:0}chat-input .input-field{width:100%;max-height:200px;padding:8px 0;background:transparent;border:0;outline:0;font-family:inherit;font-size:var(--chat-font-size);line-height:1.5;color:var(--chat-text);resize:none;overflow-y:auto;vertical-align:bottom}chat-input .input-field::placeholder{color:var(--chat-text-muted)}chat-input .input-actions-right{display:flex;gap:4px}chat-input .input-btn{display:flex;align-items:center;justify-content:center;width:36px;height:36px;background:transparent;border:0;border-radius:8px;color:var(--chat-text-muted);cursor:pointer;transition:all var(--chat-transition)}chat-input .input-btn:hover{background:var(--chat-inline-code-bg);color:var(--chat-text)}chat-input .input-btn:disabled{opacity:.5;cursor:not-allowed}chat-input .input-btn.submit-btn{background:var(--chat-accent);color:#fff}chat-input .input-btn.submit-btn:hover:not(:disabled){background:var(--chat-accent-hover)}chat-input .input-btn.submit-btn:disabled{background:var(--chat-text-muted)}chat-input .file-input{display:none}chat-input .input-footer{display:flex;justify-content:flex-end;padding:0 12px 8px;font-size:11px;color:var(--chat-text-muted)}.chat-layout{display:flex;height:100%;overflow:hidden}.chat-layout-main{flex:1;display:flex;flex-direction:column;min-width:0;overflow:hidden}.chat-layout-main chat-log{flex:1;min-height:0}.chat-layout-main .chat-input-wrapper{flex-shrink:0;padding:0 16px 24px;background:linear-gradient(to bottom,transparent,var(--chat-bg) 20%)}chat-workspace{display:flex;flex:1;min-height:0;width:100%;overflow:hidden}chat-workspace .chat-workspace-container{display:flex;flex:1;width:100%;min-height:0;overflow:hidden}chat-workspace .chat-workspace-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}chat-workspace .chat-workspace-main chat-log{flex:1;min-height:0}chat-workspace .chat-workspace-input{flex-shrink:0;padding:0 16px 24px;background:linear-gradient(to bottom,transparent,var(--chat-bg) 20%)}chat-workspace .chat-workspace-resize-handle{width:12px;background:var(--chat-border);cursor:col-resize;position:relative;display:flex;align-items:center;justify-content:center;transition:background var(--chat-transition);flex-shrink:0}chat-workspace .chat-workspace-resize-handle:hover{background:var(--chat-text-muted)}chat-workspace .chat-workspace-resize-handle.active{background:var(--chat-accent)}chat-workspace .resize-handle-grip{width:4px;height:40px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}chat-workspace .resize-handle-grip::before,chat-workspace .resize-handle-grip::after{content:'';width:4px;height:4px;background:var(--chat-text-muted);border-radius:50%;transition:background var(--chat-transition)}chat-workspace .resize-handle-grip::before{box-shadow:0 -7px 0 var(--chat-text-muted)}chat-workspace .resize-handle-grip::after{box-shadow:0 7px 0 var(--chat-text-muted)}chat-workspace .chat-workspace-resize-handle:hover .resize-handle-grip::before,chat-workspace .chat-workspace-resize-handle:hover .resize-handle-grip::after{background:var(--chat-bg)}chat-workspace .chat-workspace-resize-handle:hover .resize-handle-grip::before{box-shadow:0 -7px 0 var(--chat-bg)}chat-workspace .chat-workspace-resize-handle:hover .resize-handle-grip::after{box-shadow:0 7px 0 var(--chat-bg)}chat-workspace .chat-workspace-resize-handle.active .resize-handle-grip::before,chat-workspace .chat-workspace-resize-handle.active .resize-handle-grip::after{background:#fff}chat-workspace .chat-workspace-resize-handle.active .resize-handle-grip::before{box-shadow:0 -7px 0 white}chat-workspace .chat-workspace-resize-handle.active .resize-handle-grip::after{box-shadow:0 7px 0 white}chat-workspace file-panel{width:340px;min-height:0;height:auto;flex-shrink:0}chat-workspace file-panel:not(.open):not([open]){display:none}chat-workspace file-panel.open,chat-workspace file-panel[open]{display:flex}file-panel .file-panel-drop-overlay{position:absolute;inset:0;background:rgba(var(--chat-accent-rgb,217,119,6),.06);border:2px dashed var(--chat-accent);border-radius:6px;display:none;align-items:center;justify-content:center;z-index:100;pointer-events:none}file-panel.drag-over .file-panel-drop-overlay{display:flex}file-panel .file-panel-drop-overlay-content{display:flex;flex-direction:column;align-items:center;gap:8px;padding:20px;background:var(--chat-bg);border-radius:10px;box-shadow:var(--chat-shadow)}file-panel .file-panel-drop-overlay-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;color:var(--chat-accent)}file-panel .file-panel-drop-overlay-icon svg{width:36px;height:36px}file-panel .file-panel-drop-overlay-text{font-size:13px;font-weight:500;color:var(--chat-text)}chat-log .message-timestamp{display:block;font-size:11px;color:var(--chat-text-muted);margin-top:8px;text-align:right;opacity:0;transition:opacity var(--chat-transition)}chat-log .message.user:hover .message-timestamp{opacity:1}chat-input .input-error-banner{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:rgba(239,68,68,.1);border-bottom:1px solid rgba(239,68,68,.2);border-radius:var(--chat-radius) var(--chat-radius) 0 0}chat-input .input-error-banner .error-message{font-size:13px;color:#dc2626;flex:1}chat-input .input-error-banner .error-dismiss-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:0;border-radius:4px;color:#dc2626;cursor:pointer;transition:background var(--chat-transition)}chat-input .input-error-banner .error-dismiss-btn:hover{background:rgba(239,68,68,.15)}chat-input .stop-btn{background:#dc2626!important;color:#fff!important}chat-input .stop-btn:hover:not(:disabled){background:#b91c1c!important}chat-input .input-wrapper.state-processing{opacity:.9}chat-input .input-wrapper.state-processing .input-field{color:var(--chat-text-muted)}chat-input .input-wrapper.state-error{border-color:rgba(239,68,68,.5)}[data-theme="dark"] chat-input .input-error-banner{background:rgba(239,68,68,.15);border-bottom-color:rgba(239,68,68,.3)}[data-theme="dark"] chat-input .input-error-banner .error-message{color:#f87171}[data-theme="dark"] chat-input .input-error-banner .error-dismiss-btn{color:#f87171}@media(max-width:1024px){chat-workspace file-panel{width:280px}chat-log{padding:16px}chat-log .messages-container{gap:24px}}@media(max-width:768px){chat-workspace{position:relative}chat-workspace file-panel{position:absolute;right:0;top:0;bottom:0;width:85%;max-width:320px;z-index:50;box-shadow:-4px 0 20px rgba(0,0,0,.15)}chat-workspace .chat-workspace-resize-handle{display:none}chat-log{padding:12px}chat-log .messages-container{gap:20px}chat-log .message.user .message-content{max-width:95%}chat-workspace .chat-workspace-input{padding:0 12px 16px}chat-input .input-row{padding:10px}chat-input .attachments-area.has-attachments{padding:8px}chat-input .attachment-preview{min-width:100%}chat-log .message-content pre code{font-size:12px;padding:12px}chat-log .code-block-header{padding:6px 12px}chat-log .special-block-header{padding:6px 12px;flex-wrap:wrap;gap:8px}chat-log .special-block-rendered{padding:12px}chat-log .message-image img{max-width:250px;max-height:250px}chat-log .file-reference-main{padding:10px 12px}.chat-image-lightbox .lightbox-content{padding:12px}.chat-image-lightbox .lightbox-actions{flex-wrap:wrap;justify-content:center}.chat-image-lightbox .lightbox-btn{padding:8px 12px;font-size:13px}}@media(max-width:480px){chat-log{padding:8px}chat-log .messages-container{gap:16px}chat-input .input-row{padding:8px;gap:4px}chat-input .input-btn{width:32px;height:32px}chat-log .message-timestamp{font-size:10px}chat-log .message-action-btn{padding:4px 6px}chat-log .code-copy-btn span{display:none}}chat-log .message.thinking{opacity:.95}chat-log .thinking-container{background:var(--chat-code-bg);border:1px solid var(--chat-code-border);border-radius:var(--chat-radius-sm);overflow:hidden}chat-log .thinking-header{display:flex;align-items:center;gap:10px;padding:12px 16px;background:var(--chat-code-header-bg);border-bottom:1px solid var(--chat-code-border);cursor:pointer;user-select:none}chat-log .thinking-header:hover{background:var(--chat-inline-code-bg)}chat-log .thinking-toggle-btn{display:flex;align-items:center;justify-content:center;width:20px;height:20px;background:transparent;border:0;padding:0;cursor:pointer;color:var(--chat-text-secondary);flex-shrink:0}chat-log .thinking-toggle-icon{font-size:10px;line-height:1}chat-log .thinking-header-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}chat-log .thinking-spinner{width:16px;height:16px;border:2px solid var(--chat-border);border-top-color:var(--chat-accent);border-radius:50%;animation:spin 1s linear infinite}chat-log .message.thinking.complete .thinking-spinner{animation:none;border:2px solid #10b981;border-top-color:#10b981;position:relative}chat-log .message.thinking.complete .thinking-spinner::after{content:'?';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:10px;color:#10b981}chat-log .thinking-header-text{flex:1;font-size:13px;font-weight:500;color:var(--chat-text)}chat-log .thinking-header-status{font-size:11px;color:var(--chat-text-muted)}chat-log .thinking-progress{padding:8px 16px 12px;border-bottom:1px solid var(--chat-code-border)}chat-log .thinking-progress-bar{height:4px;background:var(--chat-border);border-radius:2px;overflow:hidden;margin-bottom:6px}chat-log .thinking-progress-bar-fill{height:100%;background:var(--chat-accent);border-radius:2px;transition:width .3s ease;width:0%}chat-log .thinking-progress-message{font-size:11px;color:var(--chat-text-secondary)}chat-log .thinking-steps{padding:8px}chat-log .thinking-step{display:flex;gap:10px;padding:8px;border-radius:6px;transition:background var(--chat-transition);animation:thinkingStepAppear .2s ease-out}@keyframes thinkingStepAppear{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}chat-log .thinking-step:hover{background:var(--chat-inline-code-bg)}chat-log .thinking-step-icon{font-size:16px;line-height:1;flex-shrink:0;width:20px;text-align:center}chat-log .thinking-step-content{flex:1;min-width:0}chat-log .thinking-step-text{font-size:13px;color:var(--chat-text);line-height:1.5}chat-log .thinking-step-detail{margin-top:4px;padding:8px;background:var(--chat-code-bg);border:1px solid var(--chat-code-border);border-radius:4px;font-size:11px;font-family:'SF Mono',Monaco,'Courier New',monospace;color:var(--chat-text-secondary);white-space:pre-wrap;word-break:break-word}chat-log .message.thinking .thinking-steps:empty{display:none}[data-theme="dark"] chat-log .thinking-container{background:#1f1f1f;border-color:#2f2f2f}[data-theme="dark"] chat-log .thinking-header{background:#252525;border-bottom-color:#2f2f2f}[data-theme="dark"] chat-log .thinking-header:hover{background:#2a2a2a}[data-theme="dark"] chat-log .thinking-step:hover{background:#2a2a2a}[data-theme="dark"] chat-log .thinking-step-detail{background:#1a1a1a;border-color:#2f2f2f}