@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

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

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:        #0a0c12;
  --surface:   #10131c;
  --surface2:  #161a26;
  --surface3:  #1e2333;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.14);
  --text:      #eef2ff;
  --muted:     #8891aa;
  --soft:      #555e78;
  --accent:    #7c6af7;
  --accent2:   #a78bfa;
  --glow:      rgba(124,106,247,0.25);
  --pink:      #f472b6;
  --teal:      #2dd4bf;
  --danger:    #ef4444;
  --success:   #22c55e;
  --font-head: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --radius-pill: 999px;
  --radius-lg:   20px;
  --radius-md:   14px;
  --radius-sm:   10px;
  --sidebar-w:   280px;
  --topbar-h:    64px;
}

:root[data-theme="light"] {
  --bg:       #f0f2f9;
  --surface:  #ffffff;
  --surface2: #f5f6fb;
  --surface3: #eaecf5;
  --border:   rgba(0,0,0,0.07);
  --border2:  rgba(0,0,0,0.13);
  --text:     #111322;
  --muted:    #5a6080;
  --soft:     #8890aa;
}

:root[data-font-size="sm"] { --chat-font: 0.9rem; }
:root[data-font-size="md"] { --chat-font: 1rem; }
:root[data-font-size="lg"] { --chat-font: 1.1rem; }
:root[data-reduce-motion="true"] * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ─── BASE ───────────────────────────────────────────────── */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mobile-only { display: none !important; }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast-host {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-pill);
  background: var(--surface2); border: 1px solid var(--border2);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease;
}
.toast.success { border-color: rgba(34,197,94,0.4); color: #86efac; }
.toast.error   { border-color: rgba(239,68,68,0.4);  color: #fca5a5; }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ─── SIDEBAR OVERLAY ────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  z-index: 15;
}
.sidebar-overlay.visible { display: block; }

/* ─── AUTH VIEW ──────────────────────────────────────────── */
.auth-view {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 60% 20%, rgba(124,106,247,0.12) 0%, transparent 60%),
              var(--bg);
}

.auth-card {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,106,247,0.1);
}

.auth-brand {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
}

.brand-orb {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #fff;
  box-shadow: 0 0 24px var(--glow);
}

.brand-text strong { font-family: var(--font-head); font-weight: 700; font-size: 17px; display: block; }
.brand-text span   { font-size: 13px; color: var(--muted); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 5px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  margin-bottom: 22px;
}

.auth-tab {
  border: none; border-radius: var(--radius-pill);
  min-height: 36px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px var(--glow);
}

.auth-form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

.field input,
.field select {
  width: 100%; min-height: 44px;
  border: 1px solid var(--border2); border-radius: var(--radius-md);
  background: var(--surface2); color: var(--text);
  padding: 0 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.form-row { display: flex; gap: 10px; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.primary-btn, .secondary-btn, .danger-btn, .link-btn, .icon-btn, .send-btn {
  border: 1px solid transparent; border-radius: var(--radius-pill);
  min-height: 40px; padding: 0 18px;
  cursor: pointer; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s; background: transparent;
}
.primary-btn {
  background: linear-gradient(135deg, var(--accent), #6254e8);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 20px var(--glow);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 28px var(--glow); }
.secondary-btn {
  background: var(--surface2); border-color: var(--border2); color: var(--text);
}
.secondary-btn:hover { background: var(--surface3); border-color: var(--border2); }
.danger-btn {
  background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}
.danger-btn:hover { background: rgba(239,68,68,0.18); }
.link-btn { border: none; color: var(--accent2); min-height: auto; padding: 0; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md);
  background: var(--surface2); border-color: var(--border);
  color: var(--muted);
}
.icon-btn:hover { border-color: var(--border2); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.full { width: 100%; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.auth-status {
  padding: 14px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124,106,247,0.12), rgba(244,114,182,0.06));
  border: 1px solid rgba(124,106,247,0.25);
}
.auth-status strong { display: block; font-size: 15px; margin-bottom: 4px; }
.auth-status span   { display: block; font-size: 13px; color: var(--muted); }

.auth-message {
  min-height: 22px; margin-top: 14px;
  font-size: 13px; color: var(--muted);
}
.auth-message.error   { color: #fca5a5; }
.auth-message.success { color: #86efac; }

/* ─── APP LAYOUT ─────────────────────────────────────────── */
.app-layout {
  height: 100dvh; display: flex; overflow: hidden;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 20;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brand-text strong { font-family: var(--font-head); font-weight: 700; font-size: 15px; display: block; }
.brand-text span   { font-size: 12px; color: var(--muted); }

.new-chat-btn {
  margin: 0 16px 18px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), #6254e8);
  border: none; color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 8px; justify-content: center;
  box-shadow: 0 4px 20px var(--glow);
  transition: all 0.2s;
}
.new-chat-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 28px var(--glow); }
.new-chat-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; }

.chat-section-label {
  padding: 0 20px 8px;
  font-size: 11px; font-weight: 600; color: var(--soft);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.chat-list {
  flex: 1; overflow-y: auto; padding: 0 10px;
}
.chat-list::-webkit-scrollbar { width: 4px; }
.chat-list::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

.empty-list { padding: 14px 12px; color: var(--muted); font-size: 13px; }

.chat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  cursor: pointer; margin-bottom: 3px;
  border: 1px solid transparent;
  transition: all 0.18s;
}
.chat-item:hover { background: var(--surface2); }
.chat-item.active {
  background: linear-gradient(135deg, rgba(124,106,247,0.15), rgba(167,139,250,0.06));
  border-color: rgba(124,106,247,0.25);
}

.chat-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface3); flex-shrink: 0;
  transition: background 0.2s;
}
.chat-item.active .chat-dot { background: var(--accent); box-shadow: 0 0 6px var(--glow); }

.chat-item-inner { min-width: 0; flex: 1; }
.chat-item-inner span { display: block; font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-item-inner small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.chat-remove { background: none; border: none; color: var(--soft); cursor: pointer; padding: 2px 4px; border-radius: 6px; font-size: 16px; line-height: 1; }
.chat-remove:hover { color: var(--danger); }

.sidebar-footer {
  padding: 14px 14px 0;
  border-top: 1px solid var(--border);
  margin-top: 10px; display: grid; gap: 10px;
}

.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color 0.18s;
}
.user-pill:hover { border-color: var(--border2); }

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
}

.user-info { min-width: 0; flex: 1; }
.user-info strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-info span   { display: block; font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.footer-actions { display: flex; gap: 8px; }
.footer-actions .icon-btn { flex: 1; }

/* ─── TOPBAR ─────────────────────────────────────────────── */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,12,18,0.7); backdrop-filter: blur(20px);
  z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }

.menu-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text); flex-shrink: 0;
}
.menu-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.chat-title { font-family: var(--font-head); font-weight: 600; font-size: 17px; }

.status-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.2);
  font-size: 12px; font-weight: 500; color: var(--teal);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); animation: blink 2.4s infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.25; } }

/* ─── CHAT FEED ──────────────────────────────────────────── */
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px 24px; }
.chat-scroll::-webkit-scrollbar { width: 4px; }
.chat-scroll::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

.chat-feed { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* Welcome */
.welcome-state {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.welcome-glow {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 34px; color: #fff;
  box-shadow: 0 0 40px var(--glow), 0 0 80px rgba(244,114,182,0.1);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.welcome-state h1 {
  font-family: var(--font-head); font-weight: 700; font-size: 38px;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-state p { color: var(--muted); font-size: 15px; max-width: 440px; line-height: 1.65; }

.suggestion-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.chip {
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-size: 13px; cursor: pointer;
  transition: all 0.18s;
}
.chip:hover { background: var(--surface3); border-color: rgba(124,106,247,0.4); transform: translateY(-1px); }

/* Messages */
.message-row { display: flex; gap: 10px; align-items: flex-end; }
.message-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.message-row.user .msg-avatar      { background: linear-gradient(135deg, var(--teal), var(--accent)); color: #fff; }
.message-row.assistant .msg-avatar { background: linear-gradient(135deg, var(--accent), var(--pink)); color: #fff; }

.bubble {
  max-width: 74%; padding: 14px 18px; font-size: var(--chat-font, 1rem);
  line-height: 1.65; word-break: break-word;
}
.message-row.user .bubble {
  background: linear-gradient(135deg, var(--accent), #6254e8);
  color: #fff; border-radius: 22px 22px 6px 22px;
  box-shadow: 0 4px 20px var(--glow);
}
.message-row.assistant .bubble {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 22px 22px 22px 6px;
}
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble-time { display: block; margin-top: 6px; font-size: 10px; opacity: 0.45; }

/* Typing */
.typing-row .bubble { padding: 14px 18px; }
.typing-dots { display: flex; gap: 5px; align-items: center; height: 20px; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: tdot 1.3s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot { 0%,80%,100% { transform:translateY(0); opacity:0.35; } 40% { transform:translateY(-5px); opacity:1; } }

/* ─── INPUT ──────────────────────────────────────────────── */
.input-zone {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  background: rgba(10,12,18,0.75); backdrop-filter: blur(20px);
}

.input-wrap {
  max-width: 780px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 8px 8px 18px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 28px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.input-wrap:focus-within {
  border-color: rgba(124,106,247,0.5);
  box-shadow: 0 4px 30px var(--glow);
}

#chatInput {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; resize: none;
  max-height: 160px; min-height: 32px; line-height: 1.5;
  font-family: var(--font-body); padding: 5px 0;
}
#chatInput::placeholder { color: var(--soft); }

.send-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; padding: 0;
  background: linear-gradient(135deg, var(--accent), #6254e8);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px var(--glow);
  transition: all 0.2s;
}
.send-btn:hover:not(:disabled) { transform: scale(1.06); box-shadow: 0 6px 24px var(--glow); }
.send-btn svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ─── SETTINGS PANEL ─────────────────────────────────────── */
.settings-panel {
  position: fixed; top: 0; right: 0;
  width: min(100%, 460px); height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0,0,0,0.4);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  z-index: 50; display: flex; flex-direction: column;
}
.settings-panel.open { transform: translateX(0); }

.panel-header {
  min-height: var(--topbar-h); padding: 0 16px 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.panel-header strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.panel-header > span > span { display: block; font-size: 12px; color: var(--muted); }

.panel-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 8px; gap: 6px;
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.panel-tab {
  border: none; border-radius: var(--radius-pill);
  min-height: 34px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: all 0.18s;
}
.panel-tab.active { background: var(--surface3); color: var(--text); border: 1px solid var(--border2); }

.panel-section { display: none; overflow-y: auto; padding: 18px; gap: 14px; }
.panel-section.active { display: grid; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sw); border: 2px solid transparent; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-md);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; font-weight: 500; font-size: 14px; gap: 14px;
}
.toggle-row input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

.security-intro {
  padding: 14px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124,106,247,0.1), rgba(124,106,247,0.03));
  border: 1px solid rgba(124,106,247,0.2);
}
.security-intro strong { display: block; margin-bottom: 4px; font-size: 14px; }
.security-intro span   { font-size: 13px; color: var(--muted); }

.security-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--surface2); border: 1px solid var(--border);
}
.security-card strong { display: block; font-size: 14px; margin-bottom: 3px; }
.security-card span   { font-size: 13px; color: var(--muted); display: block; }

.setup-box {
  display: grid; gap: 12px; padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface2); border: 1px solid var(--border);
}

.danger-zone {
  display: grid; gap: 12px; padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.25);
}
.danger-zone > strong { color: #fca5a5; font-size: 15px; }
.danger-zone > span   { font-size: 13px; color: var(--muted); }

.backup-codes { padding: 14px; border-radius: var(--radius-md); background: var(--surface2); border: 1px solid var(--border); }
.backup-codes strong { display: block; margin-bottom: 10px; font-size: 14px; }
.backup-codes div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.backup-codes code { padding: 8px; border-radius: var(--radius-sm); background: var(--bg); text-align: center; font-size: 13px; }

.devices-head { display: flex; gap: 8px; }
.device-list { display: grid; gap: 10px; }
.device-item {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--surface2); border: 1px solid var(--border);
}
.device-item > div { min-width: 0; }
.device-item strong,
.device-item span,
.device-item small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.device-item span  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.device-item small { font-size: 11px; color: var(--soft); margin-top: 2px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .mobile-only { display: flex !important; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 20;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }

  .topbar { padding: 0 14px; }
  .chat-scroll { padding: 16px; }
  .input-zone { padding: 10px 14px 14px; }
  .auth-card { padding: 20px; }
  .welcome-state h1 { font-size: 26px; }
  .bubble { max-width: 90%; }
  #chatInput { font-size: 16px; } /* prevents iOS zoom */
}