/* ── Chat page layout ─────────────────────────────────────────── */
.chat-page { display: flex; height: calc(100vh - 72px); overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.chat-sidebar { width: 280px; background: var(--olive-mist); border-right: 1px solid var(--border); padding: 28px 20px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; flex-shrink: 0; }
.chat-sidebar-title { font-family: var(--serif); font-size: 1.3rem; color: var(--olive-dark); }
.chat-sidebar-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.chat-role-badge { display: inline-block; padding: 4px 12px; background: var(--olive); color: var(--white); border-radius: 12px; font-size: 12px; font-weight: 600; }
.chat-prompts-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.chat-prompt-chip { display: block; padding: 10px 14px; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text); cursor: pointer; transition: all .2s; text-align: left; width: 100%; }
.chat-prompt-chip:hover { border-color: var(--olive); color: var(--olive); background: var(--white); }

/* ── Chat main ────────────────────────────────────────────────── */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.chat-msg { display: flex; gap: 12px; max-width: 75%; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.bot { align-self: flex-start; }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.chat-msg.bot .chat-avatar { background: var(--olive-mist); }
.chat-msg.user .chat-avatar { background: var(--sand-light); }
.chat-bubble { padding: 12px 16px; border-radius: 16px; font-size: 15px; line-height: 1.6; max-width: 100%; word-break: break-word; }
.chat-msg.bot .chat-bubble { background: var(--white); border: 1.5px solid var(--border); border-bottom-left-radius: 4px; color: var(--text); }
.chat-msg.user .chat-bubble { background: var(--olive); color: var(--white); border-bottom-right-radius: 4px; }

/* ── Typing indicator ────────────────────────────────────────── */
.typing-indicator { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing-dot { width: 8px; height: 8px; background: var(--text-muted); border-radius: 50%; animation: typingBounce .8s infinite; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ── Input row ───────────────────────────────────────────────── */
.chat-input-row { border-top: 1px solid var(--border); padding: 16px 20px; display: flex; gap: 10px; background: var(--white); }
.chat-input { flex: 1; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); font-family: var(--sans); font-size: 15px; resize: none; min-height: 44px; max-height: 120px; transition: border-color .2s; }
.chat-input:focus { outline: none; border-color: var(--olive); }
.chat-send-btn { padding: 12px 20px; background: var(--olive); color: var(--white); border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; font-size: 15px; transition: background .2s; flex-shrink: 0; }
.chat-send-btn:hover { background: var(--olive-dark); }
.chat-send-btn:disabled { background: var(--border); cursor: not-allowed; }

/* ── System / rate-limit message ─────────────────────────────── */
.chat-system-msg { text-align: center; font-size: 13px; color: var(--text-muted); padding: 8px; font-style: italic; }

/* ── Sidebar sign-in nudge ───────────────────────────────────── */
.chat-signin-nudge { font-size: 13px; color: var(--text-muted); background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; line-height: 1.5; }
.chat-signin-nudge a { color: var(--olive); font-weight: 600; text-decoration: none; }
.chat-signin-nudge a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .chat-sidebar { display: none; }
  .chat-messages { padding: 16px; }
  .chat-msg { max-width: 90%; }
}
