:root{--bg:#fbfbfa;--fg:#1f1f1f;--muted:#6f6f6f;--line:#e6e6e3;--accent:#2f5d50;--soft:#f1f4f2;--me:#eef2f0}
@media (prefers-color-scheme:dark){:root{--bg:#151515;--fg:#ececec;--muted:#a3a3a3;--line:#2b2b2b;--accent:#8fc4b2;--soft:#1d2120;--me:#1f2725}}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--fg);font-family:Heebo,system-ui,sans-serif;font-weight:300;line-height:1.75;font-size:17px}
.wrap{max-width:720px;margin:0 auto;padding:40px 16px 24px;min-height:100%;display:flex;flex-direction:column}
h1{font-weight:500;font-size:1.7rem;margin:0 0 8px;line-height:1.3}
.desc{color:var(--muted);margin:0 0 28px}
.card{background:var(--soft);border-radius:10px;padding:20px 22px;margin-bottom:20px}
.note{font-size:.88rem;color:var(--muted)}
label{display:block;font-weight:400;margin-bottom:8px}
input,textarea{font:inherit;color:inherit;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 12px;width:100%}
textarea{resize:none;min-height:52px;max-height:200px}
button{font:inherit;font-weight:400;border:0;border-radius:8px;padding:10px 18px;background:var(--accent);color:#fff;cursor:pointer}
@media (prefers-color-scheme:dark){button{color:#111}}
button:disabled{opacity:.5;cursor:default}
button.ghost{background:transparent;color:var(--muted);border:1px solid var(--line);padding:6px 12px;font-size:.88rem}
.row{display:flex;gap:10px;margin-top:12px}
.err{color:#b23b3b;font-size:.9rem;margin-top:8px;min-height:1.2em}
.starters{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 20px}
.starters button{background:transparent;color:var(--fg);border:1px solid var(--line);font-weight:300;text-align:right}
#log{flex:1;display:flex;flex-direction:column;gap:14px;margin-bottom:16px}
.msg{white-space:pre-wrap;padding:12px 16px;border-radius:12px;max-width:92%}
.msg.user{background:var(--me);align-self:flex-start}
.msg.assistant{align-self:flex-end;border:1px solid var(--line)}
.composer{position:sticky;bottom:0;background:var(--bg);padding:12px 0 8px;display:flex;gap:10px;align-items:flex-end}
.top{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
footer{margin-top:20px;font-size:.8rem;color:var(--muted)}
[hidden]{display:none!important}
