:root{color-scheme:light dark;--bg:#fdfaf8;--ink:#342c30;--dim:#716568;--line:#e7dbd8;--paper:#fffdfc;--tint:#faece8;--rose:#874853;--btn:#774450;--btn-text:#fff}
@media(prefers-color-scheme:dark){:root{--bg:#201b1e;--ink:#f8eeeb;--dim:#c4acb0;--line:#55434a;--paper:#2b2328;--tint:#382830;--rose:#f3c1bc;--btn:#dfa6aa;--btn-text:#2b1e24}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:1rem/1.55 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100svh;display:flex;flex-direction:column}
header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0 clamp(1rem,4vw,4rem)}
header{min-height:4rem}
.brand{display:flex;gap:.65rem;align-items:center;font-weight:600;letter-spacing:-.035em}
.brand span{color:var(--dim);font-weight:300}
button,textarea{font:inherit;color:inherit}
button{cursor:pointer}
button:focus-visible,textarea:focus-visible{outline:2px solid var(--rose);outline-offset:3px}
#reset{background:var(--paper);border:1px solid var(--line);border-radius:2rem;padding:.44rem .95rem;font-size:.875rem}
#reset:hover,#ideas button:hover{background:var(--tint)}
main{width:min(100% - 2rem,46rem);margin:auto;flex:1;display:flex;flex-direction:column;justify-content:center;padding:2rem 0 4rem}
form{border:1px solid var(--line);border-radius:1.35rem;background:var(--paper);padding:1.15rem}
form:focus-within{border-color:var(--rose)}
textarea{width:100%;resize:vertical;min-height:3.8rem;max-height:30vh;background:transparent;border:0;padding:0 .2rem}
textarea:focus-visible{outline:none}
textarea::placeholder{color:var(--dim)}
.toolbar{display:flex;align-items:center;justify-content:space-between}
.mode{font-size:.8rem;color:var(--dim)}
button[type=submit]{background:var(--btn);color:var(--btn-text);border:0;width:2.45rem;height:2.45rem;border-radius:.85rem;display:grid;place-items:center}
button[type=submit]:disabled{opacity:.55;cursor:default}
button svg{width:1.2rem;fill:none;stroke:currentColor;stroke-linejoin:round;stroke-width:1.7}
#ideas{text-align:center;margin-top:.45rem}
#ideas button{border:0;background:transparent;color:var(--dim);font-size:.875rem;padding:.75rem;border-radius:.6rem}
[hidden]{display:none!important}
body.chatting main{justify-content:flex-start;padding-bottom:.6rem}
#thread{flex:1;padding-bottom:1.4rem}
#thread article{width:fit-content;max-width:92%;margin:1rem 0;overflow-wrap:anywhere}
#thread strong{font-size:.83rem;color:var(--rose)}
#thread p{white-space:pre-wrap;margin:.2rem 0}
#thread .user{margin-left:auto;padding:.65rem 1rem;background:var(--tint);border-radius:1rem}
.chatting .controls{position:sticky;bottom:0;background:var(--bg);padding-bottom:.65rem}
@media(max-width:540px){main{padding:1.5rem 0 2rem}}
footer{border-top:1px solid var(--line);padding:1rem clamp(1rem,4vw,4rem);text-align:right;font-size:.75rem;color:var(--dim)}
.version{margin-left:.625rem;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
