/* ==========================================================================
   SAP Business One Copilot - Permanent Sleek Dark Theme & Voice UI
   ========================================================================== */

/* --- 1. CORE DARK PALETTE VARIABLES --- */
:root {
  --bg-gradient: radial-gradient(ellipse 90% 65% at 50% -15%, #252A34 0%, #1A1D24 55%, #121418 100%), #121418;
  --bg-main: #121418;
  --bg-sidebar: #181B22;
  --bg-card: rgba(26, 30, 38, 0.94);
  --bg-input: #1F232B;
  --bg-input-focus: #252B35;
  --bg-user-bubble: #252A34;
  --bg-code: #14171E;
  --bg-hover: rgba(255, 255, 255, 0.05);
  
  --text-primary: #F4F4F6;
  --text-secondary: #A1A7B5;
  --text-muted: #6B7280;
  
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-input: rgba(255, 255, 255, 0.14);
  --border-card: rgba(255, 255, 255, 0.14);
  
  --accent: #3EA1DA;
  --accent-hover: #2589C1;
  --accent-glow: rgba(62, 161, 218, 0.28);
  --accent-subtle: rgba(62, 161, 218, 0.14);
  
  --card-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* --- 2. GLOBAL RESET & BASE STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* --- 3. LOGIN SCREEN (ZERO VERTICAL SCROLL) --- */
.login-viewport {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 24px 24px 24px;
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.system-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid rgba(62, 161, 218, 0.25);
  padding: 4px 10px;
  border-radius: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #56B7E8;
  box-shadow: 0 0 10px #56B7E8;
  display: inline-block;
}

.login-card-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 22px;
  padding: 32px 34px 26px 34px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-brand-header {
  text-align: center;
  margin-bottom: 20px;
}

.brand-halo {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px auto;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(62, 161, 218, 0.2), rgba(62, 161, 218, 0.05));
  border: 1px solid rgba(62, 161, 218, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px var(--accent-glow);
}

.brand-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid rgba(62, 161, 218, 0.25);
  padding: 3px 10px;
  border-radius: 16px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #EF4444;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.input-container {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  padding: 0 14px;
  transition: all 0.2s ease;
}

.input-container:focus-within {
  background: var(--bg-input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-icon {
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 10px;
  user-select: none;
}

.input-container input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.input-container input:-webkit-autofill,
.input-container input:-webkit-autofill:hover,
.input-container input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  caret-color: var(--text-primary);
}

.input-container input::placeholder {
  color: var(--text-muted);
}

.eye-toggle-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s ease;
}
.eye-toggle-btn:hover {
  color: var(--accent);
}

.primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #3EA1DA 0%, #2589C1 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 8px;
}
.primary-btn:hover {
  background: linear-gradient(135deg, #56B7E8 0%, #3EA1DA 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px var(--accent-glow);
}
.primary-btn:active {
  transform: translateY(0);
}

.card-security-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  opacity: 0.85;
  margin-top: 16px;
}

/* --- 4. CHAT APP LAYOUT (SIDEBAR + MAIN) --- */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  flex-shrink: 0;
}

.sidebar-header {
  margin-bottom: 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-subtle);
  border: 1px solid rgba(62, 161, 218, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-caption {
  font-size: 11px;
  color: var(--text-muted);
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--accent-subtle);
  border: 1px solid rgba(62, 161, 218, 0.25);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-bottom: 14px;
}
.new-chat-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin-bottom: 14px;
}

/* RECENT CONVERSATIONS (DYNAMIC PER USER) */
.sidebar-conversations-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px; /* Comfortably displays at least 5-6 conversations before any scroll */
  margin-bottom: 12px;
  overflow: hidden;
}

.conversations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.conversations-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.conv-count-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
}

.conversations-list {
  flex: 1;
  min-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

/* Slim Sleek Dark Scrollbar for Sidebar Chats */
.conversations-list::-webkit-scrollbar {
  width: 5px;
}
.conversations-list::-webkit-scrollbar-track {
  background: transparent;
}
.conversations-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.conversations-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

.conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}

.conversation-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

.conversation-item.active {
  background: var(--accent-subtle);
  border-color: rgba(62, 161, 218, 0.35);
}

.conv-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.conv-item-icon {
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.8;
}

.conv-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.conv-item-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item.active .conv-item-title {
  color: #56B7E8;
  font-weight: 600;
}

.conv-item-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.delete-conv-btn {
  opacity: 0;
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.conversation-item:hover .delete-conv-btn {
  opacity: 0.75;
}

.delete-conv-btn:hover {
  opacity: 1 !important;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.15);
}

.conv-empty-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 8px;
  line-height: 1.5;
}

.sidebar-spacer {
  flex: 1;
}

/* COMPACT USER PROFILE & SPLIT ACTIONS */
.sidebar-user-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.user-profile-card:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Emerald Avatar Circle with User Initial */
.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #56B7E8 0%, #2589C1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.user-profile-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Subtle Glowing Online Pulse Dot */
.status-pulse-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background-color: #56B7E8;
  box-shadow: 0 0 8px #56B7E8;
  display: inline-block;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* Split Action Pill Row (50% / 50% width) */
.sidebar-split-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

.sidebar-split-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
}
.sidebar-split-btn:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}
.sidebar-split-btn.logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #EF4444 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* MAIN CHAT CONTENT AREA */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background: var(--bg-gradient);
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-main);
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-status-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.status-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(62, 161, 218, 0.25);
}

/* CHAT MESSAGES */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 140px 24px;
}

.empty-state {
  max-width: 780px;
  margin: 40px auto 0 auto;
  text-align: center;
}

.empty-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.starter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.starter-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
  background: var(--bg-input);
}

.starter-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.starter-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.starter-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.messages-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* MESSAGE BUBBLES */
.chat-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-row.assistant .chat-avatar {
  background: var(--accent-subtle);
  border: 1px solid rgba(62, 161, 218, 0.3);
}

.chat-bubble {
  max-width: 85%;
  line-height: 1.65;
  font-size: 14.5px;
}

.chat-row.user .chat-bubble {
  background: var(--bg-user-bubble);
  border: 1px solid var(--border-subtle);
  border-radius: 18px 18px 4px 18px;
  padding: 11px 18px;
  color: var(--text-primary);
}

.chat-row.assistant .chat-bubble {
  flex: 1;
  color: var(--text-primary);
}

/* --- CHATGPT-STYLE ANIMATED THINKING CARD --- */
.thinking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 18px;
  max-width: 440px;
  margin: 4px 0 10px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.thinking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.thinking-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-subtle);
  border: 1px solid rgba(62, 161, 218, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotateSparkle 3s linear infinite;
}

.thinking-sparkle {
  color: var(--accent);
  font-size: 12px;
  animation: pulseSparkle 1.4s ease-in-out infinite;
}

.thinking-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.thinking-step {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-left: 32px;
  transition: opacity 0.3s ease;
}

.thinking-shimmer-bar {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  position: absolute;
  bottom: 0;
  left: -100%;
  animation: shimmerMove 2s infinite ease-in-out;
}

@keyframes shimmerMove {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes rotateSparkle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseSparkle {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.18); }
}

/* MARKDOWN TABLES */
.chat-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
}
.chat-bubble th, .chat-bubble td {
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.chat-bubble th {
  background: var(--bg-hover);
  font-weight: 600;
}

/* PLOTLY CHART CONTAINER */
.chart-container {
  width: 100%;
  margin: 14px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--card-shadow);
}

/* EXCEL DOWNLOAD BUTTON */
.excel-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin: 10px 0;
  transition: all 0.2s ease;
}
.excel-download-btn:hover {
  background: var(--accent-subtle);
  transform: translateY(-1px);
}

/* FOLLOW-UP & CLARIFICATION BUTTONS */
.followups-wrapper {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.followup-btn {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
}
.followup-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-hover);
}

/* TYPING CURSOR */
.cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background-color: var(--accent);
  margin-left: 3px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* FLOATING INPUT WRAPPER */
.chat-input-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 24px 20px 24px;
  background: linear-gradient(to top, var(--bg-main) 75%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-form {
  width: 100%;
  max-width: 820px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 28px;
  padding: 6px 10px 6px 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.chat-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-input-focus);
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-primary);
  resize: none;
  outline: none;
  line-height: 1.5;
  max-height: 120px;
}

/* VOICE-TO-TEXT MICROPHONE BUTTON */
.mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.mic-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

/* Continuous Recording State */
.mic-btn.listening {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
  animation: pulseMic 1.2s infinite ease-in-out !important;
}

@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); transform: scale(1); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); transform: scale(1.08); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); transform: scale(1); }
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.send-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.chat-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .starter-grid {
    grid-template-columns: 1fr;
  }
  .chat-messages-container {
    padding: 14px 14px 120px 14px;
  }
}