:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Songti SC", "Source Han Serif SC", serif; background: #1c1915; color: #f3ead7; }
button, input, textarea { font: inherit; color: inherit; }
button, a { cursor: pointer; }
.login { min-height: 100vh; display: grid; place-items: center; }
.card { width: min(420px, calc(100% - 32px)); background: #2a241c; padding: 28px; border: 1px solid #5c4a32; }
.card.wide { width: min(560px, calc(100% - 32px)); }
.card h1 { margin: 0 0 8px; font-size: 22px; }
.card h2 { margin: 18px 0 8px; font-size: 15px; font-weight: 600; }
.card h2:first-of-type { margin-top: 4px; }
.hint, .err { margin: 0 0 16px; }
.err { color: #e7b3a0; }
label { display: block; margin-bottom: 12px; }
input, textarea { width: 100%; background: #14110e; border: 1px solid #5c4a32; padding: 8px; }
button, .bar a { background: #8c6239; color: #fff8ee; border: 0; padding: 8px 14px; text-decoration: none; }
header { display: flex; gap: 16px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #5c4a32; }
header a { background: #8c6239; color: #fff8ee; text-decoration: none; padding: 8px 14px; }
.card a { color: #e7d7a8; }
header span { flex: 1; opacity: .8; }
main { display: grid; grid-template-columns: 220px 1fr 320px; height: calc(100vh - 49px); }
aside, .chat { border-right: 1px solid #5c4a32; overflow: auto; }
.ver { position: sticky; top: 0; display: grid; gap: 8px; padding: 8px; background: #1c1915; border-bottom: 1px solid #5c4a32; }
.ver button { width: 100%; }
.chat { border-right: 0; border-left: 1px solid #5c4a32; display: flex; flex-direction: column; }
#files button { display: block; width: 100%; text-align: left; background: transparent; color: inherit; border-bottom: 1px solid #3a3126; }
#files button.on { background: #3a3126; }
section { display: flex; flex-direction: column; min-width: 0; }
.bar { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid #5c4a32; }
#path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor { flex: 1; border: 0; resize: none; padding: 12px; background: #14110e; }
#log { flex: 1; overflow: auto; padding: 12px; }
.msg { margin: 0 0 12px; white-space: pre-wrap; }
.msg.user { color: #e7d7a8; }
#ask { display: flex; gap: 8px; padding: 8px; border-top: 1px solid #5c4a32; }
#prompt { flex: 1; min-height: 64px; }
