/* =====================================================================
   Enzo Design Fix — Claude.ai fidelity with Dumont teal bg
   ===================================================================== */

:root {
  --bg:        #edf8f7;
  --bg-dark:   #e4f4f3;
  --teal:      #41b8b0;
  --teal-dark: #2a9e96;
  --teal-light: rgba(65,184,176,0.12);
  --navy:      #17355a;
  --navy-light:#1e4575;
  --white:     #ffffff;
  --grey-200:  #e5e7eb;
  --grey-300:  #d1d5db;
  --grey-400:  #9ca3af;
  --grey-500:  #6b7280;
  --grey-600:  #4b5563;
  --grey-700:  #374151;
  --grey-800:  #1f2937;
  --grey-900:  #111827;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --radius:    12px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 52px;
  --t: 150ms ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--grey-900);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.view { display: block; }
.view[hidden], [hidden] { display: none !important; }

button { cursor: pointer; border: none; background: none; font: inherit; }
textarea, input { font: inherit; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--grey-500);
  transition: color var(--t), background var(--t);
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--grey-900); background: rgba(0,0,0,0.05); }

/* =====================================================================
   AUTH
   ===================================================================== */

.auth-view {
  min-height: 100vh;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px;
  width: 400px;
  max-width: 100%;
}

.auth-brand { text-align: center; margin-bottom: 8px; }

.auth-logomark {
  margin: 0 auto 12px;
  line-height: 0;
}

.auth-wordmark { font-family: var(--font-serif); font-size: 24px; color: var(--grey-900); font-weight: normal; }
.auth-tagline  { color: var(--teal); font-size: 13px; margin-top: 2px; }
.auth-subtitle { text-align: center; color: var(--grey-400); font-size: 14px; margin: 16px 0 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

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

.field-label {
  font-size: 13px; font-weight: 500; color: var(--grey-600);
  display: flex; justify-content: space-between; align-items: center;
}

.field-link { font-size: 13px; color: var(--grey-400); font-weight: 400; }
.field-link:hover { color: var(--teal); }

.field-input {
  height: 44px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--grey-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.field-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(65,184,176,0.15); }
textarea.field-input { height: auto; padding: 12px 14px; resize: vertical; }

.hint { font-size: 12px; color: var(--grey-400); font-weight: 400; }
.auth-error { color: #dc2626; font-size: 13px; min-height: 18px; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 8px; font-size: 15px; font-weight: 500;
  padding: 0 20px;
  transition: opacity var(--t), transform var(--t), background var(--t);
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-dark); }
.btn-outline { background: transparent; border: 1px solid var(--grey-200); color: var(--grey-600); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost-sm { background: transparent; color: var(--grey-600); height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn-ghost-sm:hover { background: var(--bg); }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--grey-400); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--grey-200); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--grey-400); }

/* =====================================================================
   APP LAYOUT
   ===================================================================== */

.app-view { display: flex; height: 100vh; overflow: hidden; }

/* =====================================================================
   SIDEBAR — white, Claude.ai style
   ===================================================================== */

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 200ms ease;
  z-index: 100;
  position: relative;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

/* Top */
.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 10px;
}

.sidebar-wordmark {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700;
  color: var(--grey-900);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 150ms;
}
.sidebar.collapsed .sidebar-wordmark { opacity: 0; width: 0; }

.sidebar-collapse-btn { margin-left: auto; }

/* Nav */
.sidebar-nav { padding: 4px 8px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--grey-700);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap; overflow: hidden;
  user-select: none;
}
.nav-item:hover { background: rgba(65,184,176,0.14); color: var(--teal-dark); }
.nav-item:hover .nav-icon { color: var(--teal-dark); }
.nav-item.active { background: rgba(65,184,176,0.14); color: var(--teal-dark); font-weight: 500; }

.sidebar.collapsed .nav-item {
  position: relative;
}
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--grey-900); color: var(--white);
  font-size: 12px; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px;
  pointer-events: none; z-index: 200;
  box-shadow: var(--shadow-md);
}

.nav-icon { flex-shrink: 0; color: var(--grey-500); transition: color var(--t); }
.nav-item.active .nav-icon { color: var(--teal-dark); }
.nav-item:hover .nav-icon { color: var(--grey-700); }

.nav-label { transition: opacity 150ms; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.nav-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 4px 8px; }

/* Search box */
.sidebar-search-box { padding: 4px 8px 8px; }
.sidebar-search-input {
  width: 100%; height: 34px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--grey-900);
  background: var(--bg);
  outline: none;
  transition: border-color var(--t);
}
.sidebar-search-input:focus { border-color: var(--teal); }

/* Recents */
.sidebar-recents {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-200) transparent;
}
.sidebar-recents::-webkit-scrollbar { width: 3px; }
.sidebar-recents::-webkit-scrollbar-thumb { background: var(--grey-200); border-radius: 2px; }

.recents-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  color: var(--grey-400); text-transform: uppercase;
  padding: 12px 12px 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 150ms;
}
.sidebar.collapsed .recents-label { opacity: 0; }

.recents-group-label {
  font-size: 11px; font-weight: 600;
  color: var(--grey-400);
  padding: 8px 12px 2px;
  white-space: nowrap; overflow: hidden;
}
.sidebar.collapsed .recents-group-label { display: none; }

.recents-empty {
  font-size: 13px; color: var(--grey-400);
  padding: 8px 12px;
  transition: opacity 150ms;
}
.sidebar.collapsed .recents-empty { opacity: 0; }

.conv-recent-item {
  display: flex; align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--grey-600);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.conv-recent-item:hover { background: rgba(0,0,0,0.04); color: var(--grey-900); }
.conv-recent-item.active { background: rgba(0,0,0,0.07); color: var(--grey-900); font-weight: 500; }
.sidebar.collapsed .conv-recent-item { display: none; }

.conv-recent-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.conv-recent-actions {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0; opacity: 0;
  transition: opacity var(--t);
}
.conv-recent-item:hover .conv-recent-actions { opacity: 1; }

.conv-recent-del, .conv-recent-rename {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--grey-400);
  font-size: 11px;
  transition: background var(--t), color var(--t);
}
.conv-recent-del:hover { background: rgba(220,38,38,0.1); color: #dc2626; }
.conv-recent-rename:hover { background: rgba(0,0,0,0.08); color: var(--grey-700); }

.conv-recent-rename-inp {
  flex: 1; font-size: 13px; color: var(--grey-900);
  border: 1px solid var(--teal); border-radius: 4px;
  padding: 2px 6px; outline: none; background: var(--white);
  min-width: 0;
}

/* Bottom */
.sidebar-bottom {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 8px 12px;
  position: relative;
}

.user-popup {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px; right: 8px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  z-index: 200;
  animation: popupIn 120ms ease;
}
@keyframes popupIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.popup-email {
  font-size: 13px; color: var(--grey-400);
  padding: 10px 14px 8px;
}
.popup-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 2px 0; }
.popup-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 14px; color: var(--grey-700);
  cursor: pointer;
  transition: background var(--t);
}
.popup-item:hover { background: rgba(65,184,176,0.14); color: var(--teal-dark); }
.popup-item svg { color: var(--grey-400); flex-shrink: 0; }
.popup-item-muted { color: var(--grey-500); }
.popup-item-danger { color: #dc2626; }
.popup-item-danger svg { color: #dc2626; }
.popup-item-danger:hover { background: rgba(220,38,38,0.06); }

.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
  overflow: hidden;
}
.user-row:hover { background: rgba(0,0,0,0.04); }

.user-avatar {
  width: 34px; height: 34px;
  background: var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--white);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; overflow: hidden; transition: opacity 150ms, width 150ms; }
.sidebar.collapsed .user-info { opacity: 0; width: 0; overflow: hidden; }

.user-name { font-size: 14px; font-weight: 500; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: var(--grey-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-row-actions { display: flex; gap: 2px; transition: opacity 150ms, width 150ms; }
.sidebar.collapsed .user-row-actions { opacity: 0; width: 0; overflow: hidden; }

/* Collapsed sidebar: center the avatar and remove clipping */
.sidebar.collapsed .sidebar-bottom { padding: 8px 0; }
.sidebar.collapsed .user-row { padding: 6px 9px; gap: 0; justify-content: flex-start; overflow: visible; }

/* =====================================================================
   MAIN AREA
   ===================================================================== */

.main-area {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

/* Mobile topbar */
.mobile-topbar {
  display: none; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.hamburger-btn { color: var(--grey-700); }
.mobile-wordmark { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--grey-900); }

/* Breadcrumb bar */
.breadcrumb-bar {
  height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.breadcrumb-left { display: flex; align-items: center; gap: 4px; }

.breadcrumb-project-btn {
  font-size: 14px; color: var(--grey-500);
  padding: 4px 6px; border-radius: 6px;
  transition: background var(--t), color var(--t);
}
.breadcrumb-project-btn:hover { background: rgba(0,0,0,0.05); color: var(--grey-900); }

.breadcrumb-sep { font-size: 14px; color: var(--grey-300); padding: 0 2px; }

.breadcrumb-conv-title { font-size: 14px; font-weight: 500; color: var(--grey-700); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.breadcrumb-chevron-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--grey-400);
  transition: color var(--t), background var(--t);
}
.breadcrumb-chevron-btn:hover { color: var(--grey-700); background: rgba(0,0,0,0.05); }

.rename-dropdown {
  position: absolute;
  top: calc(100% + 4px); left: 0;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 50;
  min-width: 280px;
  animation: popupIn 120ms ease;
}
.rename-input {
  width: 100%; height: 38px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--grey-900);
  outline: none;
  background: var(--white);
  transition: border-color var(--t);
}
.rename-input:focus { border-color: var(--teal); }

.breadcrumb-right { display: flex; gap: 4px; align-items: center; }

/* Admin header bar */
.admin-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  flex-shrink: 0;
}
.admin-header-title { font-size: 20px; font-weight: 600; color: var(--grey-900); }
.admin-tabs { display: flex; gap: 4px; }
.tab-btn {
  padding: 6px 16px; border-radius: 6px;
  font-size: 14px; color: var(--grey-600); font-weight: 500;
  transition: background var(--t), color var(--t);
  position: relative;
}
.tab-btn:hover { background: var(--bg); color: var(--grey-900); }
.tab-btn.active { color: var(--teal); }
.tab-btn.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--teal); border-radius: 2px 2px 0 0;
}

/* Content area */
.content-area {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  position: relative;
}

/* =====================================================================
   PANELS
   ===================================================================== */

.panel { min-height: 100%; }

/* ---- Empty state ---- */
#panel-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100%;
  padding: 32px 24px 140px;
}

.empty-center {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  width: 100%; max-width: 720px;
}

.empty-logomark {
  margin-bottom: 20px;
  line-height: 0;
}

.empty-greeting {
  font-family: var(--font-serif);
  font-size: 32px; font-weight: normal;
  color: var(--grey-900); margin-bottom: 8px;
}

.empty-sub { font-size: 16px; color: var(--grey-400); margin-bottom: 28px; }

.suggestion-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.pill {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 14px; color: var(--grey-600);
  transition: border-color var(--t), color var(--t);
}
.pill:hover { border-color: var(--teal); color: var(--teal); }

/* ---- Chat panel ---- */
#panel-chat { display: flex; flex-direction: column; }

.messages-scroll {
  flex: 1;
  padding: 24px 20px 180px;
}

/* Message max-width container */
.msgs-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Date separator */
.date-separator { text-align: center; margin: 20px 0 14px; }
.date-separator span {
  display: inline-block;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px; color: var(--grey-400);
}

/* User message — right aligned bubble */
.msg-row { animation: msgFadeIn 200ms ease; }

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

.msg-row.msg-user {
  display: flex; justify-content: flex-end;
  padding: 4px 0;
}

.msg-user-text {
  background: rgba(65,184,176,0.12);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  max-width: 70%;
  font-size: 15px;
  color: #111827;
  line-height: 1.6;
  word-break: break-word;
}

/* Enzo message — left aligned plain text, NO avatar */
.msg-row.msg-enzo {
  display: block;
  padding: 10px 0 6px;
}

.enzo-msg-body { width: 100%; min-width: 0; display: flex; flex-direction: column; }

.enzo-msg-text {
  font-size: 15px;
  color: #374151;
  line-height: 1.75;
  word-break: break-word;
}

/* Markdown inside Enzo messages */
.enzo-msg-text p       { margin: 0 0 10px; }
.enzo-msg-text p:last-child { margin-bottom: 0; }
.enzo-msg-text ul,
.enzo-msg-text ol      { margin: 6px 0 10px 20px; }
.enzo-msg-text li      { margin-bottom: 4px; }
.enzo-msg-text strong  { font-weight: 600; color: var(--grey-900); }
.enzo-msg-text em      { font-style: italic; }
.enzo-msg-text h1, .enzo-msg-text h2, .enzo-msg-text h3 {
  margin: 14px 0 6px; font-size: 15px; font-weight: 600; color: var(--grey-900);
}
.enzo-msg-text code {
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: 13px; background: var(--bg-dark); border-radius: 4px; padding: 1px 5px; color: var(--navy);
}
.enzo-msg-text pre {
  background: var(--bg-dark); border-radius: 8px; padding: 14px 16px; margin: 10px 0; overflow-x: auto;
}
.enzo-msg-text pre code { background: none; padding: 0; }
.enzo-msg-text blockquote {
  border-left: 3px solid var(--teal); padding-left: 12px; color: var(--grey-600); margin: 8px 0;
}

/* Fix 2 — explicit .enzo-response markdown rules */
.enzo-response strong { font-weight: 600; color: #111827; }
.enzo-response em { font-style: italic; color: #374151; }
.enzo-response h1, .enzo-response h2, .enzo-response h3 {
  font-weight: 700; margin: 16px 0 8px; color: #111827;
}
.enzo-response ul, .enzo-response ol { padding-left: 20px; margin: 10px 0; }
.enzo-response li { margin: 6px 0; line-height: 1.6; }
.enzo-response p { margin: 0 0 12px; }
.enzo-response p:last-child { margin-bottom: 0; }

/* Citation block */
.enzo-citation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(65, 184, 176, 0.08);
  border-left: 3px solid #41b8b0;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}
.citation-icon { font-size: 13px; margin-top: 1px; flex-shrink: 0; }
.citation-text { flex: 1; }
.citation-text p { margin: 0; }
.enzo-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 12px;
  border-left: 3px solid #41b8b0;
  background: rgba(65, 184, 176, 0.05);
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}
.disclaimer-icon { color: #41b8b0; font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.enzo-response code {
  font-family: 'SF Mono', monospace;
  background: rgba(65,184,176,0.1);
  padding: 2px 6px; border-radius: 4px; font-size: 13px;
}
.enzo-response pre {
  background: rgba(65,184,176,0.08);
  padding: 16px; border-radius: 8px;
  overflow-x: auto; margin: 12px 0;
}
.enzo-response a { color: #41b8b0; text-decoration: underline; }
.enzo-response blockquote {
  border-left: 3px solid #41b8b0;
  padding-left: 16px; margin: 12px 0;
  color: #6b7280; font-style: italic;
}

/* Message footer — Enzo icon + hover actions */
.enzo-msg-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-top: 2px;
}

.enzo-msg-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.enzo-msg-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.enzo-msg-body:hover .enzo-msg-actions {
  opacity: 1;
}

.msg-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #aaa;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.msg-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}

.msg-action-btn.copied {
  color: #41b8b0;
}

/* Activity indicator (replaces typing dots) */
@keyframes enzo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.enzo-spinner {
  width: 28px; height: 28px;
  animation: enzo-spin 1.5s linear infinite;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
}
.activity-indicator {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 6px;
  font-size: 13px; color: var(--grey-400);
  animation: msgFadeIn 200ms ease;
}
.activity-text { color: var(--grey-500); }

/* Sources row */
.sources-row {
  font-size: 12px; color: #9ca3af;
  padding: 4px 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.sources-check { color: #41b8b0; font-size: 13px; }

/* ---- Projects panel ---- */
#panel-projects { padding: 0; overflow-y: auto; }
#panel-project-detail { padding: 0; overflow-y: auto; }

.projects-inner { padding: 32px; max-width: 960px; margin: 0 auto; }

.projects-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.projects-title {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 700; color: #111827;
}
.projects-header-actions { display: flex; align-items: center; gap: 10px; }
.projects-sort-select {
  height: 38px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  padding: 0 30px 0 12px;
  font-size: 14px;
  color: #374151;
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t);
}
.projects-sort-select:focus { border-color: var(--teal); }

.btn-dark {
  background: #111827; color: var(--white);
  border-radius: 8px; padding: 10px 18px;
  font-size: 14px; font-weight: 500;
  transition: background var(--t);
}
.btn-dark:hover { background: #374151; }

.projects-search-wrap {
  position: relative; margin-bottom: 16px;
}
.projects-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #9ca3af; pointer-events: none;
}
.projects-search-input {
  width: 100%; background: var(--white);
  border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
  padding: 10px 16px 10px 40px; font-size: 14px; color: #6b7280;
  outline: none; transition: border-color var(--t);
}
.projects-search-input:focus { border-color: var(--teal); color: var(--grey-900); }
.projects-search-input::placeholder { color: #9ca3af; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 140px;
  cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: box-shadow 150ms ease, border-color 150ms ease, transform 150ms ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.14); transform: translateY(-1px); }

.project-card-top {}
.project-card-name-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.project-card-name-left { display: flex; align-items: center; gap: 7px; }
.project-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-card-dot.dot-company  { background: var(--teal); }
.project-card-dot.dot-personal { background: #9ca3af; }
.project-card-name { font-size: 16px; font-weight: 600; color: #111827; }

.project-card-menu-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-400); font-size: 18px; line-height: 1;
  opacity: 0; transition: opacity var(--t), background var(--t), color var(--t);
  flex-shrink: 0;
}
.project-card:hover .project-card-menu-btn { opacity: 1; }
.project-card-menu-btn:hover { background: rgba(0,0,0,0.06); color: var(--grey-700); }

.project-card-desc {
  font-size: 14px; color: #6b7280;
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.project-card-footer {
  margin-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 12px;
  font-size: 13px; color: #9ca3af;
}

/* Card context dropdown */
.project-card-dropdown {
  position: absolute; right: 16px; top: 44px;
  background: var(--white); border-radius: 10px;
  box-shadow: var(--shadow-md); min-width: 160px;
  z-index: 100; border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  animation: modalIn 100ms ease;
}
.project-card-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 14px; color: var(--grey-700);
  cursor: pointer; transition: background var(--t);
}
.project-card-dropdown-item:hover { background: var(--bg); }
.project-card-dropdown-item.danger { color: #dc2626; }
.project-card-dropdown-item.danger:hover { background: rgba(220,38,38,0.06); }
.project-card-dropdown-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 4px 0; }

.project-card-new {
  border: 2px dashed rgba(0,0,0,0.14);
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 14px; color: #9ca3af;
  transition: border-color 150ms, color 150ms;
  min-height: 140px;
  box-shadow: none;
}
.project-card-new:hover { border-color: #41b8b0; color: #41b8b0; transform: none; box-shadow: none; }

/* ---- Project detail ---- */
.pd-container { max-width: 1100px; margin: 0 auto; padding: 20px 32px 32px; }

.pd-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: #6b7280; cursor: pointer;
  padding: 4px 0; margin-bottom: 12px;
  transition: color var(--t);
}
.pd-back:hover { color: #111827; }

.pd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  margin-bottom: 24px;
}
.pd-header-left { display: flex; align-items: center; gap: 10px; }
.pd-header-right { display: flex; align-items: center; gap: 8px; }
.pd-title {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 700; color: #111827;
}
.pd-star-btn.starred svg { fill: #f59e0b; stroke: #f59e0b; }

.pd-body {
  display: flex; gap: 24px; align-items: flex-start;
}

.pd-left {
  flex: 1; min-width: 0;
  border-right: 1px solid rgba(0,0,0,0.06);
  padding-right: 24px;
}
.pd-right { width: 280px; flex-shrink: 0; }

.pd-convs-header {
  font-size: 13px; font-weight: 600; color: var(--grey-400);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.pd-convs { display: flex; flex-direction: column; }
.pd-conv-item {
  display: flex; align-items: center;
  padding: 14px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.pd-conv-item:last-child { border-bottom: none; }
.pd-conv-item:hover { background: rgba(0,0,0,0.03); }
.pd-conv-main { flex: 1; min-width: 0; }
.pd-conv-title { font-size: 15px; font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-conv-meta { font-size: 13px; color: #9ca3af; margin-top: 2px; }
.pd-conv-empty { font-size: 14px; color: #9ca3af; padding: 24px 12px; text-align: center; }

.pd-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.pd-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.pd-card-title { font-size: 14px; font-weight: 600; color: #111827; }
.pd-card-body { font-size: 13px; color: #6b7280; line-height: 1.6; white-space: pre-wrap; }
.pd-card-placeholder { color: #9ca3af; font-style: italic; }
.pd-memory-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  background: rgba(65,184,176,0.12); color: var(--teal-dark);
  padding: 2px 7px; border-radius: 100px;
}
.pd-card-textarea {
  width: 100%; min-height: 100px; max-height: 300px;
  border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--grey-900);
  resize: vertical; outline: none;
  transition: border-color var(--t);
}
.pd-card-textarea:focus { border-color: var(--teal); }
.pd-card-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px;
}
.pd-files-list { display: flex; flex-direction: column; gap: 8px; }
.pd-file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}
.pd-file-name { font-weight: 500; color: #111827; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file-size { font-size: 11px; color: #9ca3af; flex-shrink: 0; }
.pd-file-badge {
  font-size: 10px; font-weight: 600; color: var(--grey-600);
  background: var(--grey-200); border-radius: 4px; padding: 2px 5px;
  text-transform: uppercase; flex-shrink: 0;
}

/* ---- Knowledge panel ---- */
#panel-knowledge { padding: 32px 20px; }
.knowledge-inner { max-width: 720px; }
.knowledge-heading { font-size: 20px; font-weight: 600; color: var(--grey-900); margin-bottom: 20px; }

.upload-zone {
  border: 2px dashed var(--grey-200); border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center; background: var(--white);
  cursor: pointer; transition: border-color var(--t), background var(--t);
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--teal); background: var(--teal-light); }
.upload-icon { color: var(--grey-400); margin-bottom: 14px; display: flex; justify-content: center; }
.upload-title { font-size: 16px; color: var(--grey-600); margin-bottom: 6px; }
.upload-link { color: var(--teal); cursor: pointer; }
.upload-hint { font-size: 14px; color: var(--grey-400); }

.knowledge-files-header {
  font-size: 13px; font-weight: 600; color: var(--grey-400);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}

.knowledge-file-card {
  background: var(--white); border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t);
}
.knowledge-file-card:hover { box-shadow: var(--shadow-md); }
.file-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--white); flex-shrink: 0; }
.file-icon-pdf  { background: #e74c3c; }
.file-icon-docx { background: #2980b9; }
.file-icon-txt  { background: var(--grey-400); }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info { font-size: 12px; color: var(--grey-400); margin-top: 2px; }
.file-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.status-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.04em; }
.status-processing { background: var(--teal-light); color: var(--teal-dark); animation: pulse 1.5s ease-in-out infinite; }
.status-ready      { background: rgba(16,185,129,0.12); color: #059669; }
.status-failed     { background: rgba(220,38,38,0.1); color: #dc2626; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.file-delete-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--grey-400); transition: background var(--t), color var(--t); }
.file-delete-btn:hover { background: rgba(220,38,38,0.08); color: #dc2626; }

/* ---- Admin panel ---- */
#panel-admin { padding: 24px; }
.admin-page-title { font-size: 18px; font-weight: 600; color: var(--grey-900); margin-bottom: 16px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.admin-search { height: 38px; border: 1px solid var(--grey-200); border-radius: 8px; padding: 0 14px; font-size: 14px; background: var(--white); outline: none; width: 240px; transition: border-color var(--t); }
.admin-search:focus { border-color: var(--teal); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.stat-number { font-size: 36px; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 13px; color: var(--grey-400); }
.admin-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px; }
.admin-card-title { font-size: 15px; font-weight: 600; color: var(--grey-900); padding: 20px 24px 16px; border-bottom: 1px solid var(--grey-200); }
.usage-chart { padding: 20px 24px 8px; }
.chart-bars { display: flex; gap: 3px; align-items: flex-end; height: 100px; padding-bottom: 4px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar { width: 100%; background: var(--teal); border-radius: 3px 3px 0 0; min-height: 2px; transition: opacity var(--t); }
.chart-bar-wrap:hover .chart-bar { opacity: 0.7; }
.chart-x-labels { display: flex; gap: 3px; margin-top: 4px; padding-bottom: 8px; }
.chart-label { flex: 1; font-size: 9px; color: var(--grey-400); text-align: center; overflow: hidden; }
.table-loading { padding: 32px; text-align: center; color: var(--grey-400); font-size: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--grey-400); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 20px; border-bottom: 1px solid var(--grey-200); }
.admin-table td { padding: 12px 20px; color: var(--grey-900); vertical-align: middle; }
.admin-table tr:nth-child(odd) td { background: var(--white); }
.admin-table tr:nth-child(even) td { background: var(--bg); }
.admin-table tr:hover td { background: var(--teal-light); }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-teal   { background: var(--teal-light);             color: var(--teal-dark); }
.badge-navy   { background: rgba(23,53,90,0.12);           color: var(--navy); }
.badge-blue   { background: rgba(59,130,246,0.12);         color: #2563eb; }
.badge-purple { background: rgba(139,92,246,0.12);         color: #7c3aed; }
.badge-green  { background: rgba(16,185,129,0.12);         color: #059669; }
.badge-grey   { background: var(--grey-200);               color: var(--grey-600); }
.badge-red    { background: rgba(220,38,38,0.1);           color: #dc2626; }
.badge-enterprise { background: rgba(23,53,90,0.12); color: var(--navy); }
.badge-pro    { background: var(--teal-light); color: var(--teal-dark); }
.badge-free   { background: var(--grey-200); color: var(--grey-600); }
.activity-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--grey-200); transition: background var(--t); }
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--bg); }
.activity-avatar { width: 32px; height: 32px; background: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--white); flex-shrink: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-name { font-size: 14px; font-weight: 500; color: var(--grey-900); }
.activity-detail { font-size: 13px; color: var(--grey-400); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 12px; color: var(--grey-400); flex-shrink: 0; margin-top: 2px; }

/* =====================================================================
   INPUT BAR
   ===================================================================== */

.input-bar {
  padding: 12px 20px 8px;
  background: var(--bg);
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 10;
}

.sidebar.collapsed ~ .main-area .input-bar { left: var(--sidebar-collapsed-w); }

.plus-menu {
  position: absolute;
  bottom: calc(100% - 8px);
  left: 20px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  overflow: hidden;
  z-index: 50;
  animation: popupIn 120ms ease;
}

.plus-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  font-size: 14px; color: var(--grey-700);
  cursor: pointer;
  transition: background var(--t);
}
.plus-menu-item:hover { background: rgba(0,0,0,0.05); }
.plus-menu-item svg { color: var(--grey-400); flex-shrink: 0; }
.plus-menu-item-disabled { color: var(--grey-400); cursor: default; }
.plus-menu-item-disabled:hover { background: none; }
.coming-soon-badge { margin-left: auto; font-size: 10px; background: var(--bg-dark); color: var(--grey-400); padding: 2px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.input-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 12px 16px;
  max-width: 800px;
  margin: 0 auto;
}

.main-textarea {
  width: 100%; border: none; outline: none;
  font-size: 15px; color: var(--grey-900);
  background: transparent; resize: none;
  line-height: 1.5; min-height: 24px; max-height: 200px;
  overflow-y: auto;
  display: block;
}
.main-textarea::placeholder { color: var(--grey-400); }

.input-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.plus-btn {
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-500);
  transition: background var(--t), color var(--t);
}
.plus-btn:not(:disabled):hover { background: rgba(0,0,0,0.1); color: var(--grey-900); }
.plus-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.send-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  background: rgba(0,0,0,0.12);
  transition: background var(--t), transform var(--t);
}
.send-btn:not(:disabled) { background: var(--teal); cursor: pointer; }
.send-btn:not(:disabled):hover { background: var(--teal-dark); transform: scale(1.05); }
.send-btn:not(:disabled):active { transform: scale(0.95); }
.send-btn:disabled { cursor: not-allowed; }

.footer-disclaimer {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  padding: 6px 0 10px;
  width: 100%;
  pointer-events: none;
}

#enzo-disclaimer {
  display: none;
  text-align: center;
  font-size: 12px;
  color: #8e8ea0;
  padding: 4px 0 0 0;
  user-select: none;
}

.pdf-download-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: #17355a;
  color: white;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
}
.pdf-download-btn:hover { background: #1e4575; text-decoration: none; }

/* =====================================================================
   RIGHT PANEL
   ===================================================================== */

.right-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 0;
  background: var(--white);
  border-left: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: width 200ms ease;
  z-index: 40;
  box-shadow: -2px 0 8px rgba(0,0,0,0.04);
}
.right-panel.open { width: 280px; }

.right-panel-inner { width: 280px; height: 100%; display: flex; flex-direction: column; padding: 0; }

.right-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.right-panel-title { font-size: 14px; font-weight: 600; color: var(--grey-900); margin-bottom: 2px; }
.right-panel-sub { font-size: 12px; color: var(--grey-400); }

.right-panel-files { flex: 1; overflow-y: auto; padding: 8px 0; }

.right-panel-file {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
}
.right-panel-file:last-child { border-bottom: none; }
.right-panel-file .file-name { font-size: 13px; }

.rp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 16px; text-align: center; color: var(--grey-400);
}
.rp-empty-icon { font-size: 28px; margin-bottom: 10px; opacity: 0.5; }
.rp-empty-title { font-size: 13px; font-weight: 600; color: var(--grey-600); margin-bottom: 4px; }
.rp-empty-sub { font-size: 12px; color: var(--grey-400); line-height: 1.5; }

.rp-file-meta { flex: 1; min-width: 0; }
.rp-file-name { font-size: 13px; font-weight: 500; color: var(--grey-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-file-info { font-size: 11px; color: var(--grey-400); margin-top: 1px; }

.rp-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.rp-status-ready { background: #22c55e; }
.rp-status-processing {
  background: var(--teal);
  animation: rpPulse 1.4s ease-in-out infinite;
}
.rp-status-failed { background: #ef4444; }
@keyframes rpPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.right-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.add-files-btn {
  font-size: 14px; color: var(--teal); cursor: pointer;
  padding: 4px 0;
  transition: text-decoration var(--t);
}
.add-files-btn:hover { text-decoration: underline; }

/* =====================================================================
   MODALS
   ===================================================================== */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 24px;
  animation: backdropIn 150ms ease;
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: 480px; max-width: 100%;
  animation: modalIn 150ms ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.modal-settings { width: 560px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--grey-200); }
.modal-title { font-size: 17px; font-weight: 600; color: var(--grey-900); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--grey-200); }

.toggle-group { display: flex; gap: 8px; }
.toggle-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--grey-200); border-radius: 8px; font-size: 14px; color: var(--grey-600); transition: border-color var(--t), color var(--t), background var(--t); }
.toggle-btn:hover { border-color: var(--teal); color: var(--teal); }
.toggle-btn.active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); font-weight: 500; }

/* Settings */
.settings-layout { display: flex; min-height: 360px; }
.settings-nav { width: 160px; border-right: 1px solid rgba(0,0,0,0.06); padding: 12px 8px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item { text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--grey-600); transition: background var(--t), color var(--t); }
.settings-nav-item:hover { background: var(--bg); }
.settings-nav-item.active { background: rgba(0,0,0,0.06); color: var(--grey-900); font-weight: 500; }
.settings-body { flex: 1; padding: 20px 24px; overflow-y: auto; }
.settings-section-title { font-size: 13px; font-weight: 600; color: var(--grey-400); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; margin-top: 4px; }
.settings-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.settings-avatar { width: 48px; height: 48px; background: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; color: var(--white); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--grey-200); font-size: 14px; }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { color: var(--grey-600); }
.settings-row-value { color: var(--grey-900); font-weight: 500; }
.settings-row-muted { color: var(--grey-400); font-weight: 400; }

/* Suggested questions toggle */
.sq-toggle { position: relative; display: inline-flex; cursor: pointer; }
.sq-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sq-toggle-track {
  width: 40px; height: 22px;
  background: var(--grey-300); border-radius: 11px;
  transition: background 200ms ease;
  display: block;
}
.sq-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--white);
  border-radius: 50%;
  transition: left 200ms ease;
}
.sq-toggle input:checked + .sq-toggle-track { background: var(--teal); }
.sq-toggle input:checked + .sq-toggle-track::after { left: 21px; }
.sq-toggle input:disabled + .sq-toggle-track { opacity: 0.5; cursor: not-allowed; }

/* Suggested question rows in settings */
.sq-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sq-row .sq-input { flex: 1; }
.sq-row .sq-del-btn { flex-shrink: 0; color: var(--grey-400); }
.sq-row .sq-del-btn:hover { color: #dc2626; background: rgba(220,38,38,0.08); }

/* =====================================================================
   TOAST
   ===================================================================== */

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--grey-900); color: var(--white);
  font-size: 14px; padding: 10px 20px; border-radius: 100px;
  box-shadow: var(--shadow-md);
  z-index: 600;
  animation: toastIn 200ms ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* =====================================================================
   SKELETONS
   ===================================================================== */
.skeleton-card { animation: skPulse 1.5s ease-in-out infinite; }
@keyframes skPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.sk-line { height: 14px; background: var(--grey-200); border-radius: 4px; margin-bottom: 10px; }
.w40 { width: 40%; } .w60 { width: 60%; }

/* =====================================================================
   SIDEBAR OVERLAY
   ===================================================================== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90; }

/* =====================================================================
   MOBILE
   ===================================================================== */

@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }
  .mobile-topbar { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .input-bar { padding: 8px 12px 16px; }
  .messages-scroll { padding: 16px 12px 165px; }
  .msg-row.msg-user { padding-left: 10%; }
  .auth-card { padding: 32px 20px; }
  .modal { width: calc(100% - 24px); margin: 0 12px; }
  .modal-settings { width: calc(100% - 24px); }
  .settings-layout { flex-direction: column; }
  .settings-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--grey-200); flex-direction: row; flex-wrap: wrap; }
  .admin-header-bar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-number { font-size: 28px; }
  .empty-greeting { font-size: 24px; }
  .suggestion-pills { gap: 6px; }
  .pill { font-size: 13px; padding: 7px 12px; }
}

/* ── Library panel ──────────────────────────────────────────── */
.library-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.library-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.library-heading {
  font-size: 22px;
  font-weight: 600;
  color: #17355a;
  margin-bottom: 4px;
}
.library-sub {
  font-size: 13px;
  color: #6b7280;
}
.library-files-wrap {
  margin-top: 28px;
}
.library-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  padding: 48px 0;
}
.library-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.library-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}
.library-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  color: #374151;
}
.library-table tr:last-child td { border-bottom: none; }
.library-table tr:hover td { background: #f9fafb; }
.lib-file-name { font-weight: 500; color: #17355a; }
.lib-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.lib-delete-btn:hover { color: #ef4444; background: #fef2f2; }
.library-non-admin {
  text-align: center;
  padding: 64px 24px;
  color: #6b7280;
  font-size: 14px;
}
.library-non-admin strong { color: #17355a; display: block; font-size: 16px; margin-bottom: 8px; }

/* =====================================================================
   Feedback system
   ===================================================================== */

.thumb-up-btn.active {
  color: #41b8b0;
  background: rgba(65,184,176,0.12);
  border-radius: 4px;
}

.thumb-down-btn.active {
  color: #17355a;
  background: rgba(23,53,90,0.08);
  border-radius: 4px;
}

.enzo-feedback-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  max-width: 480px;
}

.feedback-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #17355a;
  margin-bottom: 10px;
}

.feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.feedback-chip {
  background: none;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  transition: all 0.15s;
}

.feedback-chip:hover {
  border-color: #41b8b0;
  color: #41b8b0;
}

.feedback-chip.selected {
  background: rgba(65,184,176,0.1);
  border-color: #41b8b0;
  color: #41b8b0;
  font-weight: 500;
}

.feedback-comment {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  resize: none;
  margin-bottom: 10px;
  font-family: inherit;
  box-sizing: border-box;
}

.feedback-comment:focus {
  outline: none;
  border-color: #41b8b0;
}

.feedback-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.feedback-submit-btn {
  background: #17355a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
}

.feedback-submit-btn:hover { background: #1e4475; }

.feedback-cancel-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  color: #888;
}

.feedback-cancel-btn:hover { border-color: #aaa; color: #555; }

/* =====================================================================
   Conversation sidebar items — new design with context menu
   ===================================================================== */

.conv-item {
  display: flex; align-items: center;
  padding: 6px 8px 6px 12px;
  border-radius: 6px;
  color: var(--grey-600);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  position: relative;
  gap: 4px;
}
.conv-item:hover { background: rgba(0,0,0,0.04); color: var(--grey-900); }
.conv-item.active { background: rgba(0,0,0,0.07); color: var(--grey-900); font-weight: 500; }
.sidebar.collapsed .conv-item { display: none; }
.sidebar.collapsed .conv-section-header { display: none; }

.conv-item-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}

.conv-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.conv-project-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: var(--teal);
  background: rgba(65,184,176,0.1);
  border-radius: 10px;
  padding: 1px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  flex-shrink: 0;
  align-self: flex-start;
}

.conv-menu-btn {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--grey-400);
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity var(--t), background var(--t), color var(--t);
}
.conv-item:hover .conv-menu-btn { opacity: 1; }
.conv-item .conv-menu-btn.open { opacity: 1; }
.conv-menu-btn:hover { background: rgba(0,0,0,0.08); color: var(--grey-700); }

.conv-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 2px;
  font-size: 11px; font-weight: 600;
  color: var(--grey-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}

.conv-archived-toggle { cursor: pointer; }
.conv-archived-toggle:hover { color: var(--grey-600); }
.conv-archived-caret { font-size: 9px; margin-left: 4px; }

/* Context menu */
.conv-context-menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 160px;
}

.conv-menu-item {
  display: flex; align-items: center;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--grey-700);
  border-radius: 5px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  transition: background var(--t);
  white-space: nowrap;
}
.conv-menu-item:hover { background: rgba(0,0,0,0.05); }
.conv-menu-item.danger { color: #dc2626; }
.conv-menu-item.danger:hover { background: rgba(220,38,38,0.07); }

.conv-menu-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 3px 8px;
}
/* Project picker */
.conv-project-picker {
  position: fixed;
  z-index: 10000;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 4px;
  min-width: 185px;
  max-height: 260px;
  overflow-y: auto;
}

.conv-project-option {
  display: block;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--grey-700);
  border-radius: 5px;
  cursor: pointer;
  transition: background var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.conv-project-option:hover { background: rgba(0,0,0,0.05); }
.conv-project-option.danger { color: #dc2626; }
.conv-project-option.danger:hover { background: rgba(220,38,38,0.07); }
.conv-project-option.disabled { color: var(--grey-400); cursor: default; }
.conv-project-option.disabled:hover { background: none; }


/* =====================
   Artifact Content Panel
   ===================== */

.artifact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.artifact-item:hover {
  background: rgba(65,184,176,0.08);
}

.artifact-icon {
  color: #41b8b0;
  flex-shrink: 0;
}

.artifact-info {
  min-width: 0;
}

.artifact-filename {
  font-size: 13px;
  font-weight: 500;
  color: #17355a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-meta {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

.content-section-header {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 12px 4px;
}

.rp-empty-state {
  padding: 24px 16px;
  font-size: 13px;
  color: #aaa;
  line-height: 1.6;
  text-align: center;
}

.rp-loading {
  padding: 16px;
  font-size: 13px;
  color: #aaa;
  text-align: center;
}

/* =====================
   Artifact Preview Panel
   ===================== */

.artifact-preview-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.preview-filename {
  font-size: 13px;
  font-weight: 600;
  color: #17355a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.preview-download-btn {
  font-size: 12px;
  color: #41b8b0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #41b8b0;
  border-radius: 6px;
}

.preview-download-btn:hover {
  background: rgba(65,184,176,0.1);
}

.preview-close-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.preview-close-btn:hover { color: #555; }

.preview-body {
  flex: 1;
  overflow: hidden;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}


/* =====================================================================
   CHATS SCREEN
   ===================================================================== */

.chats-screen-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

.chats-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chats-screen-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--grey-900);
}

.chats-new-btn {
  background: #41b8b0;
  color: var(--white);
  border-radius: 999px;
  padding: 0 18px;
  height: 36px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t);
}
.chats-new-btn:hover { background: #379e97; }

.chats-search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.chats-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-400);
  pointer-events: none;
}

.chats-search-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  padding: 0 14px 0 42px;
  font-size: 15px;
  color: var(--grey-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.chats-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.chats-search-input::placeholder { color: var(--grey-400); }

.chats-subheading-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.chats-your-chats-label {
  font-size: 13px;
  color: var(--grey-400);
  font-weight: 400;
}

.chats-select-btn {
  font-size: 13px;
  color: #41b8b0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 400;
  transition: color var(--t);
}
.chats-select-btn:hover { color: #379e97; }

.chats-list-divider {
  height: 1px;
  background: var(--grey-200);
  margin-bottom: 0;
}

.chats-list {
  margin: 0 -8px;
}

.chats-conv-row {
  padding: 16px 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--grey-200);
  border-radius: 6px;
  transition: background var(--t);
}
.chats-conv-row:last-child { border-bottom: none; }
.chats-conv-row:hover { background: #f5f5f5; }

.chats-conv-title {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chats-conv-meta {
  font-size: 13px;
  color: var(--grey-400);
  font-weight: 400;
}
.chats-conv-meta strong {
  color: var(--grey-900);
  font-weight: 600;
}

.chats-empty {
  text-align: center;
  color: var(--grey-400);
  font-size: 14px;
  padding: 48px 0;
}

.chats-show-more-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--grey-300);
  border-radius: 999px;
  color: var(--grey-600);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.chats-show-more-btn:hover { border-color: var(--grey-500); color: var(--grey-900); }

/* ── Chats screen: row layout (flex) ───────────────────────────── */
.chats-conv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.chats-conv-body {
  flex: 1;
  min-width: 0;
}
.chats-row-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #41b8b0;
  margin: 0;
}
.chats-conv-row.selected { background: #e8f0fe; }
.chats-conv-row.selected:hover { background: #dce8fd; }

/* ── Row ··· menu button ─────────────────────────────────────────── */
.chats-row-menu-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--grey-500);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t), background var(--t);
  padding: 0;
  line-height: 1;
  letter-spacing: 1px;
}
.chats-conv-row:hover .chats-row-menu-btn { opacity: 1; }
.chats-row-menu-btn:hover {
  background: var(--grey-200);
  color: var(--grey-900);
}

/* ── Chats row popup (reuses conv-context-menu look) ─────────────── */
.chats-row-menu-popup {
  position: fixed;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 9000;
  min-width: 160px;
  padding: 6px;
}

/* ── Selection bar ──────────────────────────────────────────────── */
.chats-selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 10px;
  flex-wrap: wrap;
}
.chats-sel-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--grey-700);
  user-select: none;
}
.chats-sel-all-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #41b8b0;
  margin: 0;
}
.chats-sel-count {
  font-size: 14px;
  color: var(--grey-700);
  font-weight: 500;
}
.chats-sel-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.chats-sel-action-btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--grey-300);
  background: var(--white);
  color: var(--grey-700);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.chats-sel-action-btn:hover:not(:disabled) {
  background: var(--grey-100);
  border-color: var(--grey-400);
}
.chats-sel-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chats-sel-action-btn.chats-sel-delete-btn { color: #dc2626; border-color: #fca5a5; }
.chats-sel-action-btn.chats-sel-delete-btn:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #dc2626;
}
.chats-sel-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--grey-500);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
  padding: 0;
}
.chats-sel-close-btn:hover {
  background: var(--grey-200);
  color: var(--grey-900);
}

/* ══════════════════════════════════════════════════════════════
   Search overlay
   ══════════════════════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-overlay[hidden] { display: none; }
.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
}
.search-modal {
  position: relative;
  z-index: 1;
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  flex-shrink: 0;
}
.search-modal-icon {
  color: var(--grey-400);
  flex-shrink: 0;
}
.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--grey-900);
  background: transparent;
  min-width: 0;
}
.search-modal-input::placeholder { color: var(--grey-400); }
.search-modal-clear {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--grey-400);
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t), color var(--t);
}
.search-modal-clear:hover { background: var(--grey-100); color: var(--grey-700); }
.search-modal-divider {
  height: 1px;
  background: var(--grey-200);
  flex-shrink: 0;
}
.search-modal-results {
  overflow-y: auto;
  flex: 1;
  padding: 6px;
  min-height: 80px;
}
.search-no-results {
  text-align: center;
  color: var(--grey-400);
  font-size: 14px;
  padding: 32px 16px;
}
.search-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
}
.search-result-row:hover { background: var(--grey-100); }
.search-result-icon {
  flex-shrink: 0;
  color: var(--grey-400);
}
.search-result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 12px;
  color: var(--grey-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-arrow {
  flex-shrink: 0;
  color: var(--grey-400);
}

/* ── Search overlay close button ──────────────────────────────────────────── */
.search-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--grey-400);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
  padding: 0;
  z-index: 2;
}
.search-modal-close:hover { background: var(--grey-100); color: var(--grey-700); }

/* ── Move to project modal ─────────────────────────────────────────────────── */
.mpick-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mpick-overlay[hidden] { display: none; }
.mpick-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}
.mpick-modal {
  position: relative;
  z-index: 1;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 560px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mpick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}
.mpick-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--grey-900);
}
.mpick-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--grey-400);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
  padding: 0;
}
.mpick-close-btn:hover { background: var(--grey-100); color: var(--grey-700); }
.mpick-subtitle {
  padding: 0 20px 12px;
  font-size: 13px;
  color: var(--grey-400);
  flex-shrink: 0;
}
.mpick-search-wrap {
  position: relative;
  padding: 0 20px 12px;
  flex-shrink: 0;
}
.mpick-search-icon {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-60%);
  color: var(--grey-400);
  pointer-events: none;
}
.mpick-search-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 12px 0 34px;
  font-size: 14px;
  color: var(--grey-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--t);
  box-sizing: border-box;
}
.mpick-search-input:focus { border-color: #41b8b0; }
.mpick-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
  min-height: 80px;
}
.mpick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
  font-size: 14px;
  color: var(--grey-800);
}
.mpick-row:hover { background: rgba(65,184,176,0.08); }
.mpick-row.selected .mpick-row-name { color: #41b8b0; font-weight: 500; }
.mpick-row.selected .mpick-row-icon { color: #41b8b0; }
.mpick-row.is-current { opacity: 0.5; cursor: default; }
.mpick-row.is-current:hover { background: transparent; }
.mpick-row-icon { flex-shrink: 0; color: var(--grey-400); }
.mpick-row-name { flex: 1; }
.mpick-row-check { flex-shrink: 0; color: #41b8b0; }
.mpick-new-project .mpick-row-name { color: #41b8b0; }
.mpick-new-project .mpick-row-icon { color: #41b8b0; }
.mpick-divider {
  height: 1px;
  background: var(--grey-200);
  margin: 4px 0;
}
.mpick-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--grey-200);
  flex-shrink: 0;
}
.mpick-cancel-btn {
  font-size: 14px;
  color: var(--grey-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background var(--t);
}
.mpick-cancel-btn:hover { background: var(--grey-100); }
.mpick-move-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background: #41b8b0;
  border: none;
  cursor: pointer;
  padding: 8px 20px;
  border-radius: 8px;
  transition: background var(--t);
}
.mpick-move-btn:hover:not(:disabled) { background: #379e97; }
.mpick-move-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Delete confirmation modal ─────────────────────────────────────────────── */
.del-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.del-overlay[hidden] { display: none; }
.del-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.del-modal {
  position: relative;
  z-index: 1;
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 28px 28px 24px;
}
.del-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--grey-900);
  margin-bottom: 10px;
}
.del-body {
  font-size: 14px;
  color: var(--grey-500);
  line-height: 1.5;
  margin-bottom: 24px;
}
.del-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.del-cancel-btn {
  font-size: 14px;
  color: var(--grey-700);
  background: var(--white);
  border: 1px solid var(--grey-300);
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background var(--t), border-color var(--t);
}
.del-cancel-btn:hover { background: var(--grey-50); border-color: var(--grey-400); }
.del-confirm-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background: #dc2626;
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 8px;
  transition: background var(--t);
}
.del-confirm-btn:hover { background: #b91c1c; }

/* =====================================================================
   SPRINT 6 — Company · Workspace · User Architecture
   ===================================================================== */

/* ── Invite banner (register page with ?invite= token) ─────────────── */
.invite-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(65,184,176,0.10);
  border: 1px solid rgba(65,184,176,0.30);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px; line-height: 1.5; color: var(--grey-700);
}
.invite-banner-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.invite-banner-text strong { color: var(--navy); }

/* ── User subtitle (company · role · Beta pill) ────────────────────── */
.user-subtitle {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--grey-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.user-beta-pill {
  display: inline-flex; align-items: center;
  background: rgba(65,184,176,0.15);
  color: var(--teal-dark);
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 4px; text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Popup company row ─────────────────────────────────────────────── */
.popup-company-row {
  justify-content: space-between !important;
}
.popup-dots-btn {
  margin-left: auto;
  font-size: 15px; letter-spacing: 2px;
  color: var(--grey-400);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}
.popup-dots-btn:hover { background: rgba(0,0,0,0.06); color: var(--grey-700); }

/* ── Workspace switcher panel ──────────────────────────────────────── */
.workspace-switcher {
  position: absolute;
  inset: 0;
  bottom: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  z-index: 201;
  display: flex; flex-direction: column;
  padding: 8px 0;
  animation: popupIn 120ms ease;
}
.workspace-switcher[hidden] { display: none; }

.ws-switcher-header {
  padding: 4px 12px 6px;
  flex-shrink: 0;
}
.ws-back-btn {
  font-size: 13px; color: var(--grey-500);
  background: none; border: none; cursor: pointer;
  padding: 4px 0;
  transition: color var(--t);
}
.ws-back-btn:hover { color: var(--grey-900); }

.ws-company-name {
  font-size: 13px; font-weight: 600; color: var(--navy);
  padding: 4px 14px 8px;
  flex-shrink: 0;
}
.ws-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--grey-400); text-transform: uppercase;
  padding: 2px 14px 6px;
  flex-shrink: 0;
}
.ws-list {
  flex: 1; overflow-y: auto;
  padding: 0 6px;
}
.ws-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px; color: var(--grey-700);
  cursor: pointer;
  transition: background var(--t);
}
.ws-item:hover { background: rgba(0,0,0,0.05); }
.ws-item.ws-item-active { background: rgba(65,184,176,0.10); color: var(--teal-dark); font-weight: 500; }
.ws-item-check { margin-left: auto; font-size: 12px; color: var(--teal); }

.ws-new-workspace-row {
  padding: 6px 12px;
  flex-shrink: 0;
}
.ws-new-inp { font-size: 13px; }

.ws-new-btn {
  width: 100%; text-align: left;
  padding: 8px 14px;
  font-size: 13px; color: var(--teal-dark);
  background: none; border: none; cursor: pointer;
  transition: background var(--t);
  flex-shrink: 0;
}
.ws-new-btn:hover { background: rgba(65,184,176,0.08); }

.ws-manage-btn {
  width: 100%; text-align: left;
  padding: 8px 14px;
  font-size: 13px; color: var(--grey-500);
  background: none; border: none; cursor: pointer;
  transition: color var(--t);
  flex-shrink: 0;
}
.ws-manage-btn:hover { color: var(--teal-dark); }

/* ── Settings modal — wide 5-tab layout ────────────────────────────── */
.modal-settings-wide {
  width: 860px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
}
.modal-settings-wide .settings-layout {
  flex: 1; overflow: hidden;
}
.modal-settings-wide .settings-body {
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

.settings-close-x {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
}

.settings-nav-wide {
  width: 160px;
  min-width: 140px;
}

/* Settings soul textarea */
.settings-soul-ta {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
}

/* Settings workspaces table */
.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}
.settings-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--grey-400);
  border-bottom: 1px solid var(--grey-200);
}
.settings-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--grey-100, #f3f4f6);
  color: var(--grey-700);
}
.settings-table tr:last-child td { border-bottom: none; }

/* Avatar clickable */
.settings-avatar-clickable {
  cursor: pointer;
  transition: opacity var(--t), box-shadow var(--t);
}
.settings-avatar-clickable:hover { opacity: 0.85; box-shadow: 0 0 0 3px rgba(65,184,176,0.3); }

/* Danger outline button */
.btn-outline-danger {
  background: transparent;
  border: 1px solid #dc2626;
  color: #dc2626;
  height: 36px; padding: 0 16px;
  font-size: 14px; border-radius: 8px;
}
.btn-outline-danger:hover { background: rgba(220,38,38,0.06); }

/* Billing features list */
.billing-features {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--grey-600);
}
.billing-features li::before { content: ''; margin-right: 4px; }

/* Sessions table in Security tab */
.sessions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}
.sessions-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--grey-400);
  border-bottom: 1px solid var(--grey-200);
}
.sessions-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--grey-100, #f3f4f6);
  color: var(--grey-700);
  font-size: 12px;
}
.sessions-table tr:last-child td { border-bottom: none; }

/* Invite link display */
.invite-link-display {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px; color: var(--grey-600);
  word-break: break-all;
}
.invite-link-display input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 12px; color: var(--grey-600);
}

/* ── Responsive overrides for wide settings modal ──────────────────── */
@media (max-width: 900px) {
  .modal-settings-wide { width: calc(100vw - 24px); }
  .settings-nav-wide { width: 120px; min-width: 100px; }
}
@media (max-width: 640px) {
  .modal-settings-wide { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .settings-nav-wide {
    width: 100%; min-width: unset;
    border-right: none; border-bottom: 1px solid var(--grey-200);
    flex-direction: row; flex-wrap: wrap; overflow-x: auto;
    padding: 8px 8px 0;
  }
  .settings-nav-wide .settings-nav-item { padding: 7px 10px; font-size: 13px; }
  .modal-settings-wide .settings-body { max-height: 60vh; }
}



/* ================================================================
   MOBILE OVERRIDES — single consolidated block
   ================================================================ */
@media (max-width: 768px) {

  /* Topbar: visible but transparent — hamburger stays in DOM and functional */
  .mobile-topbar {
    background: transparent !important;
    border-bottom: none !important;
  }
  .mobile-wordmark { display: none; }
  .hamburger-btn {
    color: #2a7a74;
    background: transparent;
  }

  /* Input bar: full width, no sidebar offset */
  .input-bar { left: 0 !important; }
  .input-card { margin: 0 4px; }

  /* Empty state: fixed height, no scroll, vertically centered */
  #panel-empty {
    height: calc(100vh - 130px);
    min-height: unset;
    overflow: hidden;
    align-items: flex-start;
    justify-content: center;
    padding: 0 20px;
  }

  /* Logomark + greeting inline on same line, left-aligned */
  .empty-center { display: block; text-align: left; }
  .empty-logomark {
    display: inline !important;
    margin-right: 8px;
    margin-bottom: 0;
    vertical-align: middle;
  }
  /* img (not svg) — must override inline width/height with !important */
  .empty-logomark img { width: 26px !important; height: 26px !important; vertical-align: middle; }
  .empty-greeting { display: inline; font-size: 28px; vertical-align: middle; }
  .empty-sub { display: block; margin-top: 8px; font-size: 15px; }
  .suggestion-pills { display: none; }
}

/* =====================================================================
   Streaming: inline narration flow + tool chips + thin cursor
   ===================================================================== */

.narration-flow { margin-bottom: 12px; }

.narration-line {
  margin: 0 0 8px 0;
  color: #17355a;
  font-size: 15px;
  line-height: 1.55;
  animation: narration-fadein 150ms ease both;
}

@keyframes narration-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  margin: -4px 0 12px 0;
  color: #8a9ab0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease;
}

.tool-chip:hover { color: #41b8b0; }
.tool-chip.done { opacity: 0.45; }

.tool-chip-spinner {
  width: 8px;
  height: 8px;
  border: 1.5px solid rgba(65,184,176,0.3);
  border-top-color: #41b8b0;
  border-radius: 50%;
  flex-shrink: 0;
  animation: chip-spin 0.8s linear infinite;
}

.tool-chip.done .tool-chip-spinner {
  display: none;
}

@keyframes chip-spin {
  to { transform: rotate(360deg); }
}

.tool-chip-chevron { font-size: 11px; opacity: 0.7; }

.tool-chip-detail {
  margin: -8px 0 12px 0;
  padding: 8px 12px;
  background: rgba(65,184,176,0.05);
  border-left: 2px solid #41b8b0;
  color: #17355a;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  border-radius: 0 4px 4px 0;
}

.tool-chip-detail.hidden { display: none; }

.response-body {
  color: #17355a;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.7;
}

.response-body p { margin: 0 0 14px; }
.response-body p:last-child { margin-bottom: 0; }

.response-body h1,
.response-body h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #17355a;
  margin: 22px 0 8px;
  letter-spacing: -0.01em;
}
.response-body h1:first-child,
.response-body h2:first-child { margin-top: 0; }

.response-body h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 16px 0 6px;
}

.response-body hr {
  border: none;
  border-top: 1px solid rgba(65,184,176,0.18);
  margin: 20px 0;
}

.response-body ul,
.response-body ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.response-body li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.response-body strong { font-weight: 700; }
.response-body em { font-style: italic; }

.response-body blockquote {
  margin: 14px 0 0;
  padding: 6px 12px;
  border-left: 2px solid rgba(65,184,176,0.3);
  color: #6b7280;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}
.response-body blockquote p { margin: 0; }

/* Contextual closing question — rendered after action icons */
.enzo-closing-question {
  margin: 14px 16px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(65,184,176,0.12);
  color: #17355a;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.6;
}

.response-body.typing::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #41b8b0;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursor-blink 1s steps(2, start) infinite;
}

@keyframes cursor-blink {
  to { visibility: hidden; }
}

/* Narration collapse summary */
.narration-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  margin-bottom: 12px;
  color: #8a9ab0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease;
}

.narration-summary:hover { color: #41b8b0; }
.narration-summary-text { font-size: 13px; }
.narration-summary-chevron { font-size: 11px; opacity: 0.7; }

.narration-collapse-btn {
  display: block;
  margin-top: 8px;
  color: #8a9ab0;
  font-size: 12px;
  cursor: pointer;
}
.narration-collapse-btn:hover { color: #41b8b0; }

/* Follow-up suggestion pills */
.followup-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.followup-pill {
  padding: 6px 14px;
  background: rgba(65,184,176,0.07);
  border: 1px solid rgba(65,184,176,0.2);
  border-radius: 16px;
  color: #17355a;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  text-align: left;
}
.followup-pill:hover {
  background: rgba(65,184,176,0.14);
  border-color: rgba(65,184,176,0.4);
}
.followup-pill.selected {
  background: rgba(65,184,176,0.18);
  border-color: #41b8b0;
  color: #41b8b0;
  cursor: default;
}

/* Stop generation button */
.stream-stop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(65,184,176,0.1);
  color: #41b8b0;
  border: 1px solid rgba(65,184,176,0.25);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 120ms ease;
  margin-left: 6px;
}
.stream-stop-btn:hover { background: rgba(65,184,176,0.2); }

/* Citation hover icon */
.cite-btn { position: relative; }
.cite-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--navy);
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: normal;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  pointer-events: none;
  z-index: 200;
}
.cite-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 10px;
  border: 6px solid transparent;
  border-top-color: var(--navy);
}
.cite-btn:hover .cite-tooltip { display: block; }
