/* ============================================================
   HigiaClaude — Design System
   Base font: 18px. High contrast. Dark theme default.
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --bg-deep:       #0d2347;
  --bg-panel:      #132d5a;
  --bg-card:       #1a3a6b;
  --bg-input:      #0f2040;
  --bg-hover:      #1e4480;
  --bg-user-msg:   #1a3a6b;
  --bg-ai-msg:     #132d5a;

  --accent:        #4fc3f7;
  --accent-dark:   #0288d1;
  --accent-hover:  #81d4fa;
  --green:         #66bb6a;
  --red:           #ef5350;
  --orange:        #ffa726;

  --text-primary:  #e8f0fe;
  --text-secondary:#90b4d4;
  --text-muted:    #5a7fa8;
  --text-inverse:  #0d2347;

  --border:        rgba(79, 195, 247, 0.2);
  --border-strong: rgba(79, 195, 247, 0.5);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --font-base:  18px;
  --font-sm:    15px;
  --font-lg:    20px;
  --font-xl:    24px;
  --font-xxl:   32px;

  --sidebar-w:  300px;
  --header-h:   64px;
  --input-h:    56px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
  --shadow-md:  0 4px 16px rgba(0,0,0,.45);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.55);

  --transition: 0.18s ease;
}

/* ── Light theme ────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-deep:       #e8f0fe;
  --bg-panel:      #d0e4f7;
  --bg-card:       #c2d8f0;
  --bg-input:      #f0f6ff;
  --bg-hover:      #b8d0ea;
  --bg-user-msg:   #1a3a6b;
  --bg-ai-msg:     #f0f6ff;

  --text-primary:  #0d2347;
  --text-secondary:#1a3a6b;
  --text-muted:    #4a6fa8;
  --text-inverse:  #e8f0fe;

  --border:        rgba(26, 58, 107, 0.2);
  --border-strong: rgba(26, 58, 107, 0.5);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: var(--font-base); scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Login page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 40%, #1a3a6b 0%, #0d2347 70%);
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.5rem;
}

.login-title {
  font-size: var(--font-xxl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.login-subtitle {
  font-size: var(--font-base);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: #fff;
  color: #3c4043;
  border: 2px solid #dadce0;
  border-radius: var(--radius-md);
  font-size: var(--font-lg);
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}

.btn-google:hover  { box-shadow: 0 2px 12px rgba(0,0,0,.3); background: #f8f9fa; text-decoration: none; }
.btn-google:active { background: #f1f3f4; }
.btn-google svg    { flex-shrink: 0; }

.login-notice {
  margin-top: 2rem;
  font-size: var(--font-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.login-error {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(239, 83, 80, 0.15);
  border: 1px solid rgba(239, 83, 80, 0.5);
  border-radius: var(--radius-md);
  color: #ef9a9a;
  font-size: var(--font-sm);
  display: none;
}
.login-error.visible { display: block; }

/* ── App shell layout ───────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition);
  z-index: 100;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar-logo { width: 40px; height: 40px; flex-shrink: 0; }

.sidebar-brand     { font-size: var(--font-lg); font-weight: 700; color: var(--accent); line-height: 1.2; }
.sidebar-brand-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.btn-new-chat {
  margin: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--accent-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-new-chat:hover { background: var(--accent); color: var(--text-inverse); }

.sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}
.sessions-list::-webkit-scrollbar       { width: 5px; }
.sessions-list::-webkit-scrollbar-track { background: transparent; }
.sessions-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.session-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
}
.session-item:hover  { background: var(--bg-hover); }
.session-item.active { background: var(--bg-card); border-color: var(--border); }

.session-info  { flex: 1; min-width: 0; }
.session-title { font-size: var(--font-sm); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.session-date  { font-size: 12px; color: var(--text-muted); }

.btn-delete-session {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}
.session-item:hover .btn-delete-session { opacity: 1; }
.btn-delete-session:hover { color: var(--red); }

.sessions-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.user-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.user-name  { font-size: var(--font-sm); font-weight: 600; color: var(--text-primary); }
.user-email { font-size: 12px; color: var(--text-muted); }

.sidebar-actions { display: flex; gap: 0.5rem; }

.btn-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Main chat area ─────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-deep);
}

.chat-header {
  height: var(--header-h);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  background: var(--bg-panel);
}

.btn-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  line-height: 1;
}

.chat-title {
  flex: 1;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-actions { display: flex; gap: 0.5rem; align-items: center; }

.btn-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-header:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Welcome screen ─────────────────────────────────────────── */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  gap: 1.25rem;
}
.welcome-logo  { width: 80px; height: 80px; opacity: 0.8; }
.welcome-title { font-size: var(--font-xl); font-weight: 700; color: var(--accent); }
.welcome-sub   { font-size: var(--font-base); color: var(--text-secondary); max-width: 500px; line-height: 1.7; }

.welcome-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
  max-width: 600px;
}
.suggestion-chip {
  padding: 0.6rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.suggestion-chip:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }

/* ── Messages container ─────────────────────────────────────── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.messages::-webkit-scrollbar       { width: 6px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Message bubbles ────────────────────────────────────────── */
.message {
  display: flex;
  gap: 0.85rem;
  max-width: 820px;
  animation: fadeSlideIn 0.2s ease;
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-top: 2px;
}
.message.user      .message-avatar { background: var(--accent-dark); }
.message.assistant .message-avatar { background: var(--bg-card); border: 1px solid var(--border); }

.message-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }

.message-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.message.user .message-meta { justify-content: flex-end; }

.message-bubble {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-lg);
  font-size: var(--font-base);
  line-height: 1.7;
  word-break: break-word;
}
.message.user      .message-bubble { background: var(--bg-user-msg); border-bottom-right-radius: var(--radius-sm); color: #e8f0fe; }
.message.assistant .message-bubble { background: var(--bg-ai-msg);   border-bottom-left-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Markdown inside bubbles */
.message-bubble p        { margin-bottom: 0.6rem; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble strong   { font-weight: 700; color: var(--accent-hover); }
.message-bubble em       { font-style: italic; }
.message-bubble code     { font-family: 'Consolas', 'Courier New', monospace; font-size: 0.88em; background: rgba(0,0,0,.3); padding: 2px 6px; border-radius: 4px; }
.message-bubble pre      { background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; margin: 0.75rem 0; }
.message-bubble pre code { background: none; padding: 0; font-size: 0.85em; }
.message-bubble ul, .message-bubble ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.message-bubble li       { margin-bottom: 0.3rem; }
.message-bubble h1, .message-bubble h2, .message-bubble h3 { color: var(--accent); margin: 0.75rem 0 0.35rem; font-weight: 700; }
.message-bubble h1 { font-size: var(--font-xl); }
.message-bubble h2 { font-size: var(--font-lg); }
.message-bubble h3 { font-size: var(--font-base); }
.message-bubble blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--text-secondary); margin: 0.5rem 0; }
.message-bubble a  { color: var(--accent); text-decoration: underline; }
.message-bubble hr { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }
.message-bubble table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; font-size: var(--font-sm); }
.message-bubble th, .message-bubble td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; }
.message-bubble th { background: var(--bg-card); color: var(--accent); }

/* File attachment inside message */
.message-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ── Typing indicator ───────────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.9rem 1.15rem;
  background: var(--bg-ai-msg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  width: fit-content;
}
.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ── Input bar ──────────────────────────────────────────────── */
.input-area {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  flex-shrink: 0;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}
.file-preview-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-remove-file {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.btn-remove-file:hover { color: var(--red); }

.input-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
}

.input-wrap {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-end;
  transition: border-color var(--transition);
  overflow: hidden;
}
.input-wrap:focus-within { border-color: var(--accent); }

#message-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: var(--font-base);
  line-height: 1.5;
  resize: none;
  min-height: var(--input-h);
  max-height: 160px;
  overflow-y: auto;
}
#message-input::placeholder { color: var(--text-muted); }

.btn-upload {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.75rem 0.85rem;
  font-size: 20px;
  line-height: 1;
  transition: color var(--transition);
  flex-shrink: 0;
}
.btn-upload:hover { color: var(--accent); }

.btn-send {
  width: var(--input-h);
  height: var(--input-h);
  background: var(--accent-dark);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.btn-send:hover   { background: var(--accent); color: var(--text-inverse); transform: scale(1.05); }
.btn-send:active  { transform: scale(0.97); }
.btn-send:disabled { background: var(--bg-card); color: var(--text-muted); cursor: not-allowed; transform: none; }

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: right;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform var(--transition);
}
.modal-backdrop.open .modal { transform: translateY(0); }

.modal-title {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.modal label {
  display: block;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}
.modal label:first-of-type { margin-top: 0; }

.modal input, .modal textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: var(--font-base);
  outline: none;
  transition: border-color var(--transition);
}
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal textarea { min-height: 80px; resize: vertical; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--accent-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-primary:hover    { background: var(--accent); color: var(--text-inverse); }
.btn-primary:disabled { background: var(--bg-card); color: var(--text-muted); cursor: not-allowed; }

.btn-secondary {
  padding: 0.75rem 1.5rem;
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  padding: 0.75rem 1.5rem;
  background: none;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-danger:hover { background: rgba(239,83,80,.15); }

/* ── PWA install button (sidebar) ───────────────────────────── */
.btn-install-sidebar {
  flex: 2;
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
  font-weight: 600;
}
.btn-install-sidebar:hover { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }

/* ── Toast notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: #fff;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.25s ease;
  max-width: 320px;
}
.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }
.toast.info    { background: var(--accent-dark); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Scrollbar (global) ─────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Responsive — tablet / mobile ──────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  .btn-sidebar-toggle { display: flex; }

  .main { width: 100%; }

  .chat-header { padding: 0 1rem; }

  .messages { padding: 1rem; }

  .input-area { padding: 0.75rem 1rem 1rem; }

  .message { max-width: 100%; }

  .login-card { padding: 2rem 1.5rem; }

  .modal { padding: 1.5rem; }

  .chat-header-actions .btn-header span { display: none; }
}

@media (max-width: 480px) {
  .welcome-suggestions { flex-direction: column; align-items: stretch; }
  .suggestion-chip     { text-align: center; }
}

/* ── Sidebar overlay (mobile) ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── Utility ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.hidden { display: none !important; }
