:root {
  color-scheme: dark;
  font-family: "Inter", "Geist", system-ui, sans-serif;
  color: #f1f4fb;
  background: #0e121b;
  --surface: #161c29;
  --border: #2c3649;
  --muted: #bac5d7;
  --accent: #c1d4ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 0, #202a41, #0e121b 62%); }
.header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 68rem; margin: auto; padding: 1.1rem 1.3rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; letter-spacing: -.02em; }
.logo { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .63rem; background: var(--accent); color: #1e2a46; font-weight: 800; }
main { max-width: 68rem; margin: 0 auto; padding: 1rem 1.3rem 2.5rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 1.1rem; box-shadow: 0 1rem 3rem #03060b55; }
.login { max-width: 25rem; margin: min(14vh, 7rem) auto 0; padding: 1.8rem; }
.login form { display: grid; gap: .8rem; }
h1 { margin: 0; font-size: 1.65rem; letter-spacing: -.055em; }
.login h1 { margin-bottom: 1.3rem; }
label, .role { color: var(--muted); font-size: .84rem; font-weight: 650; }
input, textarea, select, button { font: inherit; }
input[type="password"], textarea, select { background: #101520; color: inherit; border: 1px solid var(--border); border-radius: .6rem; padding: .65rem .75rem; min-width: 0; }
button { color: #182440; background: var(--accent); font-weight: 700; border: 1px solid transparent; border-radius: .6rem; padding: .6rem .95rem; cursor: pointer; }
.quiet { color: inherit; background: transparent; border-color: var(--border); }
button:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #acbeff; outline-offset: 3px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.choices, .model-field, .thinking { display: flex; align-items: center; gap: .65rem; }
.choices { flex-wrap: wrap; }
.conversation { min-height: min(32vh, 15rem); max-height: 48vh; overflow: auto; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.message { background: #101520; border: 1px solid var(--border); border-radius: .8rem .8rem .8rem .2rem; padding: .75rem .9rem; align-self: flex-start; max-width: 92%; min-width: 0; }
.message.user { background: #222d44; align-self: flex-end; border-radius: .8rem .8rem .2rem .8rem; }
.message p { margin: .35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.composer { border-top: 1px solid var(--border); display: grid; gap: .55rem; padding: 1rem 1.2rem; }
.composer textarea { width: 100%; resize: vertical; min-height: 5rem; max-height: 30vh; }
.actions { display: flex; justify-content: flex-end; gap: .55rem; }
.status, .error { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.status:empty, .error:empty { display: none; }
.error, .status[data-error="true"] { color: #ffb4af; }

@media (max-width: 37rem) {
  .header, main { padding-left: .85rem; padding-right: .85rem; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .conversation { min-height: 24vh; }
  input, textarea, select { font-size: 1rem; }
}
