:root {
  --chat-sidebar-bg: rgba(15, 23, 42, 0.95);
  --chat-sidebar-hover: rgba(255, 255, 255, 0.08);
  --chat-sidebar-active: rgba(255, 255, 255, 0.15);
  --chat-main-bg: #f3f4f6;
  --chat-header-bg: rgba(255, 255, 255, 0.85);
  --chat-bubble-user: #0066cc;
  --chat-bubble-user-bg: #0066cc;
  --chat-bubble-bot-bg: #ffffff;
  --chat-border: rgba(226, 232, 240, 0.8);
  --text-dark: #0f172a;
  --text-light: #f8fafc;
  --text-muted: #64748b;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #10b981 100%);
  --sidebar-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --glass-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.08);
  --premium-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --font-heading: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Theme-adaptive tokens */
  --chat-input-bg: #ffffff;
  --chat-card-bg: #ffffff;
  --btn-action-bg: #ffffff;
  --btn-action-hover-bg: #f1f5f9;

  /* Prescription card components */
  --prescription-bg: #fffbeb;
  --prescription-border: #fde68a;
  --prescription-header-bg: #fef3c7;
  --prescription-header-color: #78350f;
  --prescription-text-color: #451a03;

  /* Report card components */
  --report-bg: #f0fdfa;
  --report-border: #99f6e4;
  --report-header-bg: #ccfbf1;
  --report-header-color: #0f766e;
  --report-text-color: #115e59;

  /* Feedback rows */
  --feedback-btn-bg: #f1f5f9;
}

body.dark-theme {
  --chat-main-bg: #090e1a;
  --chat-header-bg: rgba(13, 19, 33, 0.85);
  --chat-bubble-bot-bg: #131c2e;
  --chat-border: rgba(51, 65, 85, 0.45);
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --premium-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);

  --chat-input-bg: #131c2e;
  --chat-card-bg: #131c2e;
  --btn-action-bg: #1e293b;
  --btn-action-hover-bg: #334155;

  /* Prescription card dark values */
  --prescription-bg: #1e1b12;
  --prescription-border: #452a08;
  --prescription-header-bg: #2d1f10;
  --prescription-header-color: #f59e0b;
  --prescription-text-color: #fef3c7;

  /* Report card dark values */
  --report-bg: #0b1a18;
  --report-border: #0d4f45;
  --report-header-bg: #0c3530;
  --report-header-color: #14b8a6;
  --report-text-color: #ccfbf1;

  /* Feedback rows */
  --feedback-btn-bg: #1e293b;
}

/* Theme transition rule for premium feel */
body, html, .aayu-chat-container, .aayu-chat-main, .chat-main-header, .welcome-card, .chat-row.bot, .chat-rec-card, .chat-prescription-card, .chat-report-card, .chat-input-line, .btn-header-action, .btn-prompt-attach, .btn-prompt-mic, .chat-fb-btn, .btn-voice-speech, .chat-report-table th, .chat-report-table td, .chat-prescription-table th, .chat-prescription-table td {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

* {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-body);
  background-color: var(--chat-main-bg);
  color: var(--text-dark);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP CONTAINER ===== */
.aayu-chat-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  background-color: var(--chat-main-bg);
  position: relative;
}

/* ===== SIDEBAR ===== */
.aayu-chat-sidebar {
  width: 260px;
  background: var(--sidebar-gradient);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Sidebar Branding */
.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.sidebar-brand-name {
  color: var(--text-light);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.sidebar-brand-name span {
  background: linear-gradient(135deg, #2ecc71 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Action Button */
.sidebar-new-chat {
  padding: 16px;
}
.btn-new-chat {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-radius: 12px;
  padding: 11px 16px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-new-chat:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-new-chat i {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Scrollable History List */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-history::-webkit-scrollbar {
  width: 4px;
}
.sidebar-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.sidebar-history::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}
.history-title {
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 14px 8px 8px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.history-item i {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.history-item:hover {
  background: var(--chat-sidebar-hover);
  color: var(--text-light);
}
.history-item:hover i {
  color: rgba(255, 255, 255, 0.6);
}
.history-item.active {
  background: var(--chat-sidebar-active);
  color: var(--text-light);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.history-item.active i {
  color: #10b981;
}
.history-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.history-item:hover .history-item-actions {
  opacity: 1;
}
.history-action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  padding: 2px 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}
.history-action-btn:hover {
  color: var(--text-light);
}
.history-action-btn.delete-btn:hover {
  color: #ef4444;
}

/* Sidebar Footer (Profile) */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: rgba(0, 0, 0, 0.2);
}
.footer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.profile-details {
  min-width: 0;
}
.profile-name {
  color: var(--text-light);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  font-family: var(--font-heading);
}
.profile-role {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0;
}
.btn-sidebar-logout {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
}
.btn-sidebar-logout:hover {
  color: #ef4444;
  transform: scale(1.05);
}

/* ===== MAIN CHAT MAIN WINDOW ===== */
.aayu-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  position: relative;
  background-color: var(--chat-main-bg);
}

/* Header Bar */
.chat-main-header {
  height: 65px;
  background: var(--chat-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
  z-index: 90;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.btn-sidebar-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}
.header-chat-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-dark);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-header-action {
  background-color: var(--btn-action-bg);
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.btn-header-action:hover {
  color: var(--chat-bubble-user);
  border-color: rgba(0, 102, 204, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 102, 204, 0.06);
}
.btn-header-action i {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Message List scrollarea */
.chat-main-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 30px;
  display: flex;
  flex-direction: column;
}

/* Welcome state / Homepage screen */
.welcome-screen {
  max-width: 760px;
  margin: auto;
  padding: 60px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-logo-glowing {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 28px;
}
.welcome-logo-glowing::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: var(--primary-gradient);
  z-index: 1;
  opacity: 0.3;
  filter: blur(12px);
  animation: glow-pulse 3s infinite ease-in-out;
}
.welcome-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 3px solid #ffffff;
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.25);
}
@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.15); opacity: 0.5; }
}
.welcome-heading {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1.2px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #0284c7 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.welcome-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 520px;
  margin-bottom: 44px;
  line-height: 1.5;
}
.welcome-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}
.welcome-card {
  background-color: var(--chat-bubble-bot-bg);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--premium-shadow);
}
.welcome-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -4px rgba(2, 132, 199, 0.08);
}
.welcome-card-icon {
  font-size: 1.7rem;
  margin-bottom: 12px;
}
.welcome-card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.welcome-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}

/* Chat Lines (ChatGPT Style) */
.chat-row {
  width: 100%;
  padding: 28px 24px;
  border-bottom: 1px solid var(--chat-border);
  animation: message-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes message-slide-up {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.chat-row.user {
  background-color: transparent;
}
.chat-row.bot {
  background-color: var(--chat-bubble-bot-bg);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.01), inset 0 -1px 0 rgba(0,0,0,0.01);
}
.chat-row-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  font-weight: 800;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.chat-row.bot .chat-avatar {
  background: var(--chat-bubble-bot-bg);
  color: #fff;
  border: 2px solid transparent;
  background-image: linear-gradient(var(--chat-bubble-bot-bg), var(--chat-bubble-bot-bg)), var(--primary-gradient);
  background-origin: border-box;
  background-clip: content-box, border-box;
  animation: avatar-pulse 3s infinite ease-in-out;
  padding: 2px;
}
@keyframes avatar-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15); }
  50% { transform: scale(1.05); box-shadow: 0 4px 16px rgba(2, 132, 199, 0.3); }
}
.chat-row.user .chat-avatar {
  background-color: #e2e8f0;
  color: #475569;
  font-size: 0.78rem;
  border: 1px solid rgba(0,0,0,0.05);
}
.typing-writing::after {
  content: '▊';
  display: inline-block;
  color: var(--chat-bubble-user);
  margin-left: 4px;
  font-size: 0.95rem;
  animation: cursor-blink 0.8s infinite;
  vertical-align: middle;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.chat-content {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-dark);
  font-weight: 500;
  font-family: var(--font-body);
}
.chat-content p {
  margin: 0 0 14px 0;
}
.chat-content p:last-child {
  margin-bottom: 0;
}
.chat-content strong {
  font-weight: 700;
  color: var(--text-dark);
}
.chat-content ul, .chat-content ol {
  margin: 8px 0;
  padding-left: 20px;
}
.chat-content li {
  margin-bottom: 6px;
}

/* Recommendation Cards Inside ChatGPT row */
.chat-cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.chat-rec-card {
  background: var(--chat-card-bg);
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 500px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.chat-rec-card:hover {
  border-color: var(--chat-bubble-user);
  box-shadow: 0 4px 12px rgba(0, 87, 184, 0.05);
}
.chat-rec-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.chat-rec-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.chat-rec-icon.doctor { background-color: #eff6ff; color: #3b82f6; }
.chat-rec-icon.medicine { background-color: #f0fdf4; color: #22c55e; }
.chat-rec-icon.test { background-color: #fff7ed; color: #f97316; }
.chat-rec-info {
  min-width: 0;
}
.chat-rec-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-rec-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.chat-rec-btn {
  background-color: var(--chat-bubble-user);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-rec-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

/* Prescription Preview card in chat */
.chat-prescription-card {
  background: var(--prescription-bg);
  border: 1px solid var(--prescription-border);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  max-width: 580px;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.05);
}
.chat-prescription-card h4 {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--prescription-header-color);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-prescription-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.chat-prescription-table th {
  background-color: var(--prescription-header-bg);
  color: var(--prescription-header-color);
  font-weight: 800;
  padding: 8px;
  text-align: left;
  border-bottom: 1.5px solid var(--prescription-border);
}
.chat-prescription-table td {
  padding: 8px;
  color: var(--prescription-text-color);
  font-weight: 600;
  border-bottom: 1px solid var(--prescription-header-bg);
}

/* Emergency Alert */
.chat-emergency-card {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  max-width: 500px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}
.chat-emergency-card h4 {
  font-size: 0.95rem;
  font-weight: 900;
  margin: 0 0 6px 0;
}
.chat-emergency-card p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  opacity: 0.95;
}
.chat-emergency-card a {
  color: #fff;
  font-weight: 900;
  text-decoration: underline;
}

/* Feedback stars */
.chat-feedback-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.chat-fb-btn {
  background: var(--feedback-btn-bg);
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-weight: 700;
}
.chat-fb-btn:hover {
  background-color: var(--btn-action-hover-bg);
  border-color: var(--chat-bubble-user);
  color: var(--chat-bubble-user);
}
.chat-fb-btn.selected {
  background-color: var(--chat-bubble-user);
  color: #fff;
  border-color: var(--chat-bubble-user);
}

/* Typing row */
.chat-typing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.typing-dots {
  display: flex;
  gap: 5px;
  background-color: var(--chat-bubble-bot-bg);
  border: 1px solid var(--chat-border);
  padding: 12px 18px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #94a3b8;
  border-radius: 50%;
  animation: dot-bounce-chat 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce-chat {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ===== INPUT CONTAINER ===== */
.chat-main-input-wrap {
  padding: 20px 24px;
  background-color: transparent;
  flex-shrink: 0;
  border-top: none;
}
.chat-input-box-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Image preview in prompt box */
.chat-prompt-img-preview {
  display: none;
  padding: 10px 14px;
  background-color: var(--chat-input-bg);
  border: 1px solid var(--chat-border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  animation: preview-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes preview-slide-in {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.prompt-img-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prompt-img-inner img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--chat-border);
}
.prompt-img-text {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
}
.btn-prompt-img-remove {
  background: rgba(239, 68, 68, 0.08);
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-prompt-img-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.05);
}

/* Input line */
.chat-input-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--chat-input-bg);
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  padding: 8px 10px 8px 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
}
.chat-input-line:focus-within {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 8px 30px rgba(2, 132, 199, 0.08);
}
.chat-prompt-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 0;
}
.chat-prompt-input::placeholder {
  color: #94a3b8;
}
.btn-prompt-attach {
  background-color: var(--btn-action-bg);
  border: 1px solid var(--chat-border);
  color: #64748b;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-prompt-attach:hover {
  background-color: var(--btn-action-hover-bg);
  color: var(--text-dark);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.btn-prompt-send {
  background: var(--primary-gradient);
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
}
.btn-prompt-send:hover {
  transform: scale(1.04) translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.3);
}
.btn-prompt-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Prompt box disclaimer */
.chat-prompt-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 8px;
}

/* ===== OVERLAY FOR MOBILE SIDEBAR ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 95;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ===== MOBILE RESPONSIVE LAYOUTS ===== */
@media (max-width: 768px) {
  .btn-sidebar-toggle {
    display: block;
  }
  .aayu-chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 1000;
  }
  .aayu-chat-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
    opacity: 1;
  }
  .welcome-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .chat-row {
    padding: 16px 12px;
  }
  .chat-row-inner {
    gap: 12px;
  }
  .chat-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .chat-content {
    font-size: 0.88rem;
  }
  .chat-main-input-wrap {
    padding: 10px 12px;
  }
  .chat-input-line {
    padding: 4px 6px 4px 12px;
  }
  .chat-prompt-input {
    font-size: 0.88rem;
    padding: 6px 0;
  }
  .btn-prompt-send, .btn-prompt-attach, .btn-prompt-mic {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .btn-header-action span {
    display: none;
  }
  .btn-header-action {
    padding: 6px 10px;
  }
  .welcome-screen {
    padding: 20px 10px;
  }
  .welcome-logo-glowing {
    width: 70px;
    height: 70px;
    margin-bottom: 16px;
  }
  .welcome-heading {
    font-size: 1.5rem;
  }
  .welcome-sub {
    font-size: 0.88rem;
    margin-bottom: 24px;
  }
  .welcome-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .welcome-card {
    padding: 14px;
  }
}

/* ===== NEW COMPONENT STYLES: MIC & SESSION ACTIONS ===== */

.btn-prompt-mic {
  background-color: var(--btn-action-bg);
  border: 1px solid var(--chat-border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-prompt-mic:hover {
  background-color: var(--btn-action-hover-bg);
  color: var(--chat-bubble-user);
  border-color: var(--chat-bubble-user);
  transform: scale(1.05);
}

.btn-prompt-mic.listening {
  background-color: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
  animation: mic-pulse 1.5s infinite ease-in-out;
}

@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Sidebar Actions List spacing */
.history-item {
  padding-right: 55px; /* Leave space for hover actions */
}

.history-item-actions {
  display: none;
  align-items: center;
  gap: 6px;
  position: absolute;
  right: 8px;
  background: linear-gradient(90deg, rgba(15,23,42,0) 0%, rgba(15,23,42,1) 30%);
  padding-left: 20px;
  height: 100%;
  top: 0;
  border-radius: 0 10px 10px 0;
}

.history-item:hover .history-item-actions {
  display: flex;
}

.history-item.active .history-item-actions {
  background: linear-gradient(90deg, rgba(51,65,85,0) 0%, rgba(51,65,85,1) 30%);
}

.history-action-btn {
  background: none;
  border: none;
  padding: 4px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  font-size: 0.8rem;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-action-btn:hover {
  color: #fff;
}

.history-action-btn.delete-btn:hover {
  color: #ef4444;
}

/* Print Styling Isolation */
@media print {
  body * {
    visibility: hidden;
  }
  #print-area, #print-area * {
    visibility: visible;
  }
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

/* ===== NEW STYLES: 5 PREMIUM FEATURES ===== */

/* 1. Voice Synthesis (TTS) Button */
.btn-voice-speech {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--chat-border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
}
.btn-voice-speech:hover {
  background-color: var(--btn-action-hover-bg);
  color: var(--chat-bubble-user);
  border-color: rgba(0, 102, 204, 0.2);
}
.btn-voice-speech.speaking {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
  animation: speaking-pulse 1.2s infinite ease-in-out;
}
@keyframes speaking-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 2. Lab Report Analyzer Table */
.chat-report-card {
  background: var(--report-bg);
  border: 1px solid var(--report-border);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  max-width: 620px;
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.04);
}
.chat-report-card h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--report-header-color);
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 0px;
}
.chat-report-table th {
  background-color: var(--report-header-bg);
  color: var(--report-header-color);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1.5px solid var(--report-border);
}
.chat-report-table td {
  padding: 10px 12px;
  color: var(--report-text-color);
  font-weight: 500;
  border-bottom: 1px solid var(--report-header-bg);
}
.chat-report-table tr:last-child td {
  border-bottom: none;
}
.report-status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.report-status-badge.high { background-color: #fee2e2; color: #ef4444; }
.report-status-badge.low { background-color: #ffedd5; color: #f97316; }
.report-status-badge.normal { background-color: #dcfce7; color: #10b981; }

/* 3. Medication Tracker Sidebar UI */
.tracker-sidebar-tab {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  margin: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tracker-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.tracker-title {
  color: #10b981;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tracker-pill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background-color: rgba(255, 255, 255, 0.01);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}
.tracker-pill-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
}
.tracker-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tracker-pill-name {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tracker-pill-dose {
  color: rgba(255,255,255,0.35);
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 2px;
}
.tracker-pill-status-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.tracker-pill-status-btn:hover {
  border-color: #10b981;
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}
.tracker-pill-status-btn.checked {
  background-color: #10b981;
  color: #ffffff;
  border-color: #10b981;
  text-decoration: line-through;
}

/* 4. Contextual Quick Actions Area */
.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  max-width: 550px;
}
.chat-action-btn {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
}
.chat-action-btn:hover {
  background-color: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.15);
}
.chat-action-btn.book_specialty {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}
.chat-action-btn.book_specialty:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}
.chat-action-btn.book_test {
  background-color: #fff7ed;
  border-color: #fed7aa;
  color: #ea580c;
}
.chat-action-btn.book_test:hover {
  background-color: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.15);
}
.chat-action-btn.call_emergency {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  animation: pulse-emergency-btn 1.5s infinite ease-in-out;
}
.chat-action-btn.call_emergency:hover {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}
@keyframes pulse-emergency-btn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

/* 5. Flashing Emergency Card Upgrades */
.chat-emergency-card.flashing-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
  border: 1.5px solid #fee2e2;
  animation: border-flash 1s infinite ease-in-out;
}
@keyframes border-flash {
  0%, 100% { border-color: #fee2e2; }
  50% { border-color: #ef4444; }
}
.emergency-action-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.emergency-call-btn {
  flex: 1;
  min-width: 140px;
  background-color: #ffffff;
  color: #dc2626;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.emergency-call-btn:hover {
  background-color: #fecaca;
  color: #991b1b;
  transform: scale(1.02);
}

/* Premium Dark Theme Specific Overrides */
body.dark-theme .chat-rec-icon.doctor {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
body.dark-theme .chat-rec-icon.medicine {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
body.dark-theme .chat-rec-icon.test {
  background-color: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}
body.dark-theme .chat-rec-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}
body.dark-theme .btn-voice-speech {
  background: rgba(255, 255, 255, 0.04);
}
body.dark-theme .btn-voice-speech:hover {
  background-color: rgba(0, 102, 204, 0.15);
}
body.dark-theme .chat-fb-btn:hover {
  background-color: rgba(0, 102, 204, 0.15);
}
body.dark-theme .chat-action-btn {
  background-color: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.3);
  color: #4ade80;
}
body.dark-theme .chat-action-btn:hover {
  background-color: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}
body.dark-theme .chat-action-btn.book_specialty {
  background-color: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #60a5fa;
}
body.dark-theme .chat-action-btn.book_specialty:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
body.dark-theme .chat-action-btn.book_test {
  background-color: rgba(234, 88, 12, 0.15);
  border-color: rgba(234, 88, 12, 0.3);
  color: #fb923c;
}
body.dark-theme .chat-action-btn.book_test:hover {
  background-color: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}
body.dark-theme .chat-action-btn.call_emergency {
  background-color: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #f87171;
}
body.dark-theme .chat-action-btn.call_emergency:hover {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

