/* ---- RESET Y BASE ---- */
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
}

 header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 40px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  margin: 0;    
  background: linear-gradient(to top, #444444, #000000);
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
} 

.footer {
  height: 60px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0;
  margin: 0;    
  background: linear-gradient(to top, #444444, #000000);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.5);
}

.footer-center,
.header-center {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.1rem;
  margin: 1rem;  
  color: white;
  text-align: left;
}

.header-center {
  font-weight: 600;
  font-size: 1.1rem;
}

.footer-center {
  font-weight: 400;
  font-size: 0.9rem;
}

.header-center em {
  font-weight: 500;
  font-size: 1rem;
  text-align: center;
}

.layout_overflow {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  align-items: center;
}

.ai-avatar-block {
  display: flex;
  margin-bottom: 2rem;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem;
}

.avatar-image {
  opacity: 1;
  margin-bottom: 0;
  /*animation: fadeInLoad 0.6s ease-in;*/
}

.avatar-image img {  
  height: 250px;
  max-height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);  
  animation: breathing-glow 6s ease-in-out infinite;
}

@keyframes fadeInLoad {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathing-glow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  }
  20% {
    box-shadow: 0 8px 36px rgba(37, 99, 235, 0.8);
  }
  40% {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  }
  100% {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  }
}

.ai-response {
  display: none;
}

.ai-response.visible {
  display: flex;
  flex-direction: column;
  white-space:pre-wrap; 
  height: auto;
  width: 720px;
  font-size: 1rem;
  line-height: 1.65;
  padding: 1rem;
  gap: 1rem;
  margin-bottom: 0;
  color: #333;
}

/* Fila de mensaje: siempre ancho completo */
.msg {
  display: flex;
  width: 100%;
  margin: 0.25rem 0;
}

.msg.assistant { justify-content: flex-start; }
.msg.user      { justify-content: flex-end; }

/* Burbuja: se adapta al texto (máx. 90% del ancho) */
.bubble {
  position: relative;
  display: inline-block;
  max-width: 90%;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  white-space: pre-wrap; /* respeta espacios y saltos */
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Colores/forma por rol */
.bubble.assistant {
  background: #ffffff;
  color: #222;
  border-top-left-radius: 6px;
}

.bubble.user {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  color: white;
  border-top-right-radius: 6px;
}

/* (Opcional) “cola” del bocadillo */
.bubble.assistant::after,
.bubble.user::after {
  content: "";
  position: absolute;
  bottom: 0.2rem;
  width: 0; height: 0;
  border: 8px solid transparent;
}

.bubble.assistant::after {
  left: -6px;
  border-right-color: #ffffff;
  border-left-width: 0;
}

.bubble.user::after {
  right: -6px;
  border-left-color: #93c5fd;
  border-right-width: 0;
}

.ai-input-bar {
  display: flex;
  align-items:flex-end;
  gap: 0.5rem;
  width: 100%;
  max-width: 620px;
}

.ai-input-bar textarea {
  border: none;
  flex: 1;
  max-height: 12rem;
  font-family: 'Poppins', system-ui, sans-serif;
  padding: 0.6rem 1rem;
  background-color: #ffffff;
  font-size: 1rem;
  color: #333;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  border-radius: 12px;
  resize: none;          /* que no aparezca el grip de redimensionar */
  /* touch-action: none; */
}

.ai-input-bar textarea:focus {
  outline: none;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

.ai-input-bar textarea:hover {
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

.ai-input-bar button {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  border: none;
  color: white;
  font-size: 1.2rem;
  border-radius: 999px;
  padding: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  height:40px; width:40px;
}

.ai-input-bar button:hover {
  background-color: #3e5ecb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

.spacer {
  display: block;
  height: 10px;
}

/* ---- AUDIO BAR ---- */
.audio-clara-bar{
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  margin: 0rem;
}  
.audio-clara-bar .audio-clara-avatar{
    border:0; background: transparent; padding:0; margin:0; overflow: hidden;
    width: 66x; height: 66px; border-radius: 999px;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}
.audio-clara-bar .audio-clara-avatar img{ width:100%; height:100%; object-fit: cover;}

/* ---- CATEGORÍAS ---- */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  margin: 0rem;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
}

.tab {
  padding: 0.6rem;
  font-size: 1rem;
  color: white;
  background: linear-gradient(to top, #444444, #000000);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.tab:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  transform: translateY(-3px);
}

.tab.active, .tab.active:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  color: white;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  transform: none;
}

@keyframes breathing-glow-small {
  0%, 100% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  }
  20% {
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.8);
  }
  70% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  }
  100% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  }
}

.categories.abogados {
  animation: fadeInLoad 0.6s ease-in 5s;
  animation-fill-mode: forwards;
  opacity: 0; 
  margin-bottom: 2rem;
}

.tab.abogados {
	padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
	animation: breathing-glow-small 3s ease-in-out infinite;
}

.avatar-image.abogados {
  margin-bottom: 0;
  /*animation: fadeInLoad 0.6s ease-in;*/
}

.descripcion.abogados {
  font-size: 0.8rem;
  line-height: 1.35;
  color: #444;
  margin: 0 0 0.2rem 0;
}

.ai-avatar-block.abogados {
  margin-bottom: 0;
}

.course-image.abogados {
  max-height: 380px;
}

/* ---- GRID DE CURSOS ---- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.6vw, 28px);
  max-width: 90%;
  padding: 2rem;
  align-items: stretch; /* fuerza que las celdas grid ocupen toda la altura */
/*  animation: fadeInLoad 0.6s ease-in;*/  
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;  
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.5);
}
.card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
}
.card-content {
  padding: 0.3rem 1rem 0.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.card-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: #222;
}
.card-content .descripcion {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: #333;
}
.card-content .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  align-items: left;
  justify-content: left;
  margin-bottom: 1rem;
}
.card-tags .card-tag, 
.card-tags .card-tag:hover {
  border-radius: 999px;
  padding: 0.1rem 0.7rem 0.25rem;
  font-size: 0.8rem;
  background: linear-gradient(to top, #444444, #000000);
  color: white;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.5);
  text-align: center;
}

.link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.link-decorated {
  display: block;
  color: inherit;
  text-decoration: underline;
}
/* ====== CURSO: Diseño 3 columnas ====== */

.layout {
  display: flex;
  overflow: hidden;
  height: calc(100vh - 40px);
}

/* Estética más limpia y centrada del panel de contenido */
.content-panel {
  flex: 1;
  padding: 0rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;  
}

.content-panel-inner {
  max-width: 750px;
  width: 100%;  
  /* animation: fadeInLoad 0.6s ease-in; */
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0rem;
  align-items: left;
  margin: 1rem;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.breadcrumb-tag {
  padding: 0.3rem 1rem 0.3rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: white;
  background: linear-gradient(to top, #444444, #000000);  
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  text-align: center;
  clip-path: polygon(
    0 0,            /* esquina superior izquierda */
    90% 0,          /* justo antes de la punta */
    100% 50%,       /* punta */
    90% 100%,       /* justo después de la punta */
    0 100%          /* esquina inferior izquierda */
  );
}

.breadcrumb-tag:hover {
  transform: translateY(-3px);
  background: linear-gradient(to top, #3B82F6, #2563EB);
}

.breadcrumb-tag.active, .breadcrumb-tag.active:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);  
  border-radius: 999px;
  cursor: default;
  clip-path: none;
  transform: none;
}

.course-title {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
  font-weight: bold;
  text-align: center;
  color: #222;
  font-family: 'Poppins', sans-serif;
}

.course-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: top;
  border-radius: 0.75rem;
  margin: 0.5rem;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
}

.course-unit-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #222;
  font-family: 'Poppins', sans-serif;
}

.course-section-title {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  color: #222;
  font-family: 'Poppins', sans-serif;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
  transition: all 0.2s ease;
}

.tag {
  border-radius: 999px;
  padding: 0.35rem 0.9rem 0.5rem 0.9rem;
  font-size: 0.8rem;
  background: linear-gradient(to top, #444444, #000000);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  text-align: center;
}

.tag.active, .tag.active:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  transform: none;
  cursor: default;
}

.tag:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
  cursor: pointer;
}
.tag.subunit, .tag.subunit:hover {
  background: linear-gradient(to top, #666666, #444444);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  transform: none;
  cursor: default;
}

  .content-panel .tags .tag-menu{               /* “hamburguesa” (índice) */
    display: none;
  }

.presets {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  align-items: center;
  justify-content: center;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
}

.preset {
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: #333;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.5);
  transition: all 0.2s ease;
}

.preset.premium {
  box-shadow: 0 2px 6px rgb(255, 0, 0, 0.5);
}

.preset:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.preset.premium:hover {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgb(255, 0, 0);
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.unit-subtitle {
  font-size: 1rem;
  text-align: center;
  color: #444;
  margin-bottom: 2rem;
}

/* === Paneles laterales modernos integrados === */
/* PANEL IZQUIERDO: Estilo moderno tipo navegación lateral */
.sidebar {
  width: 20%;
  min-width: 240px;
  max-width: 420px;
  padding: 0.8rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  /* animation: fadeInLoad 0.6s ease-in; */
}

.accordion {
  list-style: none;
  padding: 0;
  margin: 0.8rem;
  margin-bottom: 100px;  
}

.accordion li {
  margin-bottom: 1.2rem;  
  position: relative;
}

.accordion .unit-title {
  display: flex;
  align-items: left;
  justify-content: left;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: linear-gradient(to top, #444444, #000000);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  cursor: pointer;
  transition: background 0.2s ease;  
}

.accordion .unit-title.expanded {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  padding: 0.9rem;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.5);
}

.accordion .unit-title:hover { 
  background: linear-gradient(to top, #3B82F6, #2563EB);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.5);
}

.accordion .subtopics {
  margin-top: 0.4rem;
  margin-left: 1.2rem;
  padding-left: 0.5rem;
  border-left: 2px solid #ccc;
}

.accordion .subtopics a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  color: #222;
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.accordion .subtopics a:hover {
  color: #0077aa;
}

/* PANEL DERECHO */
.sidebar-right {
  width: 20%;
  min-width: 256px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.sidebar-right .avatar {
  margin-bottom: 1rem;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
}

.sidebar-right .avatar img {
  height: 200px;
  max-height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);  
  animation: breathing-glow 6s ease-in-out infinite;  
}

.sidebar-right .assistant-box {
  display: none;
}

.sidebar-right .assistant-box.visible {
  display: flex;
  flex-direction: column;
  white-space:pre-wrap;
  height: auto;
  width: auto;
  max-width: 100%;
  padding: 1rem;
  gap: 1rem;
  font-size: 0.9rem;
  color: #222;
  margin-bottom: 1rem;
  border: none;
}

.sidebar-right .assistant-input {
  display: flex;
  align-items:flex-end;
  width: 100%;
  margin-top: auto;
  gap: 0.5rem;
  /* animation: fadeInLoad 0.6s ease-in;
  opacity: 1; */
}

.assistant-input textarea {
  border: none;
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  border-radius: 12px;
  resize: none;
  max-height: 12rem;
  font-family: 'Poppins', system-ui, sans-serif;
}

.assistant-input textarea:focus {
  outline: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
}

.assistant-input button {
  background: linear-gradient(to top, #3B82F6, #2563EB);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  height:40px; width:40px;
}

.assistant-input button:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5);
}


/* === AULA54: Markdown -> HTML enhancer (non-breaking append) === */
/* Generic paragraph used across course pages */
.descripcion {
  font-size: 1rem;
  line-height: 1.65;
  color: #333;
  margin: 0 0 0.8rem 0;
}

/* Lists rendered by the MarkdownHtmlTransformer */
ul.descripcion, ol.descripcion {
  margin: 0.4rem 0 1rem 0;
  padding-left: 1.25rem;
  color: #333;
}
ul.descripcion li, ol.descripcion li {
  margin: 0 0 0.4rem 0;
}

/* Table styling for Markdown-style tables */
table.descripcion {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0 1.4rem 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
table.descripcion th, table.descripcion td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border: 1px solid #e5e7eb;
  font-size: 0.95rem;
  color: #222;
}
table.descripcion thead th {
  background: #f6f7fb;
  font-weight: 600;
}

/* Inline elements */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  background: #f3f4f6;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* Keep spacer class already in project; ensure spacing after blocks parsed from MD */
.spacer { display: block; min-height: 10px; }


/* ========= AULA54 — Estilos encapsulados para el contenido central ========= */
/* Todo lo de abajo está scopeado a .content-panel para no afectar a otros bloques */

.content-panel .content-shell {
  position: relative;
  margin: 0 0 2rem 0;
  padding: 1.25rem 1.25rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255), rgba(255,255,255)) padding-box,
    linear-gradient(135deg, rgba(255,255,255), rgba(147,197,253)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 10px 30px rgba(37, 99, 235, 0.20),
    0 1px 0 rgba(255,255,255,0.6) inset;
}

/* Ajustes tipográficos de lectura solo dentro del contenido central */
.content-panel .prose-a54 {
  color: #0f172a;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.prose-a54 h1,
.prose-a54 h2,
.prose-a54 h3 {
  font-family: 'Poppins', system-ui, sans-serif;
  color: #0f172a;
  margin: 1.25rem 0 0.75rem 0;
}

.prose-a54 h1 { font-size: 1.5rem; text-align: center; }
.prose-a54 h2 { font-size: 1.35rem; text-align: center; }
.prose-a54 h3 { font-size: 1.15rem; }
.prose-a54 strong.course-title-label { 
  display: block; 
  font-size: 1.15rem; 
  text-align: center;
  font-family: 'Poppins', system-ui, sans-serif;  
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.prose-a54 h1::after,
.prose-a54 h2::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.75), rgba(37, 99, 235, 0));
  box-shadow: 0 0 24px rgba(37,99,235,0.5);
  opacity: 1;
}

.prose-a54 p { margin: 0 0 1rem 0; }
/*
.prose-a54 ul,
.prose-a54 ol {
  margin: 0 0 1rem 0;
  padding-left: 1.2rem;
}

.prose-a54 li + li { margin-top: 0.35rem; }
*/
.prose-a54 strong.description { font-weight: 600;}

/* Citas */
.prose-a54 blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid rgba(37,99,235,0.6);
  background: rgba(241, 245, 255);
  border-radius: 0 12px 12px 0;
}

/* Tablas futuristas Aula54 */
.prose-a54 table.descripcion.a54-table {
  position: relative;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
  border-radius: 12px;
  background:
    linear-gradient(0deg, rgba(255,255,255,0.85), rgba(255,255,255,0.85)) padding-box,
    linear-gradient(135deg, rgba(37,99,235,0.45), rgba(147,197,253,0.25)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 14px 34px rgba(37,99,235,0.20);
}

.prose-a54 table.descripcion.a54-table th,
.prose-a54 table.descripcion.a54-table td {
  border: none;
  border-bottom: 1px solid rgba(148,163,184,0.25);
  padding: 0.75rem 0.8rem;
}

.prose-a54 table.descripcion.a54-table thead th {
  background: linear-gradient(180deg, #eef5ff, #eaf2ff);
  color: #0f172a;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,255,255,0.75);
}

.prose-a54 table.descripcion.a54-table tbody tr:last-child td {
  border-bottom: 0;
}

.prose-a54 table.descripcion.a54-table tbody tr:nth-child(even) td {
  background: rgba(243, 246, 255, 0.6);
}

.prose-a54 table.descripcion.a54-table tbody tr:hover td {
  background: rgba(219, 234, 254, 0.65);
  transition: background 160ms ease;
}

/* Opción: cabecera sticky para tablas largas */
.prose-a54 table.descripcion.a54-table.sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Código — inline y bloque */
.prose-a54 :not(pre) > code {
  background: #f3f6ff;
  border: 1px solid rgba(147,197,253,0.6);
  color: #0b1220;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
}

.prose-a54 pre.code-block {
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 235, 0.25),
    0 10px 26px rgba(2, 8, 23, 0.5);
}

.prose-a54 pre.code-block code {
  background: transparent;
  border: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  display: block;
}

/* Callouts */
.prose-a54 .callout {
  position: relative;
  margin: 0.5rem 0 2rem 0;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-style: italic;
  white-space:pre-wrap;
  line-height: 1.55;
  border-radius: 12px;
  background:
    linear-gradient(0deg, rgba(255,255,255), rgba(255,255,255)) padding-box,
    linear-gradient(135deg, rgba(37, 99, 235), rgba(147,197,253)) border-box;
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.prose-a54 .callout::before {  content: "👩‍🏫 > "; }

.prose-a54 .callout.tip { 
  margin: 1rem 0;
  font-size: 1rem;
  font-style: normal;
  white-space:pre-wrap;
  line-height: 1.65;
  background:
    linear-gradient(0deg, rgba(240,253,244,0.9), rgba(240,253,244,0.9)) padding-box,
    linear-gradient(135deg, rgba(34,197,94,0.45), rgba(37, 99, 235, 0.25)) border-box;
  border: none;
}
.prose-a54 .callout.tip::before { content: "📝"; }

.prose-a54 .callout.warn {
  background:
    linear-gradient(0deg, rgba(255,251,235,0.92), rgba(255,251,235,0.92)) padding-box,
    linear-gradient(135deg, rgba(245,158,11,0.55), rgba(37, 99, 235, 0.25)) border-box;
  border: 1px solid transparent;
}
.prose-a54 .callout.warn::before { content: "⚠️"; }

.prose-a54 .callout.danger {
  background:
    linear-gradient(0deg, rgba(254,242,242,0.92), rgba(254,242,242,0.92)) padding-box,
    linear-gradient(135deg, rgba(239,68,68,0.55), rgba(37, 99, 235, 0.25)) border-box;
  border: 1px solid transparent;
}
.prose-a54 .callout.danger::before { content: "⛔"; }

/* Teclas y marcas */
.prose-a54 kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  border-bottom-width: 3px;
  background: #f8fafc;
}

.prose-a54 mark {
  background: linear-gradient(90deg, #fff7cc, #fff1a6);
  border-radius: 4px;
  padding: 0.05rem 0.2rem;
}

/* Separador decorativo */
.prose-a54 .divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0), rgba(37,99,235,0.6), rgba(37,99,235,0));
  box-shadow: 0 0 14px rgba(37,99,235,0.45);
  margin: 1.25rem 0;
}

/* ===== AULA54 — Listas estilizadas dentro del contenido ===== */
.prose-a54 ul,
.prose-a54 ol{
  margin: 0 0 1.1rem 0;
  padding-left: 0;                 /* quitamos padding del marker nativo */
}

/* --- UL por defecto: bullet neón + línea guía sutil --- */
.prose-a54 ul li{
  list-style: none;
  position: relative;
  padding-left: 1.35rem;           /* espacio para el bullet custom */
  margin: 0.22rem 0;
}
.prose-a54 ul li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0.64em;
  width: 9px; height: 9px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, #2563EB 35%, #000000 70%);
  box-shadow:
    0 4px 8px rgba(37, 99, 235, 0.5);
  transform: translateY(-50%);
}
.prose-a54 ul li + li{ margin-top: .35rem; }

/* Variante con “línea conectora” para listas narrativas (añadir clase .a54-flow al <ul>) */
.prose-a54 ul.a54-flow li{ padding-left: 1.5rem; }
.prose-a54 ul.a54-flow li::after{
  content:"";
  position:absolute;
  left: 4px;                        /* centra con el bullet */
  top: calc(0.64em + 6px);
  bottom: -0.35rem;
  width: 1px;
  background: linear-gradient(to bottom, rgba(37,99,235,.35), rgba(37,99,235,0));
}
.prose-a54 ul.a54-flow li:last-child::after{ display:none; }

/* Subniveles: bullets más pequeños y color desaturado */
.prose-a54 ul ul li{ padding-left: 1.1rem; }
.prose-a54 ul ul li::before{
  width: 7px; height: 7px;
  background: radial-gradient(circle, #eef3ff 0%, #93c5fd 70%);
  box-shadow: 0 0 0 1px rgba(37,99,235,.14);
}

/* --- OL por defecto: badge numerado tipo “chip” con gradiente --- */
.prose-a54 ol{
  counter-reset: a54-counter;
}
.prose-a54 ol li{
  list-style: none;
  counter-increment: a54-counter;
  position: relative;
  padding-left: 2.1rem;
  margin: 0.28rem 0;
}
.prose-a54 ol li::before{
  content: counter(a54-counter);
  position: absolute;
  left: 0; top: 0.2rem;
  width: 1.4rem; height: 1.4rem;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 0.8rem/1 "Poppins", system-ui, sans-serif;
  color: #fff;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0%, #2563EB 20%, #000000 70%);
  box-shadow:
    0 4px 8px rgba(37, 99, 235, 0.5);
}

/* Subniveles de OL: chips más pequeños y grisados */
.prose-a54 ol ol li{ padding-left: 1.8rem; }
.prose-a54 ol ol li::before{
  width: 1.2rem; height: 1.2rem; border-radius: 10px;
  font-size: 0.7rem;
  background: linear-gradient(180deg, #64748B, #475569);
  box-shadow: 0 6px 16px rgba(2,8,23,.25);
}

/* --- Variante “steps” para bloques tipo Guided steps (añadir .a54-steps al <ol>) --- */
.prose-a54 ol.a54-steps{
  background:
    linear-gradient(0deg, rgba(255,255,255,.85), rgba(255,255,255,.85)) padding-box,
    linear-gradient(135deg, rgba(37,99,235,.35), rgba(147,197,253,.2)) border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: .8rem .9rem;
  box-shadow: 0 6px 18px rgba(37,99,235,.18);
}
.prose-a54 ol.a54-steps li{
  padding: .55rem .25rem .55rem 2.25rem;
  margin: .15rem 0;
  border-radius: 10px;
  transition: background .15s ease;
}
.prose-a54 ol.a54-steps li:hover{
  background: rgba(219,234,254,.55);
}

/* --- Variante “checklist” (añadir .a54-check al <ul>) --- */
.prose-a54 ul.a54-check li{ padding-left: 2rem; }
.prose-a54 ul.a54-check li::before{
  content: "✓";
  width: 1.35rem; height: 1.35rem;
  left: 0; top: 0.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 .95rem/1 "Poppins", system-ui, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, #22C55E, #16A34A);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.45) inset,
    0 4px 12px rgba(22,163,74,.35);
}

.btn-tts { border:1px solid #e5e7eb; background:#fff; border-radius:10px; padding:.5rem .75rem; cursor:pointer; 
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5); margin-left:45%; margin-bottom:1rem;}
.btn-tts.is-speaking { border-color:#22c55e; background:#ecfdf5; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5); }
.btn-tts.is-paused   { border-color:#f59e0b; background:#fffbeb }

.sr-only {
  display: none;
}

/* Responsive: atenuar halos/blur en móviles */
@media (max-width: 640px) {
  .content-panel .content-shell {
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
  }
  .prose-a54 ol li{ padding-left: 1.8rem; }
  .prose-a54 ol li::before{ width: 1.4rem; height: 1.4rem; border-radius: 10px; }
  .prose-a54 ul.a54-flow li::after{ left: 3px; }
}

/* ===== Mobile-first UX additions (do NOT affect desktop) ===== */
.clara-bar { display: none; }
.toc-close { display: none; } 
.tag.mobile { display:none; }
.link.mobile { display:none; }

:root{ --gutter-mobile: 8px; }

@media (max-width: 768px){	
	
  /* Que el body en móvil sea un flujo normal, no flex container de altura fija */
  body {
    display: block;
  }
  
  .footer {
    height: 120px;
  }

  .layout {
    height: auto;
    overflow-y: visible;
  }

  .content-panel {
    overflow-y: visible;
  }

.header-center {
  margin: 0.1rem 0.5rem 0.1rem 0.5rem;
  gap: 0;
  font-weight: 500;
  font-size: 0.9rem;
}

.header-center em {
  font-weight: 400;
  font-size: 0.8rem;
}
  
.prose-a54 h1,
.prose-a54 h2,
.prose-a54 h3 {
  margin: 1rem 0 0.75rem 0;
}

.prose-a54 h1 { font-size: 1.4rem; }
  
  .ai-avatar-block {
    margin-bottom: 1rem;
 }
  
  .avatar-image img {  
    height: 240px;
  }
  
  .ai-response.visible{
    width: calc(100% - (var(--gutter-mobile) * 2));
  }
  
  .breadcrumb{ 
    margin: 0.5rem 0 1rem; 
    gap: 0.6rem 0.1rem;
  }
  .breadcrumb-tag{ 
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 400;
  }
  
  .categories {
    gap: 0.6rem 0.4rem;
    padding: var(--gutter-mobile);
  }
  
  .tab {
	padding: 0.5rem;
	font-size: 0.8rem;
	font-weight: 500;
  }
  
  .tab:hover {
    transform: none;
  }

  .course-image{
    /*display:block;*/
    margin: 8px var(--gutter-mobile) 12px;
    width: calc(100% - (var(--gutter-mobile) * 2));
    border-radius: 12px;
  }
  
  .course-title{ margin-inline: 12px; }
  
  .course-grid{ 
    grid-template-columns: 1fr; 
    max-width: 100%;
    padding: 2rem var(--gutter-mobile);
  }
  
  .clara-bar-response{
	  display: none;
  }
  
  .clara-bar-response.visible{
	  display: flex;
	  flex-direction: column;
	  position: fixed; left: 0; right: auto; bottom: 65px;
	  white-space:pre-wrap;
	  overflow: auto;
	  max-height:10px;
	  height:10px;
	  width: 77%;
	  padding: 1rem;
	  gap: 1rem;
	  font-size: 0.9rem;
	  color: #222;
	  border-radius: 12px 12px 0 0;
	  border: 1px solid #000;
	  border-bottom:none;
	  background: linear-gradient(135deg, rgba(37,99,235,.5), rgba(147,197,253,.5));
	  opacity: 1;
	  z-index: 119;
	  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  }
  
  .clara-bar-response.visible:focus,
  .clara-bar-response.visible:focus-within {
      max-height:60%;
      height:60%;      
  }

  .clara-bar{
    display:flex; align-items:flex-end; gap:.3rem;
    position: fixed; left: 0; right: 0; bottom: 0;
    max-height: 65px;
    padding: .3rem;
    background: rgba(255,255,255);
    z-index: 120;
  }
  .clara-bar.idle{ opacity:1; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);}
  .clara-bar .clara-avatar{
    border:0; padding:0; margin:0; overflow: hidden;
    height:55px; width:55px; border-radius: 999px;;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
  }
  .clara-bar .clara-avatar img{ width:100%; height:100%; object-fit: cover;}
  .clara-bar textarea{
    flex:1; border:0;
    padding:.65rem; font-size:1rem; background: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
    border-radius: 12px;
    resize:none;
    max-height: 12rem;
    font-family: 'Poppins', system-ui, sans-serif;
  }
  .clara-bar textarea:focus{
    outline: none;
  }
  .clara-bar .clara-send{
    border:0; border-radius: 999px; padding:.6rem;
    background: linear-gradient(to top,#3B82F6,#2563EB); color:#fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.45);
    height:40px; width:40px;
    font-size:1.2rem; cursor:pointer;
  }
  
  /* 1) Mostrar/ocultar sidebars en móvil */
  .sidebar-right { display: none;}   /* la derecha siempre oculta en móvil */
  .sidebar { display: none;}                    /* la izquierda oculta por defecto */
  body.menu-open .sidebar{
    display: block;
    position: fixed;
    inset: 40px 0 0 auto;          
    width: min(86vw, 380px);
    background: rgba(255,255,255,.98);
    /*backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);*/
    box-shadow: 8px 0 30px rgba(0,0,0,.25);
    z-index: 130;
    overflow-y: auto;
    padding: .8rem;
    /*transform: translateX(0);*/
  }
  body.menu-open::before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 129;
  }

  /* 2) Convertir los tags del contenido en la rail vertical flotante */
  .content-panel .tags{
    position: fixed;
    right: 8px;                 /* lado derecho por defecto */
    bottom: 70px;               /* por encima de la barra de Clara */
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 0;
    margin: 0;
    background: none;
    z-index: 115;
    /*opacity: 0.8;*/
  }
  /* Si el usuario cambia la rail a la izquierda */
  body.rail-left .content-panel .tags{
    right: auto;
    left: 8px;
  }

  /* Estilo circular para cada chip */
  .content-panel .tags .tag{
    width: 44px;
    height: 44px;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(37,99,235,.45);
    background: linear-gradient(to top, rgba(37,99,235), rgba(147,197,253));
    color: #fff;
    border: 1px solid #000;
  }
  .content-panel .tags .tag.subunit{            /* apartados: gris */
    background: linear-gradient(to top, #666666, #444444);
  }
  .content-panel .tags .tag.active{             /* apartado activo: azul */
    background: linear-gradient(to top, #3B82F6, #2563EB);
  }
  .content-panel .tags .tag-menu{               /* “hamburguesa” (índice) */
    background: linear-gradient(to top, rgba(37,99,235), rgba(147,197,253));
  }
  
  /* Botón X para cerrar el menú lateral (TOC) */
  .toc-close{
    position: sticky;      /* se mantiene arriba cuando haces scroll en el sheet */
    top: 0;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(0,0,0,.65);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
    cursor: pointer;
    z-index: 1;            /* por encima del contenido del índice */
  }
    
  .breadcrumb-tag.active { display:none; }
  .tag.active { display: none; }
  .tag.no-mobile { display: none; }
  .link.no-mobile { display: none; }
  .tag.mobile { display: inline-flex; }
  .link.mobile { display: inline-flex; }



@keyframes breathing-glow-small {
  0%, 100% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  }
  20% {
    box-shadow: 0 0 24px rgba(37, 99, 235, 0.8);
  }
  70% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  }
  100% {
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  }
}

.categories.abogados {
  animation: fadeInLoad 0.6s ease-in 5s;
  animation-fill-mode: forwards;
  opacity: 0; 
  margin-bottom: 2rem;
}

.tab.abogados {
	padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
	animation: breathing-glow-small 3s ease-in-out infinite;
}

.avatar-image.abogados {
  margin-bottom: 0;
  /*animation: fadeInLoad 0.6s ease-in;*/
}

.descripcion.abogados {
  font-size: 0.8rem;
  line-height: 1.35;
  color: #444;
  margin: 0 0 0 0;
}

.ai-avatar-block.abogados {
  margin-bottom: 0;
}

.course-image.abogados {
  max-height: 140px;
}

}

@media (min-width: 769px) and (max-width: 1200px){
  .content-panel { 
    padding-bottom: 84px;
    margin: 8px calc(var(--gutter-mobile) + 8px) 12px; 
    width: 100%;
    max-width: 960px;
  }
  
  .footer {
    height: 120px;
  }
  
  
  .ai-response.visible{
    width: 700px;	
  }
  
  .breadcrumb{ padding-inline: var(--gutter-mobile); }
  .breadcrumb .breadcrumb-tag{ margin-bottom: 6px; }

  .course-image{
    /*display:block;*/
    margin: 8px calc(var(--gutter-mobile) + 8px) 12px auto; 
    width: 100%;
    max-width: 960px;
    border-radius: 12px;
    left: 0; 
    right: auto;
  }
  
  .course-title{ margin-inline: 12px; }
  
  .course-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%;}
  
  .clara-bar-response{
	  display: none;
  }
  
  .clara-bar-response.visible{
	  display: flex;
	  flex-direction: column;
	  position: fixed; left: auto; right: 0; bottom: 80px;
	  white-space:pre-wrap;
	  overflow: auto;
	  max-height:20px;
	  width: 70%;
	  padding: 1rem;
	  gap: 1rem;
	  font-size: 0.9rem;
	  color: #222;
	  border-radius: 12px 12px 0 0;
	  border: 1px solid #000;
	  border-bottom:none;
	  background: linear-gradient(135deg, rgba(37,99,235,.5), rgba(147,197,253,.5));
	  opacity: 1;
	  z-index: 119;
	  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  }
  
  .clara-bar-response:focus-within,
  .clara-bar-response.visible:focus-within {
      max-height:60%;
      height:auto;      
  }

  .clara-bar{
    display:flex; align-items:flex-end; gap:.5rem;
    position: fixed; left: 0; right: 0; bottom: 0;
    max-height: 80px;
    padding: .5rem .8rem;
    background: rgba(255,255,255,.78);
    /*backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);*/
    z-index: 120;
    /*transition: opacity .2s ease;*/
  }
  .clara-bar.idle{ opacity:1; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);}
  .clara-bar .clara-avatar{
    border:0; padding:0; margin:0; overflow: hidden;
    height:55px; width:55px; border-radius: 999px;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
  }
  .clara-bar .clara-avatar img{ width:100%; height:100%; object-fit: cover;}
  .clara-bar textarea{
    flex:1; border:0;
    padding:.65rem 1rem; font-size:1.1rem; background: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
    border-radius: 12px;
    resize:none;
    max-height: 12rem;
    font-family: 'Poppins', system-ui, sans-serif;
  }
  .clara-bar textarea:focus{
    outline: none;
  }
  .clara-bar .clara-send{
    border:0; border-radius: 999px; padding:.6rem;
    background: linear-gradient(to top,#3B82F6,#2563EB); color:#fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.45);
    height:40px; width:40px;
    font-size:1.2rem; cursor:pointer;
  }
  
  /* 1) Mostrar/ocultar sidebars en móvil */
  .sidebar-right { display: none;}   /* la derecha siempre oculta en móvil */
  
}


@media (min-width: 1920px){
  .content-panel-inner{ max-width: 850px; }  /* sube si quieres a 1320px */
  .course-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .course-image {max-height: 320px;}
}

@media (min-width: 2128px){
  .content-panel-inner{ max-width: 950px; }  /* sube si quieres a 1320px */
  .course-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 80%;}
  .course-image {max-height: 360px;}
}

