/* ═══════════════════════════════════════════
   Komuno – Chatbot UI  (v3)
   ═══════════════════════════════════════════ */

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

:root {
  --font: "Inter", system-ui, -apple-system, sans-serif;

  /* Brand */
  --brand-900: #0a2535;
  --brand-800: #0f3d54;
  --brand-600: #1a6b8a;
  --brand-400: #4a9eba;
  --brand-100: #e4f3f9;
  --brand-50:  #f0f8fc;

  /* Neutrals */
  --bg:       #f7f5f0;
  --surface:  #ffffff;
  --border:   #e5e1d8;
  --border-2: #cdc9be;

  --text:    #1a1916;
  --text-2:  #4a4741;
  --text-3:  #7a766e;
  --text-4:  #aaa69c;

  /* Chat */
  --user-bg:   #e9e6de;
  --user-text: #1a1916;

  /* Sidebar */
  --sb-bg:     #1c1b18;
  --sb-text:   rgba(255,255,255,.7);
  --sb-active: rgba(255,255,255,.12);
  --sb-hover:  rgba(255,255,255,.06);

  /* Sizes */
  --sidebar-w:  220px;
  --content-w:  680px;
  --radius:     16px;
  --radius-sm:  10px;
  --radius-xs:  7px;
}

/* ── Utilities ── */
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important;
}

/* ═══ LAYOUT ═══ */
html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 10px 8px 12px;
  gap: 6px;
  overflow: hidden;
  transition: transform 240ms ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--brand-600), var(--brand-900));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #a8dff0;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xs);
  color: rgba(255,255,255,.65);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: background 130ms, border-color 130ms, color 130ms;
  text-align: left;
}

.new-chat-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.new-chat-btn:hover { background: var(--sb-hover); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.9); }

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.new-chat-btn--ghost {
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.04);
}

.new-chat-btn--ghost:hover {
  background: rgba(255,255,255,.08);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 450;
  color: var(--sb-text);
  text-decoration: none;
  transition: background 130ms, color 130ms;
}

.nav-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.nav-link:hover { background: var(--sb-hover); color: rgba(255,255,255,.9); }
.nav-link.active { background: var(--sb-active); color: rgba(255,255,255,.95); }
.nav-link--sm { font-size: 12px; opacity: .7; }
.nav-link--sm:hover { opacity: 1; }

.sidebar-footer {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: rgba(255,255,255,.55);
  transition: background 130ms, color 130ms;
  flex-shrink: 0;
}

.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--sb-hover); color: rgba(255,255,255,.9); }
.sidebar-close { display: none; }

/* Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 240ms;
}

.sidebar-overlay.is-visible { opacity: 1; }

/* ═══ PANEL ═══ */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-width: 0;
}

/* Mobile topbar */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.topbar .icon-btn { color: var(--text-3); }
.topbar .icon-btn:hover { background: var(--border); color: var(--text); }

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ═══ SCROLL AREA ═══ */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.scroll-area::-webkit-scrollbar { width: 5px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ═══ WELCOME ═══ */
.welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 20px;
  text-align: center;
  animation: fadeUp 300ms ease both;
}

.welcome-body { max-width: 480px; }

.welcome-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-600), var(--brand-900));
  color: #a8dff0;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(15,61,84,.2);
}

.welcome-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.3px;
  margin-bottom: 8px;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text-3);
}

.profile-teaser {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(244,240,231,.96));
  box-shadow: 0 10px 28px rgba(15, 61, 84, .06);
  text-align: left;
}

.profile-teaser-copy h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-teaser-copy p {
  font-size: 13px;
  color: var(--text-3);
}

.profile-teaser-state {
  margin-top: 12px;
}

.profile-summary-empty {
  font-size: 13px;
  color: var(--text-3);
}

.profile-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.profile-pill strong {
  font-weight: 600;
  color: var(--text);
}

.profile-teaser-actions {
  margin-top: 14px;
}

.profile-open-btn {
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 130ms, border-color 130ms, transform 130ms;
}

.profile-open-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
}

.profile-open-btn:active {
  transform: translateY(1px);
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  isolation: isolate;
  pointer-events: none;
}

.profile-modal[hidden] {
  display: none !important;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(17, 18, 19, .48);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

.profile-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(15, 61, 84, .16);
  padding: 22px;
  animation: fadeUp 180ms ease-out both;
  pointer-events: auto;
}

.profile-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-modal-head h2 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.profile-modal-head p {
  font-size: 14px;
  color: var(--text-3);
  max-width: 48ch;
}

.profile-modal-context {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-800);
  font-size: 13px;
  line-height: 1.55;
}

.profile-close {
  color: var(--text-3);
}

.profile-close:hover {
  background: var(--brand-50);
  color: var(--text);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-field.is-recommended span {
  color: var(--brand-800);
}

.profile-field--full {
  grid-column: 1 / -1;
}

.profile-field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.profile-field input,
.profile-field select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--bg);
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
}

.profile-field input:focus,
.profile-field select:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(74, 158, 186, .12);
  background: #fff;
}

.profile-field.is-recommended input,
.profile-field.is-recommended select {
  border-color: rgba(74, 158, 186, .55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 158, 186, .08);
}

.profile-form-note {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.55;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 14px;
  padding: 12px 14px;
}

.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.has-profile-modal {
  overflow: hidden;
}

/* Hide welcome when conversation starts */
body.has-convo .welcome { display: none; }

/* ═══ CHAT LOG ═══ */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 16px 24px 0;
  width: 100%;
}

.log-spacer { height: 32px; }

/* ── Message base ── */
.msg {
  padding: 4px 0;
  animation: fadeUp 180ms ease-out both;
}

/* ── User ── */
.msg-citizen {
  display: flex;
  justify-content: flex-end;
  padding-left: 64px;
}

.msg-citizen .msg-bubble {
  background: var(--user-bg);
  color: var(--user-text);
  padding: 10px 16px;
  border-radius: var(--radius);
  border-bottom-right-radius: 4px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Assistant ── */
.msg-assistant {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
  row-gap: 0;
  padding-right: 32px;
}

.msg-assistant-avatar {
  grid-column: 1;
  grid-row: 1;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--brand-600), var(--brand-900));
  color: #a8dff0;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-assistant .msg-body-wrap {
  grid-column: 2;
}

/* Markdown-rendered body */
.msg-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
}

.msg-body p { margin-bottom: .6em; }
.msg-body p:last-child { margin-bottom: 0; }

.msg-body strong { font-weight: 600; color: var(--text); }

.msg-body ul, .msg-body ol {
  padding-left: 1.4em;
  margin: .4em 0 .6em;
  display: flex;
  flex-direction: column;
  gap: .2em;
}

.msg-body li { line-height: 1.6; }

.msg-body a { color: var(--brand-600); text-decoration: underline; }
.msg-body a:hover { color: var(--brand-800); }

/* Loading cursor */
.msg-loading .msg-body {
  color: var(--text-3);
}

.msg-loading .msg-body::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 15px;
  background: var(--brand-400);
  border-radius: 1px;
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blink 1s steps(1) infinite;
}

/* ── Trust badge ── */
.msg-trust {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trust-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--brand-50);
  color: var(--brand-800);
  border: 1px solid var(--brand-100);
  white-space: nowrap;
}

.trust-detail {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
}

a.trust-detail:hover { text-decoration: underline; }

/* ── Sources ── */
.sources {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.sources-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  list-style: none;
  user-select: none;
}

.sources-toggle::-webkit-details-marker { display: none; }

.sources-chevron {
  font-size: 11px;
  transition: transform 180ms;
  display: inline-block;
}

details[open] .sources-chevron { transform: rotate(180deg); }

.sources-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.source-item {
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.source-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-600);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-link:hover { text-decoration: underline; }

.source-meta {
  font-size: 11px;
  color: var(--text-4);
  margin-top: 1px;
}

.source-excerpt {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Suggestion chips (after message) ── */
.msg-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.suggestion-chip {
  padding: 5px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 130ms, background 130ms;
}

.suggestion-chip:hover { border-color: var(--border-2); background: var(--user-bg); }

/* ── Ticket offer card ── */
.ticket-offer {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.ticket-offer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.ticket-offer-text {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.5;
}

.profile-nudge {
  margin-top: 14px;
  background: linear-gradient(180deg, rgba(240, 248, 252, .98), rgba(255, 255, 255, .96));
  border: 1px solid var(--brand-100);
  border-radius: 14px;
  padding: 14px 16px;
}

.profile-nudge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-nudge-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 10px;
}

.ticket-offer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 7px 16px;
  background: var(--brand-800);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 130ms;
}

.btn-primary:hover { background: var(--brand-900); }

.btn-ghost {
  padding: 7px 16px;
  background: transparent;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 130ms, color 130ms;
}

.btn-ghost:hover { border-color: var(--border-2); color: var(--text-2); }

/* ── Ticket form card (inline in chat) ── */
.ticket-form-card {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.ticket-form-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.ticket-form-card .form-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full { grid-column: 1 / -1; }

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-field input,
.form-field textarea,
.form-field select {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 11px;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  width: 100%;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(74,158,186,.14);
  background: var(--surface);
}

.form-field textarea { resize: vertical; min-height: 80px; }

.form-field .field-err {
  font-size: 12px;
  color: #c0392b;
  display: none;
}

.form-field.has-error .field-err { display: block; }
.form-field.has-error input,
.form-field.has-error textarea,
.form-field.has-error select { border-color: #e74c3c; }

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  cursor: pointer;
}

.form-consent input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand-600);
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Ticket success card ── */
.ticket-success {
  margin-top: 14px;
  background: #f0faf4;
  border: 1px solid #b7e0c6;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.ticket-success-icon {
  font-size: 22px;
  margin-bottom: 8px;
}

.ticket-success h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1a5c35;
  margin-bottom: 6px;
}

.ticket-success p {
  font-size: 13px;
  color: #2d7a50;
  line-height: 1.55;
  margin-bottom: 6px;
}

.ticket-id-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #b7e0c6;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: monospace;
  font-size: 13px;
  color: #1a5c35;
  margin: 6px 0;
  cursor: pointer;
  transition: background 130ms;
}

.ticket-id-box:hover { background: #e8f8ef; }
.ticket-id-box span { font-size: 11px; color: #5a9c72; }

/* ═══ COMPOSER ZONE ═══ */
.composer-zone {
  flex-shrink: 0;
  background: var(--bg);
  padding: 0 24px 16px;
}

/* Example chips */
.chips-row {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: var(--content-w);
  margin: 0 auto 10px;
}

body:not(.has-convo) .chips-row { display: flex; }

.chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: border-color 130ms, box-shadow 130ms;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.chip:hover { border-color: var(--border-2); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.chip-title { font-size: 13px; font-weight: 600; color: var(--text); }
.chip-hint  { font-size: 12px; color: var(--text-3); }

/* Composer wrap */
.composer-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  padding: 11px 11px 11px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: border-color 140ms, box-shadow 140ms;
}

.composer:focus-within {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(74,158,186,.13), 0 2px 12px rgba(0,0,0,.07);
}

.composer-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  resize: none;
  max-height: 180px;
  min-height: 24px;
  line-height: 1.55;
}

.composer-input::placeholder { color: var(--text-4); }

.send-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 130ms, transform 80ms, opacity 140ms;
  opacity: .25;
}

.send-btn.is-ready    { opacity: 1; }
.send-btn.is-streaming { opacity: 1; background: #c0392b; }
.send-btn:active { transform: scale(.92); }

.send-icon { width: 14px; height: 14px; }
.send-icon--send { display: block; }
.send-icon--stop { display: none; }
.send-btn.is-streaming .send-icon--send { display: none; }
.send-btn.is-streaming .send-icon--stop { display: block; }

.composer-hint {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--text-4);
  text-align: center;
  line-height: 1.5;
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 780px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }

  .sidebar.is-open { transform: translateX(0); }
  .sidebar.is-open .sidebar-close { display: flex; }
  .sidebar-overlay { display: block; }

  .topbar { display: flex; }

  .chat-log { padding: 12px 16px 0; }
  .composer-zone { padding: 0 12px 14px; }
  .msg-assistant { padding-right: 0; }
  .msg-citizen { padding-left: 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-modal { padding: 16px; }
  .profile-modal-dialog { padding: 18px; }
}

@media (max-width: 480px) {
  .welcome { padding: 40px 16px 12px; }
  .welcome-title { font-size: 20px; }
  .chip { min-width: 0; flex: 1 1 calc(50% - 4px); }
  .composer { border-radius: var(--radius-sm); }
  .profile-teaser { padding: 14px; }
  .profile-modal-head h2 { font-size: 19px; }
}
