:root{color-scheme:dark;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.5;--bg-primary: #0d0d0f;--bg-secondary: #141418;--bg-tertiary: #1a1a22;--bg-hover: #1f1f2a;--border: rgba(255, 255, 255, .08);--border-hover: rgba(255, 255, 255, .15);--text-primary: #f0f0f4;--text-secondary: rgba(255, 255, 255, .55);--text-muted: rgba(255, 255, 255, .35);--accent: #6c5ce7;--accent-glow: rgba(108, 92, 231, .15);--accent-hover: #7c6ef7;--user-bubble: linear-gradient(135deg, #6c5ce7, #a55eea);--ai-bubble: var(--bg-tertiary);--shadow: 0 2px 20px rgba(0, 0, 0, .3)}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{min-height:100vh;background:var(--bg-primary);color:var(--text-primary)}.app{display:flex;height:100vh;overflow:hidden}.sidebar{width:280px;background:var(--bg-secondary);border-right:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0}.sidebar-header{padding:1.25rem 1.25rem 1rem;border-bottom:1px solid var(--border)}.sidebar-brand{display:flex;align-items:center;gap:.65rem}.sidebar-logo{width:36px;height:36px;background:var(--user-bubble);border-radius:10px;display:grid;place-items:center;font-size:1.1rem;font-weight:700;color:#fff;box-shadow:0 4px 15px #6c5ce74d}.sidebar-title{font-size:1.1rem;font-weight:700;letter-spacing:-.02em;background:linear-gradient(135deg,#fff,#ffffffb3);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.sidebar-title.editable{cursor:pointer;display:flex;align-items:center;gap:.4rem;transition:opacity .15s}.sidebar-title.editable:hover{opacity:.8}.sidebar-title.editable:hover .edit-icon{opacity:1}.edit-icon{width:13px;height:13px;opacity:0;transition:opacity .15s;flex-shrink:0;stroke:#ffffff80}.sidebar-brand-text{min-width:0;flex:1}.name-edit-input{width:100%;font-size:1.1rem;font-weight:700;letter-spacing:-.02em;background:var(--bg-tertiary);border:1px solid var(--accent);border-radius:.35rem;color:var(--text-primary);padding:.15rem .4rem;outline:none;box-shadow:0 0 0 3px var(--accent-glow)}.sidebar-subtitle{font-size:.7rem;color:var(--text-muted);letter-spacing:.08em;text-transform:uppercase}.new-chat-btn{display:flex;align-items:center;gap:.5rem;margin:1rem 1.25rem;padding:.7rem 1rem;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:.6rem;color:var(--text-primary);font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s}.new-chat-btn:hover{background:var(--bg-hover);border-color:var(--border-hover);transform:translateY(-1px)}.new-chat-btn svg{width:16px;height:16px;opacity:.7}.chat-list{flex:1;overflow-y:auto;padding:.5rem .75rem}.chat-list-label{font-size:.65rem;letter-spacing:.12em;text-transform:uppercase;color:var(--text-muted);padding:.5rem .5rem .4rem;font-weight:600}.chat-item{display:flex;align-items:center;gap:.6rem;padding:.6rem .65rem;border-radius:.5rem;cursor:pointer;transition:all .15s;font-size:.82rem;color:var(--text-secondary);position:relative}.chat-item:hover{background:var(--bg-hover);color:var(--text-primary)}.chat-item.active{background:var(--accent-glow);color:var(--text-primary);border:1px solid rgba(108,92,231,.2)}.chat-item-icon{font-size:.95rem;flex-shrink:0;width:20px;text-align:center}.chat-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-item-delete{display:none;position:absolute;right:.5rem;background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:.75rem;padding:.2rem}.chat-item:hover .chat-item-delete{display:block}.chat-item-delete:hover{color:#e74c3c}.sidebar-footer{padding:1rem 1.25rem;border-top:1px solid var(--border);font-size:.7rem;color:var(--text-muted);text-align:center}.main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg-primary)}.chat-header{padding:1rem 1.5rem;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:.75rem;background:#0d0d0fcc;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}.status-dot{width:8px;height:8px;background:#2ecc71;border-radius:50%;box-shadow:0 0 8px #2ecc7180;animation:pulse 2s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.chat-header-info h2{font-size:.95rem;font-weight:600;letter-spacing:-.01em}.chat-header-info span{font-size:.72rem;color:var(--text-muted)}.messages-area{flex:1;overflow-y:auto;padding:2rem 0;scroll-behavior:smooth}.messages-container{max-width:48rem;margin:0 auto;padding:0 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.message{display:flex;gap:.75rem;animation:fadeUp .35s ease-out}@keyframes fadeUp{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.message.user{flex-direction:row-reverse}.message-avatar{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;font-size:.8rem;font-weight:700;flex-shrink:0;margin-top:2px}.message.ai .message-avatar{background:linear-gradient(135deg,#2ecc71,#27ae60);color:#fff;box-shadow:0 2px 10px #2ecc7140}.message.user .message-avatar{background:var(--user-bubble);color:#fff;box-shadow:0 2px 10px #6c5ce740}.message-content{max-width:75%;min-width:0}.message-bubble{padding:.85rem 1.1rem;border-radius:1rem;font-size:.88rem;line-height:1.65;word-wrap:break-word}.message.ai .message-bubble{background:var(--ai-bubble);border:1px solid var(--border);border-top-left-radius:.3rem}.message.user .message-bubble{background:var(--user-bubble);color:#fff;border-top-right-radius:.3rem;box-shadow:0 4px 15px #6c5ce733}.message-time{font-size:.65rem;color:var(--text-muted);margin-top:.35rem;padding:0 .25rem}.message.user .message-time{text-align:right}.typing-indicator{display:flex;gap:.35rem;padding:.25rem 0}.typing-indicator span{width:7px;height:7px;background:var(--text-muted);border-radius:50%;animation:bounce 1.4s infinite}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes bounce{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-6px)}}.welcome{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem}.welcome-logo{width:72px;height:72px;background:var(--user-bubble);border-radius:20px;display:grid;place-items:center;font-size:2rem;font-weight:800;color:#fff;margin-bottom:1.5rem;box-shadow:0 8px 30px #6c5ce759;animation:float 3s ease-in-out infinite}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}.welcome h1{font-size:1.8rem;font-weight:700;letter-spacing:-.03em;margin-bottom:.5rem;background:linear-gradient(135deg,#fff,#ffffffa6);-webkit-background-clip:text;-webkit-text-fill-color:transparent}.welcome p{color:var(--text-secondary);font-size:.95rem;max-width:28rem;margin-bottom:2rem}.suggestions{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;max-width:40rem;width:100%}@media(min-width:769px){.suggestions{grid-template-columns:repeat(4,1fr)}}.suggestion{padding:.85rem 1rem;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:.75rem;cursor:pointer;transition:all .2s;text-align:left;color:var(--text-primary)}.suggestion:hover{background:var(--bg-hover);border-color:var(--border-hover);transform:translateY(-2px);box-shadow:var(--shadow)}.suggestion-title{font-size:.82rem;font-weight:600;margin-bottom:.2rem}.suggestion-desc{font-size:.72rem;color:var(--text-muted)}.input-area{padding:1rem 1.5rem 1.5rem;background:#0d0d0fcc;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}.input-wrapper{max-width:48rem;margin:0 auto;position:relative}.input-box{display:flex;align-items:flex-end;background:var(--bg-secondary);border:1px solid var(--border);border-radius:1rem;padding:.5rem;transition:border-color .2s,box-shadow .2s}.input-box:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-glow)}.input-box textarea{flex:1;background:transparent;border:none;outline:none;color:var(--text-primary);font-family:inherit;font-size:.88rem;line-height:1.5;padding:.5rem .75rem;resize:none;max-height:150px;min-height:24px}.input-box textarea::placeholder{color:var(--text-muted)}.send-btn{width:36px;height:36px;background:var(--user-bubble);border:none;border-radius:.65rem;cursor:pointer;display:grid;place-items:center;transition:all .2s;flex-shrink:0}.send-btn:hover:not(:disabled){transform:scale(1.05);box-shadow:0 4px 15px #6c5ce766}.send-btn:disabled{opacity:.4;cursor:not-allowed}.send-btn svg{width:18px;height:18px;color:#fff}.input-footer{text-align:center;margin-top:.6rem;font-size:.68rem;color:var(--text-muted)}.message-bubble p{margin:0 0 .5rem}.message-bubble p:last-child{margin-bottom:0}.message-bubble code{background:#0000004d;padding:.15rem .4rem;border-radius:.3rem;font-size:.82rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.message-bubble pre{background:#0006;padding:.85rem;border-radius:.5rem;overflow-x:auto;margin:.5rem 0}.message-bubble pre code{background:none;padding:0;font-size:.8rem}.message-bubble strong{font-weight:600}.message-bubble ul,.message-bubble ol{padding-left:1.25rem;margin:.35rem 0}.message-bubble li{margin-bottom:.25rem}.code-blocks{margin-top:.6rem;display:flex;flex-direction:column;gap:.6rem}.code-block{border-radius:.6rem;overflow:hidden;border:1px solid var(--border);background:#0b0d10}.code-block-header{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:#ffffff0a;border-bottom:1px solid var(--border)}.code-lang{font-size:.72rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--text-muted);letter-spacing:.02em}.code-actions{display:flex;gap:.4rem}.code-btn{display:flex;align-items:center;gap:.3rem;padding:.3rem .6rem;border-radius:.35rem;border:1px solid var(--border);background:transparent;color:var(--text-secondary);font-size:.72rem;font-weight:500;cursor:pointer;transition:all .15s}.code-btn:hover{background:var(--bg-hover);color:var(--text-primary);border-color:var(--border-hover)}.copy-btn.copied{color:#2ecc71;border-color:#2ecc714d}.code-pre{padding:.85rem;margin:0;overflow-x:auto;font-size:.78rem;line-height:1.6;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#c9d1d9;max-height:400px;overflow-y:auto}.code-pre code{background:none;padding:0;font-size:inherit}.preview-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000b3;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:200;display:flex;align-items:center;justify-content:center;padding:2rem;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.preview-modal{width:100%;max-width:900px;height:80vh;background:var(--bg-secondary);border:1px solid var(--border);border-radius:1rem;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 25px 60px #00000080;animation:slideUp .25s ease-out}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}.preview-header{display:flex;align-items:center;justify-content:space-between;padding:.85rem 1.25rem;border-bottom:1px solid var(--border);background:#ffffff05}.preview-header h3{font-size:.9rem;font-weight:600}.preview-close{width:30px;height:30px;border-radius:.4rem;border:1px solid var(--border);background:transparent;color:var(--text-secondary);cursor:pointer;display:grid;place-items:center;font-size:.85rem;transition:all .15s}.preview-close:hover{background:var(--bg-hover);color:var(--text-primary)}.preview-iframe{flex:1;border:none;background:#fff}.message-bubble em{font-style:italic}.md-h2,.md-h3,.md-h4{font-weight:700;margin:.75rem 0 .4rem;letter-spacing:-.02em}.md-h2{font-size:1.15rem}.md-h3{font-size:1.05rem}.md-h4{font-size:.95rem}.md-hr{border:none;border-top:1px solid var(--border);margin:.75rem 0}.md-ol,.md-ul{display:list-item;list-style-position:inside}.md-ol{list-style-type:decimal}.md-ul{list-style-type:disc}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#fff3}@media(max-width:768px){.sidebar{position:fixed;z-index:100;height:100vh;transform:translate(-100%);transition:transform .3s ease}.sidebar.open{transform:translate(0)}.sidebar-overlay{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;z-index:99}.sidebar.open~.sidebar-overlay{display:block}.mobile-menu-btn{display:grid}.messages-container{padding:0 1rem}.suggestions{grid-template-columns:1fr}}@media(min-width:769px){.mobile-menu-btn{display:none}.sidebar-overlay{display:none!important}}.mobile-menu-btn{width:36px;height:36px;background:var(--bg-tertiary);border:1px solid var(--border);border-radius:.5rem;cursor:pointer;place-items:center;color:var(--text-primary)}
