/* Estilos compartidos del sitio. Las páginas traen su diseño en línea; acá van los estados y lo común. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid #1D4ED8; outline-offset: 2px; }
summary:focus-visible { outline-offset: 4px; }
button:disabled { opacity: .55; cursor: default; }

/* Cuestionario de la lección */
.q-opt[aria-pressed="true"] { border: 2px solid #C2410C !important; background: #FBE7DC !important; font-weight: 600 !important; }

/* Observaciones de la devolución */
.note[aria-pressed="true"] { border: 2px solid #111111 !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }

/* Chat con el asistente */
.bubble { margin: 0; padding: 12px 16px; max-width: 80%; white-space: pre-line; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; border-radius: 18px 18px 4px 18px; }
.bubble.ai { align-self: flex-start; border-radius: 18px 18px 18px 4px; }
.light .bubble.me { background: #111111; color: #FFFFFF; }
.light .bubble.ai { background: #FFFFFF; color: #111111; border: 1px solid #E2E2E2; }
.dark .bubble.me { background: #FFFFFF; color: #111111; }
.dark .bubble.ai { background: #2A2A2A; color: #FFFFFF; }
.bubble.wait { opacity: .7; }
.bubble.err { font-size: 14px; }

/* Celular: menús laterales compactos y contenido primero */
@media (max-width: 760px) {
  nav[aria-label="Panel"] { gap: 12px !important; padding: 14px 16px !important; }
  nav[aria-label="Panel"] > div { flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  nav[aria-label="Panel"] > div a { white-space: nowrap; flex: none; }
  nav[aria-label="Panel"] > a:last-child { display: none !important; }
  aside[aria-label="Contenido del curso"] { order: 2; }
}

/* Encabezado del sitio: tableta (logo y botones arriba, menú deslizable abajo) */
@media (max-width: 1100px) {
  .site-header { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 12px !important; column-gap: 12px !important; padding-top: 14px !important; padding-bottom: 0 !important; }
  .site-header > a:first-child { grid-column: 1; grid-row: 1; }
  .site-header > :last-child:not(nav) { grid-column: 2; grid-row: 1; justify-self: end; }
  .site-header > nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap !important; overflow-x: auto; white-space: nowrap; gap: 0 24px !important; margin: 0 -24px; padding: 12px 24px; border-top: 1px solid #EDEDED; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .site-header > nav::-webkit-scrollbar { display: none; }
  .site-header > nav a { min-height: 32px; display: inline-flex; align-items: center; flex: none; }
}
/* Encabezado del sitio: celular */
@media (max-width: 760px) {
  .site-header { padding-left: 16px !important; padding-right: 16px !important; padding-top: 10px !important; }
  .site-header > a:first-child span:last-child { font-size: 21px !important; }
  .site-header > nav { margin: 0 -16px; padding: 10px 16px; font-size: 15px !important; gap: 0 20px !important; }
  .site-header > :last-child:not(nav) { gap: 4px !important; }
  .site-header > :last-child:not(nav) a, .site-header > a:last-child { padding: 9px 14px !important; font-size: 14px !important; min-height: 40px !important; }
}
@media (max-width: 360px) {
  .site-header > div:last-child > a:first-child { display: none !important; }
}
/* Encabezado de la lección y la devolución en celular */
@media (max-width: 760px) {
  .app-header { padding: 10px 16px !important; row-gap: 6px !important; }
  .app-header > div:first-child { gap: 2px 14px !important; min-width: 0; }
  .app-header > div:first-child > a:last-child { font-size: 14px !important; min-height: 36px !important; }
  .app-header > div:last-child { width: 100%; gap: 10px !important; flex-wrap: wrap; }
  .app-header > div:last-child > span:first-child { display: none; }
  .app-header > div:last-child > div { grid-template-columns: repeat(6, 18px) !important; }
  .app-header > div:last-child > a { margin-left: auto; }
  .app-header > span { font-size: 13px !important; }
}

/* Enlaces a Google Calendar */
.cal-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid #CFCFCF; background: #FFFFFF; color: #111111; text-decoration: none; font-size: 14px; font-weight: 500; }
.cal-link:hover { border-color: #111111; }
.cal-link b { font-weight: 700; }
