/* ============================================================
   Cooper UI — CultureMonkey Design System
   Brand: #55CE97 (mint), #074e39 (forest green), #111016 (dark)
   ============================================================ */

/* ── Auth Gate ───────────────────────────────────────────── */
.auth-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #074e39 0%, #0a7a57 50%, #55CE97 100%);
  font-family: 'IBM Plex Sans', sans-serif;
}
.auth-card {
  background: #fff; border-radius: 20px; padding: 48px 40px;
  width: 380px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.auth-logo { margin-bottom: 16px; }
.auth-title {
  font-size: 24px; font-weight: 700; color: #1d1f1d; margin: 0 0 4px;
}
.auth-subtitle {
  font-size: 14px; color: #5F7268; margin: 0 0 28px;
}
.auth-field { margin-bottom: 14px; }
.auth-field input {
  width: 100%; padding: 12px 16px; border: 1.5px solid #E4EAE6;
  border-radius: 10px; font-size: 15px; font-family: inherit;
  background: #FAFAFA; outline: none; box-sizing: border-box;
  transition: border-color 0.2s;
}
.auth-field input:focus {
  border-color: #55CE97; background: #fff;
}
.auth-error {
  color: #d44; font-size: 13px; margin: 0 0 12px; min-height: 18px;
}
.auth-btn {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #074e39, #0a7a57);
  color: #fff; font-size: 16px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: opacity 0.2s;
}
.auth-btn:hover { opacity: 0.9; }
.auth-btn:active { opacity: 0.8; }

:root {
  /* Brand */
  --brand-primary:       #55CE97;
  --brand-primary-dark:  #074e39;
  --brand-primary-mid:   #0a7a57;
  --brand-ghost:         rgba(85, 206, 151, 0.08);
  --brand-border:        rgba(85, 206, 151, 0.25);
  --brand-glow:          rgba(85, 206, 151, 0.20);

  /* Sidebar */
  --sidebar-bg:          #111016;
  --sidebar-hover:       rgba(85, 206, 151, 0.10);
  --sidebar-active:      rgba(85, 206, 151, 0.18);
  --sidebar-text:        rgba(255,255,255,0.75);
  --sidebar-text-dim:    rgba(255,255,255,0.35);
  --sidebar-divider:     rgba(255,255,255,0.07);
  --sidebar-width:       264px;

  /* Chat */
  --chat-bg:             #FFFFFF;
  --header-bg:           #FAFAFA;
  --header-border:       #EFEFEF;

  /* Messages */
  --msg-user-bg:         #074e39;
  --msg-user-text:       #FFFFFF;
  --msg-cooper-bg:       #F3F5F4;
  --msg-cooper-text:     #1d1f1d;
  --msg-error-bg:        #FEF2F2;
  --msg-error-text:      #DC2626;
  --msg-error-border:    #FECACA;

  /* Neutrals */
  --gray-50:   #FAFAFA;
  --gray-100:  #F3F5F4;
  --gray-200:  #E4EAE6;
  --gray-300:  #C8D4CC;
  --gray-400:  #8FA698;
  --gray-500:  #5F7268;
  --gray-700:  #2d3d35;
  --gray-900:  #1d1f1d;

  /* Typography */
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.14);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--sidebar-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================ App Shell */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================ Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-divider);
  transition: transform 0.25s ease;
  overflow: hidden;
}

/* Sidebar — Header */
.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

.cooper-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  justify-content: space-between;
}

.cm-logo-img {
  height: 28px;
  width: auto;
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--brand-primary);
  color: var(--brand-primary-dark);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px var(--brand-glow);
}

.new-chat-btn:hover {
  opacity: 0.90;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--brand-glow);
}

.new-chat-btn:active { transform: translateY(0); }

/* Sidebar — Workspace Config */
.sidebar-workspace {
  padding: 14px 16px;
  border-bottom: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

.config-field {
  margin-bottom: 10px;
}

.config-field:last-child { margin-bottom: 0; }

.config-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
}

.config-input, .config-select {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--sidebar-divider);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.85);
  font-family: var(--font);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.config-input::placeholder { color: var(--sidebar-text-dim); }

.config-input:focus, .config-select:focus {
  border-color: var(--brand-primary);
  background: rgba(85, 206, 151, 0.07);
}

.config-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2355CE97' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.config-select option { background: #18181d; }

/* Sidebar — Conversations */
.sidebar-conversations {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  min-height: 0;
}

.conversations-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 8px;
  margin-bottom: 6px;
}

.conversation-list { display: flex; flex-direction: column; gap: 2px; }

.conv-empty-state {
  padding: 16px 8px;
  font-size: 12px;
  color: var(--sidebar-text-dim);
  text-align: center;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  min-width: 0;
  position: relative;
}

.conv-item:hover { background: var(--sidebar-hover); }

.conv-item.active { background: var(--sidebar-active); }

.conv-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(85, 206, 151, 0.12);
  color: rgba(85, 206, 151, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.conv-item.active .conv-icon {
  background: rgba(85, 206, 151, 0.2);
  color: var(--brand-primary);
}

.conv-info { min-width: 0; flex: 1; }

.conv-title {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.conv-item.active .conv-title { color: #FFFFFF; }

.conv-date {
  font-size: 10.5px;
  color: var(--sidebar-text-dim);
  margin-top: 1px;
}

.conv-delete-btn {
  opacity: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.conv-item:hover .conv-delete-btn { opacity: 1; }

.conv-delete-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

/* Sidebar — Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-divider);
  flex-shrink: 0;
}

.footer-text {
  font-size: 11px;
  color: var(--sidebar-text-dim);
}

/* Sidebar scrollbar */
.sidebar-conversations::-webkit-scrollbar { width: 4px; }
.sidebar-conversations::-webkit-scrollbar-track { background: transparent; }
.sidebar-conversations::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

/* ============================================================ Main Chat */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  overflow: hidden;
  min-width: 0;
}

/* ============================================================ Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  height: 52px;
  position: relative;
  z-index: 10;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--gray-200);
  flex-shrink: 0;
  margin: 0 2px;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.chat-session-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

.home-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.home-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--brand-primary-dark);
}

.header-survey-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-primary-dark);
  background: linear-gradient(135deg, rgba(85,206,151,0.1), rgba(85,206,151,0.05));
  border: 1px solid rgba(85, 206, 151, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  max-width: 180px;
  flex-shrink: 0;
  overflow: hidden;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-ghost);
}

/* ============================================================ Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 24px 40px;
  background: linear-gradient(180deg, rgba(85,206,151,0.035) 0%, transparent 40%);
}

.welcome-content {
  max-width: 580px;
  width: 100%;
  text-align: center;
}

/* ── Cooper Avatar ────────────────────────────────────── */
.welcome-avatar-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(85,206,151,0.15), rgba(85,206,151,0.05));
  border: 2px solid rgba(85,206,151,0.2);
  margin-bottom: 20px;
  animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(85,206,151,0.15); }
  50%      { box-shadow: 0 0 0 8px rgba(85,206,151,0); }
}

.welcome-avatar-inner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #55CE97, #3bb87e);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(85,206,151,0.3);
}

.welcome-hero-greeting {
  font-size: 30px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.welcome-cooper-intro {
  font-size: 18px;
  font-weight: 400;
  color: var(--gray-500);
}

.welcome-cooper-intro .highlight {
  color: var(--brand-primary-dark);
  font-weight: 600;
}

/* ── Step Headers ─────────────────────────────────────── */
.welcome-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary-dark);
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: -0.01em;
}

/* ── Welcome Survey Cards ─────────────────────────────── */
.welcome-step {
  margin-top: 28px;
  text-align: left;
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.02);
}

.welcome-survey-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.welcome-survey-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.welcome-survey-card:hover {
  border-color: var(--brand-primary);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(85, 206, 151, 0.12);
  transform: translateY(-1px);
}

.welcome-survey-card.ws-selected {
  border-color: #55CE97;
  background: rgba(85, 206, 151, 0.04);
  box-shadow: 0 0 0 1.5px #55CE97, 0 2px 8px rgba(85, 206, 151, 0.1);
}

.welcome-survey-card.ws-running {
  border-left: 3.5px solid #55CE97;
  background: var(--white);
}

.ws-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-card-meta {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
  padding-left: 1px;
}

/* ── Survey Selected Confirmation ─────────────────────── */
.welcome-selected-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(85, 206, 151, 0.07), rgba(85, 206, 151, 0.02));
  border: 1px solid rgba(85, 206, 151, 0.18);
  animation: fadeSlideIn 0.25s ease;
}

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

.ws-selected-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #55CE97, #3bb87e);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(85, 206, 151, 0.25);
}

.ws-selected-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-primary-dark);
}

/* ── Other Survey Link & List ─────────────────────────── */
.ws-other-survey {
  margin-top: 14px;
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.ws-other-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-400);
  text-decoration: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.15s ease;
}

.ws-other-link svg {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.ws-other-link:hover {
  color: var(--brand-primary-dark);
  background: rgba(85, 206, 151, 0.06);
}

.ws-other-link:hover svg {
  opacity: 1;
}

.ws-all-surveys {
  margin-top: 12px;
  text-align: left;
  animation: fadeSlideIn 0.2s ease;
}

.ws-all-surveys .welcome-survey-list,
.ws-all-surveys-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.welcome-account-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary-dark);
  background: rgba(85, 206, 151, 0.12);
  border: 1px solid rgba(85, 206, 151, 0.3);
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.cm-account-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-primary-dark);
  background: rgba(85,206,151,0.15);
  border: 1px solid rgba(85,206,151,0.4);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.welcome-subtitle {
  font-size: 14px;
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.welcome-datetime {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.welcome-quote {
  font-style: italic;
  color: var(--gray-500);
  font-size: 13.5px;
  line-height: 1.55;
}

.welcome-quote-author {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
}

.suggested-prompts {
  margin-top: 24px;
  text-align: left;
  animation: fadeSlideIn 0.3s ease;
}

.prompts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prompt-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: var(--font);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.prompt-chip:hover {
  background: var(--white);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(85, 206, 151, 0.12);
}

.prompt-chip:active { transform: translateY(0); box-shadow: none; }

.prompt-chip-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(85,206,151,0.1), rgba(85,206,151,0.04));
  border-radius: 10px;
  border: 1px solid rgba(85,206,151,0.12);
}

.prompt-chip-text {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-700);
  line-height: 1.4;
}

/* ============================================================ Messages Area */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  background: var(--white);
  scroll-behavior: smooth;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* Message */
.message {
  display: flex;
  gap: 14px;
  animation: msgIn 0.3s ease-out;
  max-width: 100%;
}

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

.message.user { flex-direction: row-reverse; }

/* Avatar */
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.message.user .msg-avatar {
  background: linear-gradient(135deg, var(--brand-primary-dark), #0a5e40);
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  box-shadow: 0 1px 4px rgba(7,78,57,0.2);
}

.message.cooper .msg-avatar {
  background: linear-gradient(135deg, #55CE97, #3bb87e);
  color: white;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 6px rgba(85,206,151,0.3);
}

/* Bubble body wrapper */
.msg-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 75%;
  min-width: 0;
  overflow: hidden;
}

.message.user .msg-body { align-items: flex-end; }
.message.cooper .msg-body { align-items: flex-start; }

/* Bubble */
.msg-bubble {
  padding: 16px 20px;
  border-radius: 18px;
  line-height: 1.65;
  font-size: 14px;
  letter-spacing: -0.006em;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  overflow: hidden;
}

.message.user .msg-bubble {
  background: linear-gradient(135deg, var(--brand-primary-dark), #0a6b4a);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(7, 78, 57, 0.15);
  font-weight: 400;
  letter-spacing: 0;
}

.message.cooper .msg-bubble {
  background: var(--white);
  color: var(--gray-700);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

/* Message timestamp + response time */
.msg-meta {
  font-size: 10.5px;
  color: var(--gray-400);
  letter-spacing: 0.02em;
  padding: 0 4px;
  user-select: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message:hover .msg-meta {
  opacity: 1;
}

.message.user .msg-meta { text-align: right; }
.message.cooper .msg-meta { text-align: left; }

.message.error .msg-bubble {
  background: var(--msg-error-bg);
  color: var(--msg-error-text);
  border: 1px solid var(--msg-error-border);
  border-bottom-left-radius: 4px;
}

/* Markdown inside Cooper bubbles */
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3,
.msg-bubble h4, .msg-bubble h5, .msg-bubble h6 {
  margin: 18px 0 8px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.msg-bubble h1:first-child, .msg-bubble h2:first-child, .msg-bubble h3:first-child {
  margin-top: 2px;
}

.msg-bubble h1 { font-size: 17px; border-bottom: 1px solid var(--gray-200); padding-bottom: 10px; }
.msg-bubble h2 { font-size: 15.5px; }
.msg-bubble h3 { font-size: 14px; color: var(--brand-primary-dark); font-weight: 600; letter-spacing: 0; }

.msg-bubble p {
  margin: 8px 0;
  color: var(--gray-700);
  line-height: 1.6;
}
.msg-bubble p:first-child { margin-top: 0; }
.msg-bubble p:last-child { margin-bottom: 0; }

.msg-bubble ul, .msg-bubble ol {
  padding-left: 22px;
  margin: 10px 0;
}

.msg-bubble li {
  margin: 6px 0;
  line-height: 1.6;
  color: var(--gray-700);
}

.msg-bubble li::marker {
  color: #55CE97;
}

.msg-bubble strong {
  font-weight: 700;
  color: var(--gray-900);
}
.msg-bubble em { font-style: italic; color: var(--gray-500); }

/* Inline code */
.msg-bubble code {
  background: rgba(85,206,151,0.06);
  color: var(--brand-primary-dark);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  border: 1px solid rgba(85,206,151,0.1);
  font-weight: 500;
}

/* Code blocks */
.msg-bubble pre {
  background: #0d1f17;
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(85,206,151,0.08);
}

.msg-bubble pre code {
  background: transparent;
  color: #7ee8b0;
  padding: 0;
  font-size: 0.84em;
  border: none;
  font-weight: 400;
  line-height: 1.7;
}

/* Blockquotes / Quotes */
.msg-bubble blockquote {
  border-left: 3px solid #55CE97;
  padding: 10px 16px;
  margin: 12px 0;
  color: var(--gray-500);
  font-style: italic;
  font-size: 13px;
  background: rgba(85,206,151,0.04);
  border-radius: 0 10px 10px 0;
  line-height: 1.55;
}

/* Tables */
.msg-bubble .table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  -webkit-overflow-scrolling: touch;
  background: var(--white);
}

.msg-bubble table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
  line-height: 1.5;
}

.msg-bubble th, .msg-bubble td {
  padding: 11px 16px;
  text-align: left;
}

.msg-bubble th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}

.msg-bubble td {
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Highlight numeric values */
.msg-bubble td:not(:first-child) {
  font-weight: 500;
  color: var(--gray-900);
}

.msg-bubble tr:hover td { background: rgba(85,206,151,0.025); }
.msg-bubble tr:last-child td { border-bottom: none; }

/* Alternating row shading */
.msg-bubble tr:nth-child(even) td { background: rgba(0,0,0,0.012); }
.msg-bubble tr:nth-child(even):hover td { background: rgba(85,206,151,0.03); }

.msg-bubble hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gray-200), transparent);
  margin: 18px 0;
}

/* ── Download buttons ─────────────────────────────────── */
.table-download-bar {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 12px 12px;
}

.table-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-500);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-dl-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary-dark);
  background: rgba(85,206,151,0.04);
}

.img-download-wrap {
  position: relative;
  display: inline-block;
}

.img-download-wrap img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
}

.img-dl-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

.img-download-wrap:hover .img-dl-btn {
  opacity: 1;
}

.img-dl-btn:hover {
  background: rgba(0,0,0,0.7);
}

/* Streaming cursor */
.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--brand-primary);
  border-radius: 1px;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

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

/* Link + copy button */
.link-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(85, 206, 151, 0.04);
  border: 1px solid rgba(85, 206, 151, 0.12);
  border-radius: 8px;
  padding: 4px 6px 4px 10px;
  margin: 2px 0;
  transition: all 0.15s ease;
}

.link-wrap:hover {
  background: rgba(85, 206, 151, 0.08);
  border-color: rgba(85, 206, 151, 0.25);
}

.link-wrap a {
  color: var(--brand-primary-dark) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 13px;
}

.link-wrap a:hover {
  text-decoration: underline !important;
}

.link-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.link-copy-btn:hover {
  color: var(--brand-primary-dark);
  background: rgba(85, 206, 151, 0.1);
}

.link-copy-btn.copied {
  color: var(--brand-primary);
  background: rgba(85, 206, 151, 0.12);
}

.copy-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  animation: tooltipIn 0.2s ease;
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--gray-900);
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Message user — markdown overrides */
.message.user .msg-bubble p,
.message.user .msg-bubble li { color: rgba(255,255,255,0.92); }
.message.user .msg-bubble strong { color: #fff; }
.message.user .msg-bubble code {
  background: rgba(255,255,255,0.1);
  color: #c3f0da;
  border-color: rgba(255,255,255,0.08);
}

/* ============================================================ Typing Indicator */
.typing-container {
  padding: 8px 0 4px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.typing-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.typing-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #55CE97, #3bb87e);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(85,206,151,0.3);
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 18px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30%            { transform: translateY(-4px); opacity: 1; }
}

/* ============================================================ Input Bar */
.input-bar {
  padding: 10px 20px 14px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 16px;
  padding: 8px 8px 8px 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.input-wrapper:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(85,206,151,0.1), 0 2px 8px rgba(0,0,0,0.04);
  background: white;
}

#message-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 0;
}

#message-input::placeholder { color: var(--gray-400); }

#message-input:disabled { color: var(--gray-400); cursor: not-allowed; }

#send-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--brand-primary-dark), #0a6b4a);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(7, 78, 57, 0.25);
}

#send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(7, 78, 57, 0.3);
}

#send-button:active:not(:disabled) { transform: translateY(0); box-shadow: 0 1px 4px rgba(7,78,57,0.2); }

#send-button:disabled {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  box-shadow: none;
}

.input-hint {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 8px;
}

/* ============================================================ Attach Button */
.attach-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.attach-btn:hover {
  background: var(--gray-100);
  color: var(--brand-primary-dark);
}

.attach-btn.has-file {
  color: var(--brand-primary-dark);
  background: rgba(85, 206, 151, 0.12);
}

/* File chip */
.file-chip-wrap {
  padding: 0 0 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 8px;
  background: rgba(85, 206, 151, 0.1);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-full);
  color: var(--brand-primary-dark);
  font-size: 12px;
  font-weight: 500;
  max-width: 100%;
}

.file-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.file-chip-remove {
  border: none;
  background: none;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
}

.file-chip-remove:hover { color: #DC2626; }

/* ============================================================ Chart Card */
.chart-message { align-items: flex-start; }

.chart-card {
  flex: 1;
  max-width: 600px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.chart-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary-dark);
}

.chart-download-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-full);
  background: var(--brand-ghost);
  color: var(--brand-primary-dark);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chart-download-btn:hover {
  background: rgba(85, 206, 151, 0.18);
  border-color: var(--brand-primary);
}

.chart-canvas-wrap {
  padding: 16px;
  height: 280px;
  position: relative;
}

.chart-canvas {
  width: 100% !important;
  height: 100% !important;
}


/* ============================================================ Scrollbars */
.messages-area::-webkit-scrollbar { width: 5px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 3px;
}
.messages-area::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

#message-input::-webkit-scrollbar { width: 4px; }
#message-input::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

/* ============================================================ Survey Picker */
.survey-picker { position: relative; }

.survey-picker-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--sidebar-divider);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.85);
  font-family: var(--font);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  min-height: 34px;
}

.survey-picker-btn:hover,
.survey-picker-btn:focus {
  border-color: var(--brand-primary);
  background: rgba(85, 206, 151, 0.07);
  outline: none;
}

.survey-picker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.picker-auto {
  color: var(--sidebar-text-dim);
  font-style: italic;
}

.picker-survey-title {
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.picker-survey-id {
  color: var(--brand-primary);
  font-size: 11px;
  flex-shrink: 0;
  background: rgba(85, 206, 151, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

.survey-picker-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.survey-picker-btn.open .survey-picker-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.survey-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1c1c25;
  border: 1px solid rgba(85, 206, 151, 0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200;
  overflow: hidden;
}

.survey-dropdown.open { display: block; }

.survey-search-wrap {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.survey-search {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.85);
  font-family: var(--font);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}

.survey-search::placeholder { color: var(--sidebar-text-dim); }
.survey-search:focus { border-color: var(--brand-primary); }

.survey-options {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

.survey-options::-webkit-scrollbar { width: 4px; }
.survey-options::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.survey-loading {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--sidebar-text-dim);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.survey-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}

.survey-option:hover { background: rgba(85, 206, 151, 0.08); }

.survey-option.selected { background: rgba(85, 206, 151, 0.12); }

.survey-option-left {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.survey-option-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(85, 206, 151, 0.1);
  color: rgba(85, 206, 151, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.survey-option.selected .survey-option-icon {
  background: rgba(85, 206, 151, 0.18);
  color: var(--brand-primary);
}

.survey-option-text { flex: 1; min-width: 0; }

.survey-option-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.survey-option-name {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.survey-option.selected .survey-option-name { color: #FFFFFF; }

.survey-option-sub {
  font-size: 11.5px;
  color: var(--sidebar-text-dim);
  display: block;
  margin-top: 1px;
}

.survey-option-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.survey-option-id {
  font-size: 10.5px;
  color: var(--brand-primary);
  background: rgba(85, 206, 151, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}

.survey-option-dot {
  color: var(--sidebar-text-dim);
  font-size: 11px;
}

.survey-dates {
  font-size: 11px;
  color: var(--sidebar-text-dim);
}

.survey-section-header {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}
.survey-section-header:not(:first-child) {
  border-top: 1px solid var(--gray-100);
  margin-top: 4px;
  padding-top: 10px;
}

.survey-option-empty {
  padding: 14px 12px;
  font-size: 12px;
  color: var(--sidebar-text-dim);
  text-align: center;
}

/* Status badges */
.survey-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-running {
  background: rgba(85, 206, 151, 0.18);
  color: #55CE97;
  border: 1px solid rgba(85, 206, 151, 0.3);
}

.badge-ended {
  background: rgba(100, 100, 120, 0.2);
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Light theme overrides for welcome screen survey badges */
.welcome-survey-card .badge-ended {
  background: var(--gray-100);
  color: var(--gray-400);
  border: 1px solid var(--gray-200);
}

.welcome-survey-card .badge-running {
  background: rgba(85, 206, 151, 0.12);
  color: #0a7a57;
  border: 1px solid rgba(85, 206, 151, 0.25);
}

.badge-published {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.badge-draft {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.survey-check { flex-shrink: 0; }

/* Sidebar backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sidebar-backdrop.visible {
  display: block;
  opacity: 1;
}

/* Sidebar close button (X) — inside logo row */
.sidebar-close-btn {
  display: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.sidebar-close-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

/* ============================================================ Responsive */
@media (max-width: 680px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-md);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-close-btn { display: flex; }
  .sidebar-backdrop { display: none; } /* visibility handled by .visible */

  .prompts-grid { grid-template-columns: 1fr; }

  .msg-body { max-width: 88%; }
}

@media (max-width: 480px) {
  .welcome-hero-greeting { font-size: 24px; }
  .welcome-cooper-intro { font-size: 15px; }
  .welcome-subtitle { font-size: 13px; }
  .welcome-step { padding: 16px; }
  .welcome-avatar-ring { width: 48px; height: 48px; margin-bottom: 16px; }
  .welcome-avatar-inner { width: 34px; height: 34px; }
  .welcome-avatar-inner svg { width: 22px; height: 22px; }
}
