.spc-assistant-cours {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: #f9fafb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.spc-ac-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.spc-ac-header p {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.spc-ac-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .spc-ac-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */

.spc-ac-sidebar {
  background: #eef2ff;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
}

.spc-ac-sidebar h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #1d4ed8;
}

.spc-ac-sidebar ul {
  margin: 0 0 0.75rem 1rem;
  padding: 0;
  list-style: disc;
  color: #374151;
  font-size: 0.9rem;
}

.spc-ac-ideas li {
  margin-bottom: 0.25rem;
}

/* Chat area */

.spc-ac-chat-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.spc-ac-chat-window {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem;
  height: 380px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
}

/* Messages */

.spc-ac-msg {
  display: flex;
  margin-bottom: 0.75rem;
}

.spc-ac-msg-user {
  justify-content: flex-end;
}

.spc-ac-msg-assistant {
  justify-content: flex-start;
}

.spc-ac-bubble {
max-width: 650px !important; /* Taille idéale pour lire du cours */
  padding: 0.6rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.93rem;
  line-height: 1.45;
}

.spc-ac-msg-user .spc-ac-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 0.2rem;
}

.spc-ac-msg-assistant .spc-ac-bubble {
  background: #f3f4f6 !important;
  color: #111827;
  border-bottom-left-radius: 0.2rem;
}



/* Sources */

.spc-ac-sources {
  margin-top: 0.35rem;
  padding-left: 0.5rem;
  font-size: 0.8rem;
  color: #4b5563;
}

.spc-ac-sources ul {
  margin: 0.1rem 0 0 1rem;
  padding: 0;
}

.spc-ac-sources a {
  text-decoration: none;
  border-bottom: 1px dashed #3b82f6;
}

/* Input */

.spc-ac-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.spc-ac-input {
  flex: 1;
  resize: vertical;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.spc-ac-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.spc-ac-send-btn {
  border: none;
  border-radius: 999px;
  padding: 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  transition: transform 0.05s ease, box-shadow 0.1s ease, opacity 0.1s;
}

.spc-ac-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.spc-ac-send-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Quick actions */

.spc-ac-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.spc-ac-quick-actions button {
  border-radius: 999px;
  border: none;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.spc-ac-footer-hint {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Fix alignement textarea / bouton */

.spc-ac-input-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
}

.spc-ac-input {
  flex: 1 1 auto;
  min-height: 70px;
}

.spc-ac-send-btn {
  flex: 0 0 auto;
  width: auto !important;
  align-self: flex-end;
  display: inline-flex;
  justify-content: center;
  white-space: nowrap;
  padding: 0.5rem 1.4rem;
  font-size: 0.9rem;
}

/* Lisibilité du texte dans les bulles */
.spc-ac-bubble {
  line-height: 1.55 !important;
  font-size: 0.95rem !important;
  white-space: pre-line !important;   /* garde les \n */
  max-width: 85%;
}

/* Amélioration des titres générés par l’IA */
.spc-ac-bubble h1,
.spc-ac-bubble h2,
.spc-ac-bubble h3,
.spc-ac-bubble h4 {
  margin-top: 0.8rem;
  margin-bottom: 0.4rem;
}

/* Marges entre paragraphes */
.spc-ac-bubble p {
  margin: 0.5rem 0 !important;
}

/* Exemple / définition / item */
.spc-ac-bubble ul,
.spc-ac-bubble ol {
  margin-left: 1.4rem;
  margin-bottom: 0.6rem;
}

