:root {
    color-scheme: dark;
    font-family: Inter, system-ui, sans-serif;
    background: #080b12;
    color: #e8ebf5;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button {
    cursor: pointer;
    background: #333e73;
    color: white;
    border: 1px solid #4b588f;
    border-radius: 11px;
    padding: 12px 16px;
}
button:hover { background: #46558e; }
button:disabled { opacity: .5; cursor: default; }
input, textarea {
    background: #151b29;
    color: #e8ebf5;
    border: 1px solid #30394d;
    border-radius: 12px;
    padding: 14px;
    outline: none;
}
input:focus, textarea:focus { border-color: #8493ff; }
#login {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(420px, 100%);
    background: #101521;
    border: 1px solid #252d40;
    border-radius: 25px;
    padding: 40px 24px;
    text-align: center;
}
#login-form {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}
.orb {
    width: 100px;
    height: 100px;
    margin: 20px auto;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%,
        #d1e2ff, #7189f3 24%, #394dbb 45%,
        #20254d 67%, #111525 85%);
    box-shadow: 0 0 50px #5266ce55;
}
h1 { font-weight: 500; }
p, small, .version, .side-label { color: #929bb2; }
.version { font-size: 11px; letter-spacing: 2px; }
#workspace {
    display: grid;
    grid-template-columns: 255px minmax(0,1fr);
    height: 100dvh;
}
aside {
    background: #10141e;
    border-right: 1px solid #232a38;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}
aside h2 { letter-spacing: 3px; font-weight: 500; }
aside nav { overflow: auto; flex: 1; }
aside nav button {
    background: transparent;
    border: none;
    display: block;
    width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
}
aside nav button:hover { background: #20283b; }
.side-label { font-size: 11px; letter-spacing: 1px; }
main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}
header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #222937;
}
#connection { color: #8dcdb7; font-size: 12px; }
#messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px max(20px,calc((100% - 820px)/2));
}
.welcome { text-align: center; margin-top: 10vh; }
.message {
    padding: 15px 18px;
    margin: 14px 0;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.message.user {
    background: #202a40;
    border-radius: 16px;
    margin-left: 12%;
}
.message.assistant {
    border-left: 2px solid #667bdb;
}
.composer {
    padding: 14px max(20px,calc((100% - 820px)/2));
    background: #0d111b;
    border-top: 1px solid #222937;
}
#chat-form { display: flex; gap: 10px; }
textarea { flex: 1; min-width: 0; resize: vertical; }
#status { color: #a3b1d9; font-size: 12px; padding-bottom: 10px; }
.composer small { display: block; text-align: center; margin: 12px; }
@media(max-width:650px) {
    #workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
    aside { padding: 10px; display: flex; gap: 8px; border-right: none; }
    aside h2, .side-label { display: none; }
    aside nav { max-height: 90px; }
    .welcome { margin-top: 2vh; }
}
