:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  --bg: #15191b;
  --panel: #1c2225;
  --line: #374247;
  --text: #f4f6f5;
  --muted: #b7c2c4;
  --accent: #a8e9d1;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, textarea, .button { font: inherit; }
button, .button, .primary {
  display: inline-block; padding: .65rem .9rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; text-decoration: none;
}
button, .button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); color: #12261f; border-color: var(--accent); font-weight: 650; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem;
  color: var(--accent); border: 1px solid var(--accent); font-weight: 700;
}
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 27rem); padding: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; }
.login-card p, #status, #account { color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { padding: 1rem; background: var(--panel); display: flex; flex-direction: column; gap: .75rem; border-right: 1px solid var(--line); }
.brand { display: flex; gap: .7rem; align-items: center; font-weight: 700; }
#chats { display: grid; gap: .35rem; }
#chats button { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chats [aria-current="true"] { border-color: var(--accent); }
.account { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; overflow-wrap: anywhere; }
#import { position: absolute; width: 1px; height: 1px; opacity: 0; }
.account:focus-within label { text-decoration: underline; }
.workspace main { width: min(100%, 58rem); margin-inline: auto; padding: 1.25rem clamp(1rem, 4vw, 3rem); }
header, .actions, #composer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); overflow-wrap: anywhere; }
#messages { min-height: 35vh; }
.message { margin: 1rem 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.question { background: var(--panel); border: 1px solid var(--line); border-radius: .65rem; padding: .75rem 1rem; }
.message a { color: var(--accent); }
#question { flex: 1; min-width: 0; resize: vertical; padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; color: inherit; background: var(--panel); }
#status { min-height: 1.4rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 640px) {
  .workspace { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  #chats { max-height: 9rem; overflow-y: auto; }
  .account { flex-direction: row; flex-wrap: wrap; align-items: center; }
  header { flex-wrap: wrap; }
}
