:root{color-scheme:light;--bg:#fff;--side:#f7f7f8;--text:#252525;--muted:#656565;--line:#e8e8e8;--hover:#ececed;--input:#f4f4f4;--accent:#107c65;--bubble:#f1f1f1;--shadow:0 10px 40px #0002;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:0}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:15px}button,input,textarea{font:inherit;letter-spacing:0}button{cursor:pointer;color:inherit}button:disabled{cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button{border:0;background:none}svg{width:20px;height:20px;stroke-width:1.7;flex:none;pointer-events:none}::selection{background:#a8decf;color:#172b24}[hidden]{display:none!important}a{color:inherit;text-decoration:none}
.app{display:grid;grid-template-columns:264px minmax(0,1fr);height:100vh;height:100dvh;overflow:hidden}.sidebar{display:flex;flex-direction:column;padding:18px 12px 10px;background:var(--side);min-width:0;border-right:1px solid var(--line)}.sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:0 10px 23px}.brand{display:flex;align-items:center;gap:10px;font-size:19px;font-weight:600}.brand-mark,.intro-mark{font-family:Georgia,serif;font-weight:700;font-style:italic;display:grid;place-items:center;color:var(--accent)}.brand-mark{font-size:30px;width:30px;height:34px}.icon-button{width:36px;height:36px;display:inline-grid;place-items:center;border-radius:8px;position:relative;flex:none}.icon-button:hover{background:var(--hover)}.mobile-close{display:none}.nav-command{display:flex;align-items:center;gap:11px;padding:10px 12px;width:100%;min-height:42px;border-radius:8px;font-size:14px;text-align:left}.nav-command:hover{background:var(--hover)}.search{margin:15px 8px 21px;display:flex;align-items:center;gap:8px;color:var(--muted)}.search svg{width:17px;height:17px}.search input{min-width:0;width:100%;border:0;background:transparent;padding:8px 0;color:var(--text);font-size:14px}.search input:focus{outline:none}.search:focus-within{outline:2px solid var(--accent);outline-offset:4px;border-radius:4px}.search input::placeholder{color:var(--muted)}.history-label{font-size:12px;font-weight:500;color:var(--muted);margin:0 12px 10px}.history{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent}.history-row{display:flex;align-items:center;gap:4px;border-radius:8px;min-height:40px;margin:2px 0}.history-row.active{background:var(--hover)}.history-title{flex:1;min-width:0;text-align:left;padding:10px 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.history-row .icon-button{width:30px;height:30px;opacity:0;margin-right:4px}.history-row:hover .icon-button,.history-row:focus-within .icon-button{opacity:1}.history-row .icon-button svg{width:15px;height:15px}.no-history{font-size:13px;color:var(--muted);margin:12px}.sidebar-footer{padding-top:10px;border-top:1px solid var(--line)}.profile{display:flex;align-items:center;gap:9px;padding:12px 7px 0;font-size:12px}.profile .icon-button{margin-left:auto}.avatar{width:29px;height:29px;display:grid;place-items:center;border-radius:50%;background:#e0ebe4;color:#345b46;font-weight:600}
.main{min-width:0;display:flex;flex-direction:column;height:100%;position:relative}.topbar{display:flex;align-items:center;gap:12px;height:64px;min-height:64px;padding:12px 24px}.top-brand{font-size:20px;font-weight:600}.topbar #menu{display:none}.demo{font-size:11px;color:var(--muted);border:1px solid var(--line);padding:3px 6px;border-radius:4px}.top-new{margin-left:auto}.chat-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent;scroll-behavior:smooth}.empty{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px 24px 80px;text-align:center}.intro-mark{font-size:58px;line-height:1;width:70px;height:74px;margin-bottom:21px}h1{font-size:30px;font-weight:600;margin:0 0 29px;line-height:1.25}.suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}.suggestions button{display:flex;align-items:center;gap:8px;min-height:42px;padding:10px 13px;border:1px solid var(--line);border-radius:8px;font-size:13px}.suggestions button:hover{background:var(--side)}.suggestions button:nth-child(1) svg{color:#52846d}.suggestions button:nth-child(2) svg{color:#b9862b}.suggestions button:nth-child(3) svg{color:#6389b3}.messages{width:100%;max-width:800px;margin:0 auto;padding:10px 28px 28px}.message{margin:18px 0 30px;line-height:1.75;overflow-wrap:anywhere}.message.user{display:flex;justify-content:flex-end}.message-text{white-space:pre-wrap;max-width:100%}.message.user .message-text{max-width:85%;padding:10px 17px;border-radius:8px;background:var(--bubble)}.assistant-head{font-size:12px;font-weight:600;color:var(--accent);margin-bottom:6px;display:flex;align-items:center;gap:7px}.assistant-head svg{width:16px;height:16px}.message-actions{margin-top:8px}.message-actions .icon-button{width:30px;height:30px;color:var(--muted)}.message-actions svg{width:16px;height:16px}.pending{color:var(--muted);font-size:14px;padding-top:6px}
.composer-area{width:100%;max-width:800px;margin:0 auto;padding:12px 28px 14px;background:var(--bg)}.composer{border:1px solid var(--line);border-radius:8px;background:var(--input);padding:14px 16px 10px}.composer textarea{display:block;resize:none;width:100%;height:34px;max-height:150px;min-height:34px;border:0;outline:none!important;padding:0 2px;background:transparent;line-height:1.6;color:var(--text);caret-color:var(--accent)}.composer textarea::placeholder{color:var(--muted)}.composer:focus-within{border-color:#b8c9c1}.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}.mode{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);min-width:0}.mode svg{width:16px;height:16px}.mode-dot{width:3px;height:3px;border-radius:50%;background:var(--muted)}.send{width:34px;height:34px;border-radius:50%;background:var(--text);color:var(--bg);display:grid;place-items:center;flex:none}.send:disabled{background:#d8d8d8;color:#fff}.send svg{width:19px;height:19px;stroke-width:2}.local-status{font-size:11px;line-height:1.4;text-align:center;color:var(--muted);margin:10px 0 0}.toast{position:fixed;z-index:100;bottom:22px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--bg);padding:12px 18px;border-radius:8px;box-shadow:var(--shadow);max-width:calc(100% - 32px);font-size:13px}dialog{border:1px solid var(--line);background:var(--bg);color:var(--text);border-radius:8px;max-width:400px;width:calc(100% - 32px);padding:24px;box-shadow:var(--shadow)}dialog::backdrop{background:#0006}dialog h2{font-size:20px;margin:0 0 12px}dialog p{font-size:14px;line-height:1.6;color:var(--muted)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}.dialog-actions button{border:1px solid var(--line);padding:9px 14px;border-radius:6px}.dialog-actions .danger{background:#b54444;color:#fff;border-color:#b54444}
[data-tip]:hover::after{content:attr(data-tip);position:absolute;z-index:90;top:calc(100% + 6px);right:0;white-space:nowrap;background:var(--text);color:var(--bg);padding:6px 9px;border-radius:4px;font-size:11px;pointer-events:none}.backdrop{display:none}.dark{color-scheme:dark;--bg:#212121;--side:#171717;--text:#ececec;--muted:#ababab;--line:#3b3b3b;--hover:#303030;--input:#2d2d2d;--accent:#84c9b3;--bubble:#303030}.dark .avatar{background:#34463e;color:#c6dfce}.dark .send:disabled{background:#555;color:#aaa}
@media(max-width:760px){.app{display:block}.sidebar{position:fixed;inset:0 auto 0 0;width:280px;z-index:50;display:none;border-right:1px solid var(--line)}.drawer-open .sidebar{display:flex}.drawer-open .backdrop{display:block;position:fixed;inset:0;background:#0006;z-index:40;width:100%;height:100%}.mobile-close{display:grid}.main{height:100dvh}.topbar{height:58px;min-height:58px;padding:10px 14px;gap:9px}.topbar #menu{display:grid}.top-brand{font-size:19px}.top-new{width:34px}.empty{padding:20px 20px 55px}.intro-mark{font-size:52px;margin-bottom:18px}h1{margin-bottom:24px}.suggestions{max-width:300px;gap:8px}.suggestions button{font-size:12px;padding:10px}.suggestions button svg{width:16px;height:16px}.composer-area{padding:10px 14px max(12px,env(safe-area-inset-bottom))}.composer{padding:12px}.messages{padding:8px 20px 15px}.message.user .message-text{max-width:92%}.history-row .icon-button{opacity:1}.profile{font-size:13px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.composer:focus-within{outline:2px solid var(--accent);outline-offset:2px}
