*{box-sizing:border-box;margin:0;padding:0}
:root{
  --green:#1B5E20;
  --green-hover:#2E7D32;
  --green-gradient:linear-gradient(135deg, #1B5E20, #43A047);
  --green-light:rgba(43,160,71,0.08);
  --green-border:rgba(43,160,71,0.18);
  --white:#ffffff;
  --bg-chat:#f8fafd;
  --gray-sidebar:#f0f4f9;
  --gray-hover:#e1e6eb;
  --gray-border:#dadce0;
  --text-dark:#1f1f1f;
  --text-mid:#444746;
  --text-muted:#757575;
  --font:'Outfit','Noto Sans Thai',sans-serif;
  --shadow-sm:0 1px 3px rgba(0,0,0,0.1);
  --shadow-md:0 4px 12px rgba(0,0,0,0.08);
}

body{font-family:var(--font);background:#080b16;color:#e8f5e9;overflow-x:hidden}
.hidden{display:none!important}
canvas{position:fixed;top:0;left:0;z-index:-1;pointer-events:none}

/* ==========================================
   LANDING PAGE (Dark Typhoon AI Inspired)
   ========================================== */
#land {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(rgba(8, 11, 22, 0.91), rgba(8, 11, 22, 0.91)), url('bg.png') no-repeat center center/cover;
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 2.2rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8,11,22,0.45);
  backdrop-filter: blur(20px);
  border-radius: 40px;
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}
.nav-logo span {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #a5d6a7, #38bd8a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #fff;
  z-index: 1001;
}
.nav-menu-toggle svg {
  fill: #fff;
  width: 28px;
  height: 28px;
}
nav .nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
}
nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  transition: color .2s;
}
nav a:hover {
  color: #38bd8a;
}
.nav-try-btn {
  border: 2px solid transparent;
  background: linear-gradient(#080b16, #080b16) padding-box, linear-gradient(135deg, #a5d6a7, #38bd8a) border-box;
  border-radius: 24px;
  padding: .55rem 1.5rem;
  color: #fff!important;
  font-weight: 600;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.nav-try-btn:hover {
  background: linear-gradient(135deg, #1B5E20, #43A047) padding-box, linear-gradient(135deg, #a5d6a7, #38bd8a) border-box;
  color: #fff!important;
  box-shadow: 0 0 15px rgba(56,189,138,0.4);
  transform: translateY(-1px);
}
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 11rem 2rem 5rem; /* Space out top to prevent navbar overlap */
  max-width: 900px;
  margin: 0 auto;
}
.hero-tag {
  font-size: .8rem;
  color: #38bd8a;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  background: rgba(56,189,138,0.08);
  padding: .5rem 1.2rem;
  border-radius: 24px;
  border: 1px solid rgba(56,189,138,0.18);
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.8rem;
  color: #fff;
  letter-spacing: -0.5px;
}
.hero h1 span.gradient-text {
  background: linear-gradient(135deg, #a5d6a7, #38bd8a 45%, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.hero p {
  font-size: 1.12rem;
  color: rgba(255,255,255,0.7);
  max-width: 620px;
  line-height: 1.75;
  margin-bottom: 3rem;
}
.hero-btns {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  background: linear-gradient(135deg, #1B5E20, #43A047);
  color: #fff;
  padding: .9rem 2.4rem;
  border-radius: 30px;
  border: none;
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 24px rgba(43,160,71,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(43,160,71,0.45);
}
.btn-outline {
  background: transparent;
  color: #fff;
  padding: .9rem 2.2rem;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.2);
  font-family: var(--font);
  font-size: 1.02rem;
  cursor: pointer;
  transition: all .25s;
  font-weight: 500;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.06);
  border-color: #38bd8a;
}
/* Features Carousel CSS */
.features-carousel-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem 8rem;
  position: relative;
  z-index: 1;
}
.carousel-view {
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  background: transparent;
  border: none;
  backdrop-filter: none;
  padding: 1.5rem 0 0.5rem; /* Space top and bottom */
}
.carousel-slides {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.carousel-slide {
  min-width: 100%;
  opacity: 0.15;
  transition: opacity 0.6s, transform 0.6s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: scale(0.95);
  padding-top: 2rem; /* Add padding to prevent the icon box from getting cut off at the top when it animates or scales */
}
.carousel-slide.active {
  opacity: 1;
  transform: scale(1);
}
.slide-icon-box {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  position: relative;
  backdrop-filter: blur(8px);
  transition: transform 0.3s;
}
.slide-icon-box.green-theme {
  background: rgba(56, 189, 138, 0.12);
  border: 1.5px solid rgba(56, 189, 138, 0.28);
  box-shadow: 0 0 25px rgba(56, 189, 138, 0.22), inset 0 1px 4px rgba(255,255,255,0.1);
}
.slide-icon-box.purple-theme {
  background: rgba(187, 134, 252, 0.12);
  border: 1.5px solid rgba(187, 134, 252, 0.28);
  box-shadow: 0 0 25px rgba(187, 134, 252, 0.22), inset 0 1px 4px rgba(255,255,255,0.1);
}
.slide-icon-box.blue-theme {
  background: rgba(41, 182, 246, 0.12);
  border: 1.5px solid rgba(41, 182, 246, 0.28);
  box-shadow: 0 0 25px rgba(41, 182, 246, 0.22), inset 0 1px 4px rgba(255,255,255,0.1);
}
.slide-icon-box.gold-theme {
  background: rgba(241, 196, 15, 0.12);
  border: 1.5px solid rgba(241, 196, 15, 0.28);
  box-shadow: 0 0 25px rgba(241, 196, 15, 0.22), inset 0 1px 4px rgba(255,255,255,0.1);
}
.carousel-slide.active .slide-icon-box {
  animation: floatIcon 3s ease-in-out infinite alternate;
}
@keyframes floatIcon {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}
.carousel-slide h3 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #ffffff;
  margin-bottom: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.carousel-slide p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 680px;
  line-height: 1.8;
  margin-bottom: 2.2rem;
}
.slide-action-btn {
  background: linear-gradient(135deg, #1B5E20, #43A047);
  color: #fff;
  padding: .9rem 2.4rem;
  border-radius: 30px;
  border: none;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 4px 20px rgba(56, 189, 138, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.slide-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(56, 189, 138, 0.55);
}
.carousel-indicators {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin-top: 3.5rem;
  width: 100%;
}
.indicator-bar {
  height: 6px;
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s;
}
.indicator-bar.active {
  background: rgba(255, 255, 255, 0.22);
}
.indicator-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bd8a, #a5d6a7);
  box-shadow: 0 0 10px rgba(56, 189, 138, 0.7);
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 3px;
}

/* Google Sign-In & Login Modals CSS */
.google-btn-container {
  display: flex;
  align-items: center;
}
.google-login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.google-login-btn:hover {
  background: #f7f9fa;
  border-color: #d2d4d7;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.google-login-btn svg {
  width: 18px;
  height: 18px;
}
.user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--green);
}
.logout-btn-side {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  text-align: left;
  padding: 2px 0;
  transition: color 0.15s;
}
.logout-btn-side:hover {
  color: #c62828;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 11, 22, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: #ffffff;
  color: #1f1f1f;
  border-radius: 24px;
  max-width: 440px;
  width: 90%;
  padding: 2.2rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-overlay.active .modal-card {
  transform: scale(1);
}
.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}
.modal-card h3 {
  font-size: 1.4rem;
  color: #1B5E20;
  margin-bottom: 0.8rem;
  font-weight: 700;
  font-family: var(--font);
}
.modal-card p {
  font-size: 0.95rem;
  color: #444746;
  line-height: 1.6;
  margin-bottom: 1.8rem;
}
.modal-google-btn-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1rem;
}
.acc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
  width: 100%;
  text-align: left;
}
.acc-item:hover {
  background: #f1f5f9;
  border-color: #38bd8a;
  transform: translateY(-1px);
}
.acc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1B5E20;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.acc-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.acc-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f1f1f;
}
.acc-email {
  font-size: 0.75rem;
  color: #64748b;
}

/* ==========================================
   CHAT SYSTEM (Light White Gemini Style)
   ========================================== */
#chat-app {
  display: flex;
  height: 100vh;
  background: var(--white);
  color: var(--text-dark);
  position: relative;
  overflow: hidden;
}

/* Collapsible Sidebar */
.sidebar {
  width: 260px;
  background: var(--gray-sidebar);
  border-right: 1px solid var(--gray-border);
  display: flex;
  flex-direction: column;
  padding: .75rem;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  z-index: 20;
}
.sidebar.collapsed {
  width: 68px;
  padding: .75rem .5rem;
}
.side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .5rem 1.2rem;
  height: 52px;
}
.sidebar.collapsed .side-header {
  justify-content: center;
  padding: .5rem 0 1.2rem;
}
.side-logo-wrap {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
}
.side-logo-spark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--green), var(--green-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}
.toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  transition: background 0.15s;
}
.toggle-btn:hover {
  background: var(--gray-hover);
}
.toggle-btn svg {
  fill: var(--text-mid);
  width: 20px;
  height: 20px;
}
.sidebar.collapsed .side-brand,
.sidebar.collapsed .toggle-btn {
  display: none;
}

/* Sidebar Actions */
.new-chat-btn {
  width: 100%;
  padding: .8rem 1rem;
  border: none;
  background: var(--gray-hover);
  border-radius: 24px;
  cursor: pointer;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-dark);
  text-align: left;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: background 0.15s;
  margin-bottom: 1.2rem;
}
.new-chat-btn:hover {
  background: var(--gray-border);
}
.new-chat-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--text-mid);
}
.sidebar.collapsed .new-chat-btn {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  justify-content: center;
  align-self: center;
}
.sidebar.collapsed .new-chat-btn span {
  display: none;
}

/* Nav Items */
.side-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.side-item {
  width: 100%;
  padding: .65rem 1rem;
  border: none;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-mid);
  text-align: left;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: background 0.15s;
}
.side-item:hover {
  background: var(--gray-hover);
}
.side-item svg {
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}
.sidebar.collapsed .side-item {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  justify-content: center;
  align-self: center;
}
.sidebar.collapsed .side-item span {
  display: none;
}

/* History Items */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .55rem .85rem;
  border: none;
  background: transparent;
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font);
  font-size: .83rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: background 0.15s;
  margin-bottom: 2px;
}
.history-item:hover {
  background: var(--gray-hover);
}
.history-item.active {
  background: var(--gray-hover);
  color: var(--green);
  font-weight: 600;
}
.history-item.active svg {
  fill: var(--green);
}
.history-content {
  display: flex;
  align-items: center;
  gap: .6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-del-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s;
}
.history-item:hover .history-del-btn {
  opacity: 1;
}
.history-del-btn:hover {
  background: rgba(0,0,0,0.06);
  color: #c62828;
}
.sidebar.collapsed .history-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.sidebar.collapsed .history-item .history-del-btn,
.sidebar.collapsed .history-item span {
  display: none!important;
}

/* Section Divider */
.side-section {
  font-size: .75rem;
  color: var(--text-muted);
  padding: 1.2rem 1rem .4rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar.collapsed .side-section {
  display: none;
}

/* Recent Log List */
.recent-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sidebar.collapsed .recent-list {
  display: none;
}

/* Sidebar Footer */
.side-footer {
  margin-top: auto;
  border-top: 1px solid var(--gray-border);
  padding-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border-radius: 12px;
  transition: background 0.15s;
  cursor: pointer;
}
.user-profile:hover {
  background: var(--gray-hover);
}
.user-avatar {
  width: 34px;
  height: 34px;
  background: #7b1fa2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-name {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-dark);
}
.user-role {
  font-size: .72rem;
  color: var(--text-muted);
}
.sidebar.collapsed .user-details {
  display: none;
}
.sidebar.collapsed .user-profile {
  padding: 0;
  width: 44px;
  height: 44px;
  justify-content: center;
  align-self: center;
}

/* Main Chat Section */
.main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #edf3ed 100%);
  position: relative;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  height: 56px;
  border-bottom: 1px solid var(--gray-border);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 5;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.collapsed-menu-btn {
  display: none;
}
.sidebar.collapsed + .main-chat .collapsed-menu-btn {
  display: flex;
}
.chat-model {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-dark);
}
.model-dot {
  width: 8px;
  height: 8px;
  background: #38bd8a;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Chat Scroll Area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 0;
}
.chat-area::-webkit-scrollbar {
  width: 8px;
}
.chat-area::-webkit-scrollbar-thumb {
  background: var(--gray-border);
  border-radius: 4px;
}

/* Welcome Panel (Gemini style) */
.welcome-container {
  max-width: 640px;
  margin: 6vh auto;
  padding: 0 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-heading {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 500;
  margin-bottom: 2rem;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.welcome-heading span.gradient-name {
  background: linear-gradient(135deg, var(--green-hover), #38bd8a, #d4a843);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.welcome-container .input-box {
  width: 100%;
  box-shadow: var(--shadow-md);
  background: var(--white);
  border: 1px solid var(--gray-border);
}
.welcome-container .input-box:focus-within {
  border-color: #38bd8a;
}
.welcome-container .chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 2.2rem;
  justify-content: center;
}

/* Suggestion Chips */
.chip {
  padding: .65rem 1.2rem;
  border: 1px solid var(--gray-border);
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  color: var(--text-mid);
  font-family: var(--font);
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover {
  background: var(--gray-sidebar);
  border-color: #38bd8a;
  color: var(--green);
  transform: translateY(-1px);
}

/* Chat Messages */
.msg {
  max-width: 768px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
}
.msg-user {
  display: flex;
  justify-content: flex-end;
}
.msg-user .bubble {
  background: var(--gray-sidebar);
  color: var(--text-dark);
  padding: .8rem 1.2rem;
  border-radius: 20px;
  font-size: .95rem;
  line-height: 1.6;
  max-width: 80%;
  box-shadow: var(--shadow-sm);
}
.msg-ai-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.ai-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--green), var(--green-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: var(--shadow-sm);
}
.msg-ai-content {
  flex: 1;
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text-dark);
}
.msg-ai-content ul {
  padding-left: 1.4rem;
  margin: .5rem 0;
}
.msg-ai-content li {
  margin: .35rem 0;
}
.msg-ai-content strong {
  color: var(--green);
}
.msg-ai-content a {
  color: var(--green-hover);
  text-decoration: none;
  border-bottom: 1px dashed var(--green-hover);
}

/* Input Boxes & Forms */
.input-zone {
  padding: .75rem 1.5rem 1.2rem;
  background: transparent;
  position: relative;
  z-index: 5;
}
.input-box {
  max-width: 768px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 28px;
  padding: .5rem .6rem .5rem 1.2rem;
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  transition: border .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.input-box:focus-within {
  border-color: #38bd8a;
  box-shadow: 0 0 0 3px rgba(56,189,138,0.12);
}
.input-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text-dark);
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  padding: .5rem 0;
}
.input-box textarea::placeholder {
  color: var(--text-muted);
}
.input-right-controls {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: 2px;
}
.input-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.input-btn:hover {
  background: var(--gray-sidebar);
}
.input-btn svg {
  fill: var(--text-mid);
  width: 20px;
  height: 20px;
}
.model-dropdown {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: .3rem .75rem;
  background: var(--gray-sidebar);
  border-radius: 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.model-dropdown:hover {
  background: var(--gray-hover);
}
.model-dropdown svg {
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
}
.send-btn {
  width: 36px;
  height: 36px;
  background: var(--green);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.send-btn:hover {
  background: var(--green-hover);
  transform: scale(1.05);
}
.send-btn:disabled {
  background: var(--gray-border);
  cursor: not-allowed;
  transform: none;
}
.send-btn svg {
  fill: #fff;
  width: 16px;
  height: 16px;
}
.input-hint {
  max-width: 768px;
  margin: .5rem auto 0;
  font-size: .72rem;
  color: var(--text-muted);
  text-align: center;
}

/* Typing Dots */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--green-hover);
  border-radius: 50%;
  animation: tdot .6s infinite alternate;
}
.typing-dots span:nth-child(2){animation-delay:.2s}
.typing-dots span:nth-child(3){animation-delay:.4s}

/* Welcome Active State Management */
#chat-app.welcome-active .bottom-input-zone {
  display: none;
}
#chat-app:not(.welcome-active) .welcome-container {
  display: none;
}

@keyframes tdot{to{transform:translateY(-5px);opacity:.3}}
@keyframes pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(1.3)}}
/* On desktop, when sidebar is expanded, collapsed-menu-btn should hide */
@media(min-width:901px){
  .sidebar:not(.collapsed) + .main-chat .collapsed-menu-btn {
    display: none;
  }
  .sidebar.collapsed + .main-chat .collapsed-menu-btn {
    display: flex;
  }
}
@media(max-width:900px){
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    z-index: 50;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.collapsed {
    left: -260px;
  }
  .sidebar.mobile-open {
    left: 0;
    width: 260px;
  }
  /* On mobile, always show hamburger */
  .collapsed-menu-btn {
    display: flex!important;
  }
  .features {
    padding: 1.5rem 1rem 4rem;
  }
  .nav-menu-toggle {
    display: block;
  }
  nav {
    width: 95%;
    padding: 0.6rem 1.4rem;
    top: 1rem;
  }
  nav .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 11, 22, 0.96);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 1.5rem;
    gap: 1.2rem;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    align-items: center;
    z-index: 999;
  }
  nav .nav-links.active {
    display: flex;
  }
}