.nav-xp {
  background: linear-gradient(135deg, #5b5ef4, #7209b7);
  color: white; font-weight: 800; font-size: 0.8rem;
  padding: 0.3rem 0.8rem; border-radius: 50px;
}

.tutor-layout {
  display: grid; grid-template-columns: 280px 1fr;
  height: calc(100vh - 60px);
}

.tutor-sidebar {
  background: #f8f9ff; border-right: 2px solid #eeeeff;
  padding: 1.5rem; overflow-y: auto;
}
.ts-header h3 { font-size: 1.2rem; font-weight: 900; margin-bottom: 0.3rem; }
.ts-header p { font-size: 0.82rem; color: #64748b; }
.ts-section { margin-top: 1.5rem; }
.ts-label {
  font-size: 0.72rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; color: #64748b; margin-bottom: 0.6rem;
}
.ts-topics { display: flex; flex-direction: column; gap: 0.4rem; }
.ts-topic-btn {
  padding: 0.55rem 0.85rem; border-radius: 10px;
  background: white; border: 1.5px solid #e8eaff;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  text-align: left; font-family: 'Nunito', sans-serif;
  transition: all 0.15s;
}
.ts-topic-btn:hover { border-color: #5b5ef4; background: #f0f2ff; }
.ts-select {
  width: 100%; padding: 0.6rem 0.8rem; border-radius: 10px;
  border: 2px solid #e8eaff; font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.85rem; background: white;
  cursor: pointer; outline: none;
}
.ts-select:focus { border-color: #5b5ef4; }
.ts-weak { display: flex; flex-direction: column; gap: 0.35rem; }
.ts-weak-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0.7rem; border-radius: 8px;
  background: #fef7f0; font-size: 0.8rem; font-weight: 700;
}
.ts-weak-pct { color: #c2410c; font-weight: 900; }

.tutor-main {
  display: flex; flex-direction: column; background: white;
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}

.chat-bubble {
  display: flex; gap: 0.75rem; max-width: 85%;
  animation: fadeSlideIn 0.3s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.ai { align-self: flex-start; }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.cb-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
  background: #f0f2ff;
}
.chat-bubble.user .cb-icon { background: #ede9fe; }
.cb-content {
  background: #f8f9ff; border-radius: 16px;
  padding: 1rem 1.2rem; line-height: 1.7;
  border: 1.5px solid #eeeeff; font-size: 0.92rem;
}
.chat-bubble.user .cb-content {
  background: linear-gradient(135deg, #5b5ef4, #7209b7);
  color: white; border-color: transparent;
}
.cb-content p { margin-bottom: 0.5rem; }
.cb-content p:last-child { margin-bottom: 0; }
.cb-content table {
  width: 100%; border-collapse: collapse; margin: 0.5rem 0;
  font-size: 0.85rem;
}
.cb-content th {
  background: #5b5ef4; color: white; padding: 0.4rem 0.6rem;
  text-align: left; font-weight: 800;
}
.cb-content td {
  padding: 0.35rem 0.6rem; border-bottom: 1px solid #eeeeff;
}
.cb-content pre {
  background: #1a1a2e; color: #e8e8f5; padding: 0.8rem;
  border-radius: 10px; overflow-x: auto; font-size: 0.85rem;
}
.cb-loading {
  display: flex; gap: 0.3rem; padding: 0.5rem 0;
}
.cb-loading span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #5b5ef4; animation: bounce 1.4s ease-in-out infinite;
}
.cb-loading span:nth-child(2) { animation-delay: 0.2s; }
.cb-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,80%,100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-input-area {
  border-top: 2px solid #f0f2ff; padding: 1rem 1.5rem;
  background: #fafbff;
}
.chat-input-wrap {
  display: flex; gap: 0.6rem;
}
#chatInput {
  flex: 1; padding: 0.85rem 1.1rem; border-radius: 14px;
  border: 2px solid #e8eaff; font-family: 'Nunito', sans-serif;
  font-size: 0.95rem; font-weight: 600; outline: none;
  transition: border-color 0.2s;
}
#chatInput:focus { border-color: #5b5ef4; }
.chat-send-btn {
  padding: 0.85rem 1.5rem; border-radius: 14px;
  background: linear-gradient(135deg, #5b5ef4, #7209b7);
  color: white; font-weight: 800; font-size: 0.95rem;
  border: none; cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: all 0.2s; white-space: nowrap;
}
.chat-send-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(91,94,244,0.35); }
.chat-send-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.chat-hints {
  display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap;
}
.chat-hint {
  padding: 0.4rem 0.8rem; border-radius: 50px;
  background: white; border: 1.5px solid #e8eaff;
  font-weight: 700; font-size: 0.78rem; cursor: pointer;
  font-family: 'Nunito', sans-serif; transition: all 0.15s;
  color: #64748b;
}
.chat-hint:hover { border-color: #5b5ef4; color: #5b5ef4; }

@media (max-width: 768px) {
  .tutor-layout { grid-template-columns: 1fr; }
  .tutor-sidebar { display: none; }
}
