:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --ink: #1a1d23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1463ff;
  --accent-2: #0f4fcf;
  --bubble-user: #1463ff;
  --bubble-assistant: #ffffff;
  --bubble-spec: #fff8ec;
  --danger: #b42318;
  --shadow: 0 6px 20px rgba(20, 32, 50, .08);
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

button, input, textarea, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--panel-2); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); }
button.primary:hover { background: var(--accent-2); }

input[type=text], textarea, select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
}
textarea { resize: vertical; }

.app { display: grid; grid-template-columns: 290px 1fr; height: 100vh; }

/* Auth pages */
body.auth-body {
  background: linear-gradient(180deg, #f5f6f8 0%, #eef2f9 60%, #e7ecf6 100%);
}

/* Landing (public booking page) */
.landing-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.landing-head {
  display: grid;
  grid-template-columns: 36px auto auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.landing-head .brand-mark { background: var(--accent); color: white; }
.landing-head .brand-title { font-weight: 700; font-size: 16px; line-height: 1.1; }
.landing-head .brand-sub { color: var(--muted); font-size: 12px; }
.landing-head .lang-switch {
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.landing-head .lang-switch .lang-btn { color: var(--muted); }
.landing-head .lang-switch .lang-btn.active { color: white; background: var(--accent); }
.landing-head-cta {
  justify-self: end;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}
.muted-link { color: var(--muted); text-decoration: none; }
.muted-link:hover { color: var(--accent); text-decoration: underline; }
.primary-link {
  background: var(--accent);
  color: white !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.landing-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  display: grid;
  gap: 24px;
}
.landing-hero h1 {
  font-size: 30px;
  margin: 0 0 8px;
  letter-spacing: -0.4px;
}
.landing-hero p { font-size: 15px; line-height: 1.5; max-width: 640px; }

.landing-card .form-card { padding: 24px 26px; }
.landing-card .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 110px;
  gap: 12px;
  margin-bottom: 12px;
}
.landing-card .field-row .field { margin-bottom: 0; display: block; }
.landing-card .field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #344160;
  margin-bottom: 5px;
}
.landing-card input,
.landing-card select,
.landing-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  background: white;
}
.landing-card textarea { font: inherit; line-height: 1.5; min-height: 80px; }
.landing-card input:focus,
.landing-card select:focus,
.landing-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, .15);
}
.landing-card small.muted { display: block; margin-top: 4px; font-size: 11.5px; }
.landing-card #btn-reserve { padding: 11px 22px; font-weight: 600; }

.landing-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.perk {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.perk-icon { font-size: 20px; line-height: 1; }
.perk strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.perk p { margin: 0; font-size: 12.5px; line-height: 1.45; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 30px 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(20, 32, 50, .12);
}
.auth-brand {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.auth-brand .brand-mark { background: var(--accent); color: white; }
.auth-brand .brand-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.auth-brand .brand-sub { color: var(--muted); font-size: 11.5px; }
.auth-brand .lang-switch {
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.auth-brand .lang-switch .lang-btn { color: var(--muted); }
.auth-brand .lang-switch .lang-btn.active { color: white; background: var(--accent); }

.auth-pane h1 { margin: 0 0 4px; font-size: 22px; }
.auth-pane > p.muted { margin: 0 0 18px; font-size: 13px; }
.auth-pane label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #344160;
  margin: 12px 0 5px;
}
.auth-pane input,
.auth-pane select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14px;
  background: white;
}
.auth-pane input:focus,
.auth-pane select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, .15);
}
.auth-pane small.muted { display: block; margin-top: 4px; font-size: 11.5px; }
.auth-pane button[type="submit"].primary {
  width: 100%;
  margin-top: 18px;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 14px;
}
.auth-pane .auth-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.auth-pane .auth-row a { font-size: 12px; }
.auth-pane .auth-status {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
  color: var(--muted);
}
.auth-pane .auth-status.error { color: var(--danger); }
.auth-pane .auth-status.success { color: #047857; }
.auth-switch {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 4px;
  font-weight: 500;
}
.auth-switch a:hover { text-decoration: underline; }
.auth-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
}
.auth-foot a { color: var(--accent); text-decoration: none; }

/* Sidebar */
.sidebar {
  background: #111827;
  color: #e5e7eb;
  padding: 18px 14px;
  display: flex; flex-direction: column;
  gap: 14px;
  overflow: hidden;
}
.brand {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  column-gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-width: 0;
}
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: white; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.brand > div:nth-child(2) { min-width: 0; }
.brand-title { font-weight: 700; letter-spacing: 0.3px; font-size: 14.5px; }
.brand-sub { color: #9ca3af; font-size: 11.5px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid #2f3a4d;
  border-radius: 7px;
  overflow: hidden;
  background: #1f2937;
}
.lang-switch .lang-btn {
  background: transparent;
  border: 0;
  color: #9ca3af;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  border-radius: 0;
}
.lang-switch .lang-btn:hover { background: #243044; color: #e5e7eb; }
.lang-switch .lang-btn.active { background: var(--accent); color: white; }

.section-label { font-size: 11px; letter-spacing: 1.5px; color: #9ca3af; text-transform: uppercase; margin: 6px 4px 4px; }

.new-chat { width: 100%; }

.conv-list { flex: 1; overflow-y: auto; min-height: 80px; padding-right: 2px; }
.conv-list .conv-item {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  margin: 2px 0;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
}
.conv-list .conv-item:hover { background: #1f2937; }
.conv-list .conv-item.active { background: #243044; border-color: #2f3a4d; color: white; }
.conv-list .conv-item .conv-title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-list .conv-item .ts { display: block; font-size: 11px; color: #9ca3af; margin-top: 4px; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.settings-btn {
  flex: 1;
  background: #1f2937;
  color: #e5e7eb;
  border: 1px solid #2f3a4d;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}
.settings-btn:hover { background: #243044; }
.settings-btn .muted { color: #9ca3af; font-size: 11px; }
.logout-btn {
  background: #1f2937;
  color: #9ca3af;
  border: 1px solid #2f3a4d;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  cursor: pointer;
  flex: 0 0 auto;
}
.logout-btn:hover { background: #2a1f1f; color: #fca5a5; border-color: #5b3030; }

/* Settings view */
.settings-main { background: var(--bg); }
.settings-tabs {
  display: flex;
  gap: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
}
.settings-tabs .tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  border-radius: 0;
}
.settings-tabs .tab:hover { background: var(--panel-2); }
.settings-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.settings-body { padding: 22px; overflow-y: auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  width: 100%;
  box-shadow: var(--shadow);
}
.form-card.narrow { max-width: 720px; }
.form-card .field {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}
.form-card .field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.form-card .form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.form-card .form-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.settings-table thead th {
  text-align: left;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.settings-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.settings-table tbody tr:hover { background: var(--panel-2); }
.settings-table .danger {
  background: transparent;
  color: var(--danger);
  border-color: #efc2bd;
  padding: 4px 9px;
  font-size: 12px;
}
.settings-table .danger:hover { background: #fff5f4; }
.settings-table input.inline-rename {
  width: 100%;
  padding: 4px 6px;
  font-size: 13px;
}

/* Main */
.main { display: grid; grid-template-rows: auto auto 1fr auto; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.topbar h1 { margin: 0; font-size: 20px; }
.topbar .muted { color: var(--muted); font-size: 12px; }
.topbar .actions { display: flex; gap: 8px; }

/* Prep-mode banner */
.prep-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #fdfaf0;
  border-bottom: 1px solid #f4e4b8;
  color: #6b4a00;
  font-size: 13px;
}
.prep-banner .prep-icon { font-size: 16px; }
.prep-banner .prep-cta {
  margin-left: auto;
  background: #d97706;
  color: white;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.prep-banner .prep-cta:hover { background: #b45309; }

/* Team strip */
.team-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
}
.team-strip .team-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
}
.team-strip .team-agents {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink);
  cursor: default;
}
.agent-chip.coordinator { border-color: #c8d4ff; background: #eef2ff; }
.agent-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
  flex-shrink: 0;
}
.agent-chip.status-grey  .dot { background: #cbd5e1; }
.agent-chip.status-green .dot { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.20); }
.agent-chip.status-red   .dot { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.20); }
.agent-chip.status-red { color: var(--muted); text-decoration: line-through; }
.agent-chip .provider {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: 1px;
}

.messages {
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--bg);
  display: flex; flex-direction: column;
  gap: 16px;
}

.bubble {
  max-width: min(96%, 1100px);
  padding: 14px 18px;
  border-radius: 12px;
  word-wrap: break-word;
  box-shadow: var(--shadow);
  line-height: 1.6;
}
.bubble.user { margin-left: auto; background: var(--bubble-user); color: white; border-bottom-right-radius: 4px; position: relative; }
.bubble.user .edit-btn {
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(255,255,255,0.18);
  color: white;
  border: 1px solid rgba(255,255,255,0.28);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
}
.bubble.user:hover .edit-btn { opacity: 0.9; }
.bubble.user .edit-btn:hover { opacity: 1; background: rgba(255,255,255,0.32); }
.bubble.user.editing { padding-right: 12px; }
.bubble.user textarea.edit-area {
  width: 100%;
  min-height: 80px;
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}
.bubble.user .edit-actions {
  display: flex; gap: 6px; margin-top: 8px;
  justify-content: flex-end;
}
.bubble.user .edit-actions button {
  background: rgba(255,255,255,0.18);
  color: white;
  border: 1px solid rgba(255,255,255,0.30);
  font-size: 12px;
  padding: 4px 10px;
}
.bubble.user .edit-actions button.primary {
  background: white;
  color: var(--accent);
  border-color: white;
}
.bubble.user .edited-flag {
  display: inline-block;
  margin-top: 6px;
  font-size: 10.5px;
  opacity: 0.75;
  font-style: italic;
}
.bubble.assistant { background: var(--bubble-assistant); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.specialist { background: var(--bubble-spec); border: 1px solid #f0d8a8; border-bottom-left-radius: 4px; max-width: min(94%, 980px); font-size: 13.5px; }
.bubble.specialist .spec-header { font-size: 11px; color: #8a6700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: 700; }
.bubble.error { background: #fff1f0; border: 1px solid #ffb3b3; color: #b42318; }

/* User bubble: preserve newlines (we don't render markdown there) */
.bubble.user .user-text { white-space: pre-wrap; }

/* Markdown content inside assistant + specialist bubbles */
.bubble .md { color: var(--ink); font-size: 14px; line-height: 1.6; }
.bubble .md > *:first-child { margin-top: 0; }
.bubble .md > *:last-child { margin-bottom: 0; }
.bubble .md h1,
.bubble .md h2,
.bubble .md h3,
.bubble .md h4 {
  margin: 18px 0 8px;
  font-weight: 700;
  line-height: 1.3;
}
.bubble .md h1 { font-size: 19px; }
.bubble .md h2 { font-size: 17px; }
.bubble .md h3 { font-size: 15px; }
.bubble .md h4 { font-size: 14px; color: #2b3445; }
.bubble .md p { margin: 8px 0; }
.bubble .md ul,
.bubble .md ol { margin: 8px 0; padding-left: 22px; }
.bubble .md li { margin: 3px 0; }
.bubble .md li > p { margin: 4px 0; }
.bubble .md strong { font-weight: 700; }
.bubble .md em { font-style: italic; }
.bubble .md a { color: var(--accent); text-decoration: underline; }
.bubble .md hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}
.bubble .md blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid #c8d4ff;
  background: #f5f7ff;
  color: #2c3650;
  border-radius: 0 6px 6px 0;
}
.bubble .md code {
  background: #f1f3f7;
  border: 1px solid #e2e6ee;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bubble .md pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 10px 0;
}
.bubble .md pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.bubble .md table {
  border-collapse: collapse;
  margin: 10px 0;
  display: block;
  overflow-x: auto;
  max-width: 100%;
  font-size: 13px;
}
.bubble .md table th,
.bubble .md table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
}
.bubble .md table th {
  background: #f3f5f9;
  font-weight: 600;
}
.bubble .md table tr:nth-child(even) td { background: #fafbfd; }

/* Sources pill row */
.bubble .sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.bubble .sources .src-label {
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  font-size: 10.5px;
}
.bubble .sources .src-pill {
  background: #f1f3f7;
  border: 1px solid #e2e6ee;
  color: #344160;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.bubble .meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.bubble .meta .meta-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  font-size: 10px;
}
.bubble .meta .agent-pill {
  background: #f1f3f7;
  color: #344160;
  border: 1px solid #e2e6ee;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 500;
}
.bubble .meta .agent-pill.coordinator {
  background: #eef2ff;
  border-color: #c8d4ff;
  color: #1f3680;
}

.open-questions {
  margin-top: 14px;
  padding: 13px 16px 14px;
  background: #fdfaf0;
  border: 1px solid #f4e4b8;
  border-left: 3px solid #d97706;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.55;
}
.open-questions .oq-label {
  font-weight: 700;
  color: #8a5a00;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.open-questions .oq-label::before {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  background: #d97706;
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.open-questions ol { margin: 0; padding-left: 22px; color: #2c3650; }
.open-questions li { margin-bottom: 5px; }
.open-questions .oq-actions {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.open-questions .oq-actions button {
  font-size: 12px;
  padding: 5px 11px;
  background: white;
  border: 1px solid #e5d4a3;
  color: #8a5a00;
  border-radius: 7px;
  font-weight: 500;
}
.open-questions .oq-actions button:hover { background: #fdf6e0; border-color: #d97706; }
.open-questions .oq-actions button.primary {
  background: #d97706;
  color: white;
  border-color: #d97706;
  font-weight: 600;
}
.open-questions .oq-actions button.primary:hover { background: #b45309; }

/* Composer */
.composer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 22px 16px;
}
.composer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
}
.composer textarea {
  min-height: 64px;
  max-height: 240px;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
}
.composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, .15);
}
.composer #btn-send {
  padding: 10px 18px;
  font-weight: 600;
}
.upload-btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  user-select: none;
}
.upload-btn:hover { background: white; color: var(--ink); border-color: #c5cdda; }
.composer-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.composer-attachments .chip {
  background: #eef2ff; color: #1f3680; border: 1px solid #c8d4ff;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.composer-attachments .chip button {
  border: 0; background: transparent; padding: 0 0 0 4px; color: #1f3680; cursor: pointer; font-size: 14px;
}
.status { min-height: 20px; margin-top: 8px; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }

/* Typing indicator (animated dots) shown while waiting for a reply */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
}
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: typingPulse 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* Welcome / empty state in the messages area */
.messages-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 40px;
  max-width: 520px;
}
.messages-empty h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--ink);
  font-weight: 600;
}
.messages-empty p {
  margin: 4px 0;
  font-size: 13.5px;
  line-height: 1.5;
}

/* drag overlay */
.dropzone-active { outline: 2px dashed var(--accent); outline-offset: -8px; background: #f0f6ff; }

/* spinner */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid #c8d4ff;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
