:root {
  --bg: #f4f0e8;
  --card: #fffaf2;
  --line: #d9cfbe;
  --text: #22201c;
  --muted: #6c675d;
  --accent: #1f5f4a;
  --accent-2: #d6efe5;
  --danger: #b73535;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--text);
  background: radial-gradient(circle at top, #faf6ef, var(--bg));
}
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card, .app-shell { border: 1px solid var(--line); background: rgba(255,250,242,.94); box-shadow: 0 20px 60px rgba(53,45,31,.12); }
.login-card {
  width: min(480px, 100%);
  padding: 32px;
  border-radius: 28px;
  display: grid;
  gap: 24px;
}
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .2em; color: var(--accent); font-size: 12px; }
h1 { margin: 0 0 12px; font-size: clamp(32px, 5vw, 48px); line-height: .95; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.stack-lg { display: grid; gap: 16px; }
label { display: grid; gap: 8px; font-size: 14px; }
input, textarea, button {
  font: inherit;
  border-radius: 16px;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
  color: var(--text);
}
button {
  border: none;
  background: var(--accent);
  color: white;
  padding: 14px 20px;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
button.ghost.danger {
  border-color: rgba(183, 53, 53, 0.25);
  color: var(--danger);
}
.error { color: var(--danger); min-height: 20px; margin: 0; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(214,239,229,.7), rgba(255,250,242,.98));
}
.sidebar-footer { display: grid; gap: 12px; }
.chat-panel { display: grid; grid-template-rows: 1fr auto; min-height: 100vh; }
.messages { padding: 28px; overflow: auto; display: grid; gap: 16px; align-content: start; }
.message { max-width: min(760px, 100%); padding: 16px 18px; border-radius: 22px; border: 1px solid var(--line); }
.message.user { justify-self: end; background: var(--accent); color: white; border-color: transparent; }
.message.assistant { background: white; }
.message-role { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }
.message-body { white-space: pre-wrap; line-height: 1.55; }
.composer {
  border-top: 1px solid var(--line);
  padding: 20px 28px 28px;
  background: rgba(255,250,242,.96);
}
.composer textarea { resize: vertical; min-height: 110px; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .chat-panel { min-height: auto; }
}
