:root{--bg:#f7f7f8;--panel:#ffffff;--border:#e4e4e7;--text:#1a1a1a;--muted:#6b7280;--user:#2563eb;--user-text:#ffffff;--assistant:#f1f1f3;--tool:#fff7ed;--tool-border:#fdba74;--error:#fef2f2;--error-border:#fca5a5;--error-text:#b91c1c}@media (prefers-color-scheme:dark){:root{--bg:#0f0f10;--panel:#1a1a1c;--border:#2a2a2e;--text:#ededed;--muted:#9ca3af;--user:#2563eb;--user-text:#ffffff;--assistant:#232327;--tool:#2a2013;--tool-border:#a4681f;--error:#2a1414;--error-border:#7f2626;--error-text:#f87171}}*{box-sizing:border-box}body,html{margin:0;padding:0;height:100%}body{background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.5}.app{max-width:760px;margin:0 auto;height:100dvh;display:flex;flex-direction:column;padding:0 16px}.header{padding:20px 4px 12px;border-bottom:1px solid var(--border)}.header h1{margin:0;font-size:18px;font-weight:600}.header p{margin:4px 0 0;color:var(--muted);font-size:13px}.messages{flex:1 1;overflow-y:auto;padding:16px 0;display:flex;flex-direction:column;gap:12px}.empty{margin:auto;text-align:center;color:var(--muted);font-size:14px;max-width:420px}.row{display:flex}.row.user{justify-content:flex-end}.row.assistant{justify-content:flex-start}.bubble{max-width:82%;padding:10px 14px;border-radius:14px;white-space:pre-wrap;word-wrap:break-word}.row.user .bubble{background:var(--user);color:var(--user-text);border-bottom-right-radius:4px}.row.assistant .bubble{background:var(--assistant);color:var(--text);border-bottom-left-radius:4px}.tool-note{align-self:flex-start;max-width:82%;font-size:13px;color:var(--muted);background:var(--tool);border:1px solid var(--tool-border);border-radius:10px;padding:6px 10px}.tool-note code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.error-note{align-self:center;max-width:90%;font-size:13px;color:var(--error-text);background:var(--error);border:1px solid var(--error-border);border-radius:10px;padding:8px 12px;text-align:center}.cursor{display:inline-block;width:7px;height:15px;margin-left:1px;background:currentColor;vertical-align:text-bottom;animation:blink 1s steps(2,start) infinite}@keyframes blink{to{visibility:hidden}}.composer{display:flex;gap:8px;padding:12px 0 20px;border-top:1px solid var(--border)}.composer textarea{flex:1 1;resize:none;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--panel);color:var(--text);font:inherit;max-height:160px}.composer textarea:focus{outline:2px solid var(--user);outline-offset:-1px}.composer button{padding:0 18px;border:none;border-radius:10px;background:var(--user);color:var(--user-text);font:inherit;font-weight:600;cursor:pointer}.composer button:disabled{opacity:.5;cursor:not-allowed}