 
  :root {
    --primary-violet: #6b2fa1;
    --accent-pink: #ec4899;
    --bg: #fafafa;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bubble-user: #f3e8ff;
    --bubble-bot: #ffffff;
  }

  * { box-sizing: border-box; }

    body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
      height: 100vh;
      overflow: hidden; /* keep desktop fixed layout */
    }


  /* ✅ FIX: app is a horizontal layout */
  .app {
  display: flex;
  height: 100vh;   /* 🔑 */
  width: 100%;
}

  /* ================= SIDEBAR ================= */
  .sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  height: 100vh;   /* 🔑 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-actions {
  margin-top: auto;        /* 🔑 pushes to bottom */
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;               /* space between buttons */
  padding-bottom: 16px;
}


  .logo-placeholder {
    width: 150px;   ;
    height: 150px;
    display: flex;
    align-items: top;
    justify-content: top;
  }

  .logo-placeholder img.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .new-chat-btn{
    width: 100%;
    margin-top:24px;
    background: linear-gradient(90deg, var(--primary-violet), var(--accent-pink));
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  .logout-btn{
    width: 100%;
    background: linear-gradient(90deg, var(--primary-violet), var(--accent-pink));
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  /* ================= MAIN ================= */
  .main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;   /* 🔑 */
  background: var(--bg);
}


  .main-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
  }

  .title {
    font-size: 22px;
    font-weight: 600;
    background: linear-gradient(90deg, var(--primary-violet), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .messages {
  flex: 1;                 /* 🔑 takes remaining space */
  padding: 32px 24px;
  overflow-y: auto;     
    scroll-behavior: smooth;
      scrollbar-width: thin;

}

  .message {
    max-width: 75%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 14px;
    line-height: 1.5;
    border: 1px solid var(--border);
    white-space: pre-wrap;
  }
.messages::-webkit-scrollbar {
  width: 8px;
}
.messages::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
}
  .user {
    margin-left: auto;
    background: var(--bubble-user);
  }

  .bot {
    margin-right: auto;
    background: var(--bubble-bot);
  }

  .sources {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
  }

  .input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: #ffffff;
  }

  .input-box {
    display: flex;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px 14px;
    transition: border-color 0.2s ease;
  }

  .input-box:focus-within {
    border-color: var(--accent-pink);
  }

  .input-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
  }

  .voice-btn {
    border: none;
    background: none;
    background-color: transparent;
    color: var(--muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
  }

  .voice-btn:hover:not(:disabled) {
    color: var(--text);
  }

  .voice-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .voice-btn.recording {
    color: var(--accent-pink);
  }

  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
  }

  .voice-status {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    min-height: 18px;
  }

  .input-box button {
    background: linear-gradient(90deg, var(--primary-violet), var(--accent-pink));
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
  }

  .welcome {
    margin-top: 120px;
    text-align: center;
  }

  .welcome h1 {
    font-size: 36px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, var(--primary-violet), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .welcome p {
    color: var(--muted);
    font-size: 18px;
  }

  .hidden { display: none; }

  @media (max-width: 768px) {
    .sidebar {
      display: none; /* mobile: hide sidebar like ChatGPT */
    }

    /* Allow the page to scroll on mobile so the on-screen keyboard doesn't hide the input */
    body {
      overflow: auto;
      height: auto;
      min-height: 100vh;
    }

    /* Give messages extra bottom padding so the sticky input doesn't cover content when keyboard opens */
    .messages {
      padding-bottom: 140px;
    }

    /* Make the input area stick to the bottom of the viewport but remain in the document flow */
    .input-area {
      position: sticky;
      bottom: 0;
      z-index: 50;
      background: #ffffff;
      border-top: 1px solid var(--border);
    }
  }

  /* Hide by default on desktop */
.mobile-new-chat {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  font-weight: 600;
  color: var(--primary-violet);
  cursor: pointer;
}

.header-logo {
  display: none; /* hidden on desktop */
}

/* Mobile-specific styles */
@media (max-width: 768px) {

  /* Hide sidebar on mobile */
  .sidebar {
    display: none;
  }

  /* Show mobile logo and new chat button */
  .mobile-new-chat {
    display: block;
  }

  .header-logo {
    display: block;
  }

  .header-logo img {
    height: 60px;       /* adjust as needed */
    width: auto;
    object-fit: contain;
  }

  /* Header layout: space-between */
  .main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
  }

  /* Slightly smaller title for mobile */
  .title {
    font-size: 18px;
    flex: 1;   /* take remaining space */
    text-align: center;
  }
}

/* Header right-side actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile menu hidden by default */
.mobile-menu {
  display: none;
  position: relative;
}

.menu-btn {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-dropdown {
  display: none;
  /* use fixed positioning so the dropdown is never clipped by overflow:hidden parents */
  position: fixed;
  right: 16px;
  top: 64px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 160px;
  z-index: 2000;
  max-height: 60vh; /* ensure it doesn't overflow the viewport */
  overflow: auto;
}

.menu-dropdown button {
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-family: Poppins, sans-serif;
}

.menu-dropdown button:hover {
  background: #f5f5f5;
}

/* Related question chips below assistant messages */
.related-questions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 18px 0;
  padding: 8px 12px;
  background: transparent;
}
.related-questions-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 6px;
  font-family: Poppins, sans-serif; /* match assistant answer font */
}
.related-question-btn {
  background: #f1f3f4;
  border: none;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-family: Poppins, sans-serif; /* match assistant answer font */
  color: var(--text);
}
.related-question-btn:hover { background:#e6e9ea; }

/* 📱 Mobile behavior */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-menu {
    display: block;
  }
}



