* { box-sizing: border-box; }

:root {
  --ink: #17252b;
  --muted: #6f7b7c;
  --line: #dce4df;
  --paper: #f8faf5;
  --panel: #ffffff;
  --mint: #bfe8cf;
  --mint-deep: #257451;
  --coral: #e87861;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 10% 0%, #e9f5e7 0, transparent 34%), linear-gradient(135deg, #f8faf5 0%, #edf5ee 100%);
  font-family: "DM Sans", sans-serif;
}

.app-shell { width: min(920px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 30px; }
.topbar { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; color: white; background: var(--ink); border-radius: 12px; font: 700 22px "Space Grotesk", sans-serif; transform: rotate(-5deg); }
.eyebrow { margin: 0; color: var(--mint-deep); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }
h1, h2 { font-family: "Space Grotesk", sans-serif; }
h1 { margin: 1px 0 0; font-size: 22px; letter-spacing: -0.5px; }
.new-chat { margin-left: auto; padding: 10px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .6); font: 600 13px "DM Sans", sans-serif; cursor: pointer; }
.new-chat:hover { border-color: var(--mint-deep); background: white; }
.logout-button { margin-left: auto; padding: 10px 12px; color: var(--muted); border: 0; background: transparent; font: 600 13px "DM Sans", sans-serif; cursor: pointer; }
.logout-button:hover { color: var(--ink); }
.chat-panel { min-height: 650px; display: flex; flex-direction: column; overflow: hidden; background: rgba(255, 255, 255, .82); border: 1px solid rgba(220, 228, 223, .9); border-radius: 18px; box-shadow: 0 20px 60px rgba(39, 73, 57, .08); }
.conversation { flex: 1; overflow-y: auto; padding: 70px clamp(18px, 8vw, 78px) 28px; }
.welcome { max-width: 480px; margin: 45px auto; text-align: center; animation: rise .5s ease both; }
.welcome-icon { width: 47px; height: 47px; display: grid; place-items: center; margin: 0 auto 20px; color: var(--mint-deep); background: var(--mint); border-radius: 50%; font-size: 24px; }
.welcome h2 { margin: 12px 0; font-size: clamp(30px, 5vw, 50px); line-height: 1.02; letter-spacing: -2px; }
.welcome-copy { color: var(--muted); font-size: 14px; }
.message { display: flex; margin: 15px 0; animation: rise .25s ease both; }
.message.user { justify-content: flex-end; }
.bubble { max-width: min(75%, 620px); padding: 12px 16px; border-radius: 15px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.user .bubble { color: white; background: var(--ink); border-bottom-right-radius: 4px; }
.assistant .bubble { background: #edf5ee; border-bottom-left-radius: 4px; }
.composer { display: flex; align-items: flex-end; gap: 10px; margin: 0 22px; padding: 13px 14px 13px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 5px 20px rgba(35, 66, 49, .05); }
textarea { flex: 1; min-height: 24px; max-height: 130px; resize: none; padding: 3px 0; color: var(--ink); border: 0; outline: 0; background: transparent; font: 15px "DM Sans", sans-serif; line-height: 1.5; }
.send-button { width: 34px; height: 34px; flex: 0 0 34px; color: white; border: 0; border-radius: 9px; background: var(--coral); font-size: 22px; line-height: 1; cursor: pointer; }
.send-button:disabled { opacity: .5; cursor: wait; }
.status { min-height: 35px; margin: 11px 25px 0; color: #9aa6a0; font-size: 11px; text-align: center; }
.status.error { color: #b34f3f; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth-shell { width: min(390px, calc(100% - 36px)); margin: 12vh auto 0; padding: 38px; background: rgba(255, 255, 255, .86); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(39, 73, 57, .08); }
.auth-shell .brand-mark { margin-bottom: 24px; }
.auth-shell h1 { margin: 8px 0; font-size: 32px; letter-spacing: -1px; }
.auth-copy { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.auth-form { display: grid; gap: 9px; }
.auth-form label { margin-top: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.auth-form input { width: 100%; padding: 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; outline: 0; background: white; font: 15px "DM Sans", sans-serif; }
.auth-form input:focus { border-color: var(--mint-deep); box-shadow: 0 0 0 3px rgba(37, 116, 81, .12); }
.auth-form button { margin-top: 18px; padding: 12px; color: white; border: 0; border-radius: 8px; background: var(--ink); font: 700 14px "DM Sans", sans-serif; cursor: pointer; }
.auth-error { margin: 8px 0 0; color: #b34f3f; font-size: 13px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 560px) { .app-shell { width: calc(100% - 20px); padding-top: 20px; } .chat-panel { min-height: calc(100vh - 105px); border-radius: 14px; } .conversation { padding-top: 35px; } .welcome { margin: 30px auto; } .bubble { max-width: 88%; } .new-chat span { display: none; } }
