﻿.chat-main { max-width: 800px; padding-block: 32px 48px; }
.chat-main h1 { font-size: clamp(28px, 4vw, 38px); margin-block: 12px; }
.chat-intro, .chat-footnote, .welcome-caption { color: var(--muted); line-height: 1.6; }
.chat-intro { font-size: 14px; }
.welcome-caption { font-size: 13px; }
.chat-shell { margin-top: 24px; border: 1px solid var(--line); background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 12px 40px #282a2c08; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.assistant-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: var(--ink); color: white; font-weight: 700; }
.chat-header h2 { margin: 0; font-size: 14px; letter-spacing: .3px; }
.chat-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.chat-badge { margin-left: auto; font-size: 11px; color: var(--accent); white-space: nowrap; background: #edf1f5; padding: 6px 10px; border-radius: 20px; }
.chat-history { display: flex; flex-direction: column; gap: 18px; height: clamp(240px, 40vh, 400px); overflow-y: auto; padding: 24px 22px; background: #f5f5f3; overscroll-behavior: contain; }
.chat-message { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; flex-shrink: 0; }
.message-avatar { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--accent); background: #e7ecf1; }
.chat-bubble { margin: 0; padding: 12px 16px; background: white; line-height: 1.6; font-size: 14px; border-radius: 16px 16px 16px 4px; }
.from-user { align-self: flex-end; flex-direction: row-reverse; }
.from-user .message-avatar { background: transparent; color: var(--muted); font-size: 10px; }
.chat-answer { background: var(--accent); color: white; border-radius: 16px 16px 4px 16px; }
.chat-composer { padding: 16px 22px 18px; border-top: 1px solid var(--line); }
.reply-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.chat-question { border: 0; padding: 0; margin: 0; min-width: 0; }
.chat-options { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-options button, .chat-action { min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 24px; background: white; color: var(--ink); cursor: pointer; font-size: 13px; text-align: left; }
.chat-options button { border-color: #c4cfda; color: var(--accent); }
.chat-options button:hover { background: #edf1f5; border-color: var(--accent); }
.chat-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.chat-actions .chat-action { border: 0; min-height: 32px; padding: 4px 0; background: transparent; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.chat-primary { background: var(--ink); color: white; border-color: var(--ink); }
.chat-footnote { font-size: 12px; }
#chat-error { margin: 0; padding: 0 22px; color: #913c34; font-size: 14px; line-height: 1.6; }
#chat-error:not(:empty) { padding-block: 12px; }
.chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 480px) {
  .chat-main { width: 94%; padding-top: 24px; }
  .chat-header, .chat-composer { padding-inline: 14px; }
  .chat-history { padding: 18px 12px; height: 300px; }
  .chat-message { max-width: 96%; }
  .welcome-caption, .chat-badge { display: none; }
  .chat-options button { padding-inline: 12px; }
}
