:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --sidebar: #111827;
  --sidebar-hover: #1d293d;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --success-soft: #dcfce7;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.1);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --sidebar-w: 280px;
  --sidebar-collapsed: 88px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #eef4ff 0%, var(--bg) 45%, #f2f5fb 100%);
}

.app-shell {
  height: 100dvh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(185deg, #111827 0%, #172033 100%);
  color: #f8fafc;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  justify-content: flex-start;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  flex: 0 1 auto;
  min-height: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.2);
}

.logo-copy {
  display: grid;
}

.logo-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: #bfdbfe;
}

.sidebar-nav {
  display: grid;
  gap: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #dbeafe;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.24);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.4);
}

.nav-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.nav-label {
  font-size: 0.93rem;
  font-weight: 500;
  white-space: nowrap;
}

.help-card {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 219, 254, 0.2);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.18),
    inset 0 0 0 1px rgba(219, 234, 254, 0.08);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

.help-card img {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
  margin-inline: auto;
  flex-shrink: 0;
}

.help-card:hover {
  transform: translateY(-2px);
  border-color: rgba(191, 219, 254, 0.36);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(147, 197, 253, 0.26);
}

.help-copy h2 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
}

.help-copy p {
  margin: 6px 0 0;
  font-size: 0.83rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.profile-card {
  margin-top: auto;
  border: 1px solid rgba(191, 219, 254, 0.22);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.profile-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(191, 219, 254, 0.4);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(135deg, #c7d2fe, #bfdbfe);
}

.profile-meta {
  display: grid;
  gap: 2px;
}

.profile-name {
  font-size: 0.92rem;
  font-weight: 600;
}

.profile-role {
  font-size: 0.78rem;
  color: #bfdbfe;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6) clamp(14px, 3vw, 36px) var(--space-4);
  overflow: hidden;
}

.greeting {
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 2.4vw, 32px);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.greeting h1 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.28rem, 2.1vw, 2rem);
  line-height: 1.25;
}

.subheading {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 70ch;
}

.feature-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.highlight-chip {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0b4bb3;
  background: linear-gradient(120deg, #e0e7ff, #dbeafe);
}

.chat-container {
  flex: 1;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding-right: 4px;
}

.chat-message {
  max-width: min(760px, 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
}

.bot-message {
  justify-self: start;
  background: var(--surface);
}

.user-message {
  justify-self: end;
  background: var(--surface-2);
  max-width: min(620px, 92%);
}

.message-label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.concept-title {
  margin: 8px 0 0;
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
}

.message-body {
  margin-top: var(--space-3);
  color: #1e293b;
  line-height: 1.68;
}

.message-body p {
  margin: 0;
}

.step-list {
  margin: var(--space-3) 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.suggestion-chips {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.chip:hover {
  background: #eaf2ff;
  border-color: #93c5fd;
  color: #0f172a;
}

.input-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.icon-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.icon-btn img {
  width: 20px;
  height: 20px;
}

.text-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.97rem;
  color: var(--text);
}

.text-input::placeholder {
  color: #94a3b8;
}

.send-btn {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 11px 18px;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease;
}

.send-btn:hover {
  filter: brightness(1.05);
}

.send-btn:active {
  transform: translateY(1px);
}

@media (max-width: 1100px) {
  .sidebar {
    width: var(--sidebar-collapsed);
    padding: var(--space-4) 12px;
    align-items: center;
  }

  .logo-copy,
  .nav-label,
  .help-copy {
    display: none;
  }

  .sidebar-top,
  .sidebar-nav {
    width: 100%;
  }

  .logo {
    justify-content: center;
  }

  .nav-item {
    justify-content: center;
    padding: 11px 10px;
  }

  .help-card {
    padding: 10px;
    width: 100%;
    gap: 0;
    border-radius: var(--radius-md);
  }

  .help-card img {
    width: 100%;
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
  }

  .profile-card {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  .profile-meta {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-collapsed) 1fr;
  }

  .main {
    padding: var(--space-4);
    gap: var(--space-4);
  }

  .chat-message {
    padding: var(--space-4);
  }

  .input-bar {
    gap: var(--space-2);
    padding: 10px;
  }

  .send-btn {
    padding: 10px 14px;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 10px;
  }

  .greeting {
    padding: var(--space-4);
  }

  .subheading {
    max-width: none;
  }

  .user-message,
  .bot-message {
    max-width: 100%;
  }

  .send-btn {
    min-width: 64px;
  }
}
