:root{--bg-app: #ffffff;--bg-sidebar: #f5f5f5;--bg-sidebar-hover: #ececec;--bg-main: #ffffff;--bg-user: #f3f4f6;--bg-composer: #ffffff;--border: #e5e7eb;--border-strong: #d1d5db;--text-main: #111111;--text-soft: #6b7280;--text-faint: #9ca3af;--shadow-composer: 0 8px 24px rgba(17, 24, 39, .08)}*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden;background:var(--bg-app)}body{font-family:Plus Jakarta Sans,Segoe UI,sans-serif;color:var(--text-main)}button,textarea{font:inherit}.sidebar{position:fixed;top:0;left:0;bottom:0;width:280px;overflow:hidden;background:var(--bg-sidebar);border-right:1px solid var(--border);z-index:10}.sidebar-inner{height:100%;padding:14px 10px 10px;display:flex;flex-direction:column;gap:14px;overflow:hidden}.sidebar-top,.brand-lockup,.topbar,.topbar-main,.composer-shell{display:flex;align-items:center}.sidebar-top{justify-content:space-between;gap:10px;padding:4px 4px 8px}.brand-lockup{gap:10px;min-width:0}.brand-mark{width:32px;height:32px;border-radius:10px;object-fit:contain;flex-shrink:0}.brand-copy h1,.topbar-title h2,.welcome-copy h3{margin:0;font-weight:600}.brand-copy h1{font-size:1rem;line-height:1.2}.sidebar-kicker,.section-label,.status-line,.welcome-kicker{margin:0;color:var(--text-soft)}.sidebar-kicker,.welcome-kicker{font-size:.78rem}.new-chat-btn,.history-item,.icon-btn,.send-btn,.composer-icon{transition:background-color .14s ease,border-color .14s ease,transform .14s ease}.new-chat-btn{width:100%;border:1px solid var(--border);border-radius:14px;background:#fff;color:var(--text-main);padding:12px 14px;text-align:left;font-weight:600;cursor:pointer}.new-chat-btn:hover,.history-item:hover,.icon-btn:hover{background:var(--bg-sidebar-hover)}.new-chat-btn:active,.history-item:active,.icon-btn:active,.send-btn:active{transform:translateY(1px)}.sidebar-section{min-height:0;flex:1;display:flex;flex-direction:column;gap:10px}.section-label{padding:0 6px;font-size:.95rem;font-weight:500}.history-count{display:none}.history-list{min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:2px;padding-right:2px}.history-list::-webkit-scrollbar,.chat-window::-webkit-scrollbar{width:8px}.history-list::-webkit-scrollbar-thumb,.chat-window::-webkit-scrollbar-thumb{border-radius:999px;background:#d4d4d8}.history-item{width:100%;padding:10px;border:0;border-radius:12px;background:transparent;color:var(--text-main);text-align:left;cursor:pointer}.history-item.active{background:#e9e9eb}.history-item-title{margin:0;font-size:.96rem;font-weight:500;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-item-preview{margin:4px 0 0;font-size:.8rem;color:var(--text-soft);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.history-item-meta{display:flex;justify-content:space-between;margin-top:6px;font-size:.75rem;color:var(--text-faint)}.history-empty{padding:8px 10px;color:var(--text-soft);font-size:.9rem;line-height:1.45}.sidebar-footer{padding:8px 6px 2px}.status-line{font-size:.82rem;line-height:1.4}.status-info{color:var(--text-soft)}.status-success{color:#4b5563}.status-error{color:#b91c1c}.chat-shell{position:fixed;top:0;left:280px;right:0;bottom:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg-main)}.topbar{justify-content:space-between;gap:16px;padding:18px 24px}.topbar-title h2{font-size:1.15rem}.icon-btn{width:36px;height:36px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--text-main);cursor:pointer}.mobile-only{display:none}.connection-pill{padding:6px 10px;border-radius:999px;border:1px solid var(--border);font-size:.8rem;color:var(--text-soft);background:#fff}.conversation-stage{flex:1 1 0;min-height:0;overflow:hidden;display:flex;flex-direction:column}.chat-shell.is-empty .conversation-stage{justify-content:center}.chat-shell.is-empty .chat-window{flex:0 1 auto}.chat-shell.is-empty .welcome-state{min-height:auto}.chat-shell.is-empty .composer{padding-top:0}.chat-window{flex:1;overflow-y:auto;padding:0 24px}.chat-window-inner,.welcome-copy,.composer{width:min(880px,100%);margin:0 auto}.chat-window-inner{padding:24px 0 40px;display:flex;flex-direction:column;gap:28px}.welcome-state{min-height:100%;display:flex;align-items:center;justify-content:center}.welcome-copy{text-align:center;padding-bottom:28px}.welcome-kicker{font-size:.88rem}.welcome-copy h3{margin-top:8px;font-size:clamp(1rem,2.4vw,1.25rem);letter-spacing:-.01em}.composer{flex-shrink:0;padding:0 24px 28px}.composer-shell{gap:10px;min-height:66px;padding:10px 12px;border:1px solid var(--border-strong);border-radius:999px;background:var(--bg-composer);box-shadow:var(--shadow-composer)}.composer-icon,.send-btn{flex:0 0 auto;width:44px;height:44px;border-radius:999px;border:0}.composer-icon{background:transparent;color:var(--text-main);font-size:1.7rem;line-height:1;cursor:default}.composer textarea{flex:1 1 auto;min-width:0;min-height:30px;max-height:180px;resize:none;border:0;outline:none;padding:10px 2px;background:transparent;color:var(--text-main);font-size:1.02rem;line-height:1.5}.composer textarea::placeholder{color:var(--text-faint)}.input-wrapper{position:relative;flex:1 1 auto;min-width:0;display:flex;flex-direction:column}.suggestions-box{position:absolute;bottom:calc(100% + 10px);left:0;right:0;background:var(--bg-composer);border:1px solid var(--border-strong);border-radius:12px;box-shadow:var(--shadow-composer);max-height:250px;overflow-y:auto;z-index:50;display:flex;flex-direction:column}.suggestions-box[hidden]{display:none!important}.suggestion-item{padding:12px 16px;border-bottom:1px solid var(--border);cursor:pointer;text-align:left;background:transparent;color:var(--text-main);border-left:0;border-right:0;border-top:0;font-size:.95rem}.suggestion-item:last-child{border-bottom:0}.suggestion-item:hover,.suggestion-item.active{background:var(--bg-user)}.send-btn{background:#111;color:#fff;font-size:1.25rem;font-weight:700;cursor:pointer}.send-btn:hover{background:#222}.send-btn:disabled{cursor:wait;opacity:.72}.message{display:grid;gap:8px}.message.user{justify-items:end}.message.assistant{justify-items:start}.message-bubble{max-width:min(840px,100%);padding:0;border:0;background:transparent;color:var(--text-main);overflow-wrap:anywhere}.message.user .message-bubble{max-width:min(72%,100%);padding:14px 16px;border-radius:20px;background:var(--bg-user)}.message-meta{color:var(--text-faint);font-size:.78rem}.source-panel{margin-top:14px;border:1px solid var(--border);border-radius:14px;background:#fafafa}.source-panel summary{cursor:pointer;list-style:none;padding:12px 14px;font-size:.84rem;font-weight:600}.source-panel summary::-webkit-details-marker{display:none}.source-list{display:grid;gap:10px;padding:0 14px 14px}.source-item{padding:12px;border:1px solid var(--border);border-radius:12px;background:#fff}.source-item strong{display:block;margin-bottom:6px;font-size:.83rem}.source-item p{margin:0;color:var(--text-soft);font-size:.83rem;line-height:1.45}.typing-bubble{display:inline-flex;gap:6px;align-items:center;min-height:32px}.typing-bubble span{width:8px;height:8px;border-radius:999px;background:var(--text-faint);animation:typing .9s ease-in-out infinite}.typing-bubble span:nth-child(2){animation-delay:.12s}.typing-bubble span:nth-child(3){animation-delay:.24s}.ldf-loading{display:inline;color:#e53e3e;font-weight:600;font-size:.95rem}.md-content{font-size:1rem;line-height:1.7}.md-content p,.md-content ul,.md-content ol,.md-content blockquote,.md-content pre,.md-content h1,.md-content h2,.md-content h3,.md-content h4,.md-content h5,.md-content h6{margin:0 0 .8rem}.md-content p:last-child,.md-content ul:last-child,.md-content ol:last-child,.md-content blockquote:last-child,.md-content pre:last-child{margin-bottom:0}.md-content ul,.md-content ol{padding-left:1.25rem}.md-content code{padding:0 .24rem;border-radius:6px;background:#1118270f;font-family:Cascadia Mono,Consolas,monospace;font-size:.94em}.md-content pre{overflow:auto;padding:.9rem;border-radius:12px;background:#111827;color:#f9fafb}.message.user .md-content code{background:#11182714}.md-content pre code{padding:0;background:transparent;color:inherit}.md-content blockquote{margin-left:0;padding-left:.8rem;border-left:3px solid var(--border-strong);color:var(--text-soft)}.sidebar-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:15;background:#1118273d}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes typing{0%,80%,to{transform:translateY(0);opacity:.35}40%{transform:translateY(-4px);opacity:1}}.poster-bubble{background:transparent;padding:0;box-shadow:none;display:flex;flex-direction:column;gap:10px;align-items:flex-start}.poster-image{max-width:480px;width:100%;border-radius:12px;box-shadow:0 4px 20px #00000026;display:block}.poster-download-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;background:var(--bg-sidebar);border:1px solid var(--border-strong);border-radius:8px;font-size:.85rem;color:var(--text-main);text-decoration:none;font-weight:500;transition:background .12s}.poster-download-btn:hover{background:var(--bg-sidebar-hover)}.poster-quick-btn{margin-top:8px;padding:6px 13px;background:transparent;border:1px solid var(--border-strong);border-radius:20px;font-size:.82rem;color:var(--text-soft);cursor:pointer;transition:background .12s,color .12s}.poster-quick-btn:hover:not(:disabled){background:var(--bg-sidebar-hover);color:var(--text-main)}.poster-quick-btn:disabled{opacity:.55;cursor:default}@media(max-width:1080px){.sidebar{transform:translate(-100%);transition:transform .16s ease;z-index:20}.sidebar.open{transform:translate(0)}.chat-shell{left:0}.mobile-only{display:inline-flex}.topbar{padding:16px 18px}}.topbar-actions{display:flex;align-items:center;gap:8px}.topbar-btn{font-size:1.1rem;padding:6px 8px;border-radius:8px;color:var(--text-soft);transition:color .12s,background .12s}.topbar-btn:hover{color:var(--text-main);background:var(--surface-hover, rgba(17, 24, 39, .06))}.user-chip{display:flex;align-items:center;gap:7px;padding:3px;border-radius:24px;background:var(--bg-sidebar-hover, #ececec);border:1px solid var(--border, #e5e7eb)}.user-avatar{width:28px;height:28px;border-radius:50%;background:var(--accent, #6366f1);color:#fff;font-weight:700;font-size:.72rem;letter-spacing:.02em;display:flex;align-items:center;justify-content:center;flex-shrink:0;text-transform:uppercase}.user-name{font-size:.83rem;font-weight:500;color:var(--text-main);max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:2px}.sign-out-btn{display:flex;align-items:center;gap:5px;padding:5px 10px;border-radius:20px;background:#fff;color:var(--text-soft, #6b7280);font-size:.8rem;font-weight:500;border:1px solid var(--border, #e5e7eb);cursor:pointer;transition:background .12s,color .12s,border-color .12s;white-space:nowrap}.sign-out-btn:hover{background:#fee2e2;color:#dc2626;border-color:#fecaca}@media(max-width:600px){.user-name,.sign-out-btn span{display:none}}.auth-screen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:flex;align-items:center;justify-content:center;background:var(--surface-bg, #f9fafb)}.auth-screen[hidden]{display:none}.auth-box{width:100%;max-width:380px;padding:36px 32px;border:1px solid var(--border-subtle, #e5e7eb);border-radius:20px;background:#fff;box-shadow:0 8px 40px #11182714;display:flex;flex-direction:column;align-items:center;gap:14px}.auth-logo{width:72px;height:72px;border-radius:16px;object-fit:contain}.welcome-logo{width:clamp(160px,30vw,330px);height:clamp(160px,30vw,330px);object-fit:contain;margin-bottom:8px}.auth-title{font-size:1.25rem;font-weight:700;color:var(--text-main, #111827);margin:0}.auth-kicker{font-size:.88rem;color:var(--text-soft, #6b7280);margin:0}.google-btn-container{width:320px;min-height:40px}.auth-divider{width:100%;display:flex;align-items:center;gap:10px;color:var(--text-faint, #9ca3af);font-size:.8rem}.auth-divider:before,.auth-divider:after{content:"";flex:1;height:1px;background:var(--border-subtle, #e5e7eb)}.auth-tabs{display:flex;gap:0;border:1px solid var(--border-subtle, #e5e7eb);border-radius:10px;overflow:hidden;width:100%}.auth-tab{flex:1;padding:8px 0;font-size:.88rem;font-weight:500;color:var(--text-soft, #6b7280);background:transparent;border:none;cursor:pointer;transition:background .12s,color .12s}.auth-tab.active{background:var(--accent, #6366f1);color:#fff}.auth-login-mode{display:flex;gap:1.2rem;font-size:.85rem;color:var(--text-soft, #6b7280)}.auth-login-mode label{display:flex;align-items:center;gap:.35rem;cursor:pointer}.auth-form{width:100%;display:flex;flex-direction:column;gap:10px}.auth-form input{width:100%;padding:10px 14px;border:1px solid var(--border-subtle, #e5e7eb);border-radius:10px;font-size:.95rem;color:var(--text-main, #111827);background:var(--surface-bg, #f9fafb);box-sizing:border-box;outline:none;transition:border-color .12s}.auth-form input:focus{border-color:var(--accent, #6366f1)}.auth-submit{padding:11px;border-radius:10px;background:var(--accent, #6366f1);color:#fff;font-weight:600;font-size:.95rem;border:none;cursor:pointer;transition:opacity .12s}.auth-submit:hover{opacity:.88}.auth-error{font-size:.85rem;color:#ef4444;text-align:center;margin:0}.auth-error.auth-info{color:#16a34a}.admin-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;background:#11182766;display:flex;align-items:center;justify-content:center;padding:24px}.admin-overlay[hidden]{display:none}.admin-box{background:#fff;border-radius:16px;box-shadow:0 12px 48px #11182729;width:100%;max-width:780px;max-height:80vh;display:flex;flex-direction:column;overflow:hidden}.admin-header{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;border-bottom:1px solid var(--border-subtle, #e5e7eb)}.admin-header h2{font-size:1.1rem;font-weight:700;margin:0}.admin-body{overflow-y:auto;padding:16px 24px}.admin-table{width:100%;border-collapse:collapse;font-size:.88rem}.admin-table th{text-align:left;padding:8px 12px;font-weight:600;color:var(--text-soft, #6b7280);border-bottom:1px solid var(--border-subtle, #e5e7eb)}.admin-table td{padding:10px 12px;border-bottom:1px solid var(--border-subtle, #e5e7eb);color:var(--text-main, #111827);vertical-align:middle}.admin-actions{display:flex;gap:8px}.badge{display:inline-block;padding:2px 8px;border-radius:6px;font-size:.78rem;font-weight:600}.badge-ok{background:#dcfce7;color:#16a34a}.badge-pending{background:#fef9c3;color:#ca8a04}.badge-admin{background:#ede9fe;color:#7c3aed}.btn-approve{padding:4px 10px;border-radius:6px;background:#dcfce7;color:#16a34a;font-size:.8rem;font-weight:600;border:none;cursor:pointer}.btn-approve:hover{background:#bbf7d0}.btn-delete{padding:4px 10px;border-radius:6px;background:#fee2e2;color:#dc2626;font-size:.8rem;font-weight:600;border:none;cursor:pointer}.btn-delete:hover{background:#fecaca}.pending-icon-wrap{width:64px;height:64px;border-radius:50%;background:#fef9c3;color:#ca8a04;display:flex;align-items:center;justify-content:center;margin-bottom:4px}.pending-message{font-size:.9rem;color:var(--text-soft, #6b7280);text-align:center;margin:0;line-height:1.55;max-width:300px}@media(max-width:760px){.chat-window{padding:0 16px}.composer{padding:0 16px 18px}.composer-shell{min-height:60px;padding:8px 10px}.composer-icon,.send-btn{width:40px;height:40px}.message.user .message-bubble{max-width:88%}}
