/*
 * La barra de administración de WordPress solo la ven los administradores.
 * Su altura real la mide tema.js y la deja en --at-barra-wp: 0 si no hay
 * barra o si en el teléfono se va con el desplazamiento, 32 px de ordinario,
 * 46 px en pantalla estrecha. Antes se suponía 64 px entre 783 y 1100 px de
 * ancho, «porque ahí salta a dos filas», y no saltaba: la barra del aula
 * quedaba 32 px más abajo, con una franja por la que se veía pasar el texto
 * y tapando la cabecera del temario (auditoría del 04/10/2026).
 */
body.admin-bar.at-pantalla .at-aula-cabecera,
body.admin-bar.at-pantalla .at-top{top:var(--at-barra-wp,var(--wp-admin--admin-bar--height,32px))}
body.admin-bar.at-pantalla .at-hoja{top:var(--at-barra-wp,0px)}
@media (max-width:1023px){
  body.admin-bar.at-pantalla .at-leccion-temario{top:var(--at-barra-wp,0px);height:calc(100dvh - var(--at-barra-wp,0px))}
}

/*
 * Cabecera del aula en el teléfono: con el selector de tema, «Escritorio» y
 * «Cerrar sesión» no cabía en 371 px y empujaba la página hacia los lados.
 * Ahora baja a una segunda fila en vez de salirse.
 */
@media (max-width:640px){
  body.at-marco-propio .at-aula-cabecera{flex-wrap:wrap;row-gap:8px;column-gap:10px}
  body.at-marco-propio .at-aula-cabecera .at-tema{margin-left:0}
  body.at-marco-propio .at-aula-cabecera .at-salir{margin-left:0;min-width:40px;justify-content:center}
  body.at-marco-propio .at-aula-cabecera .at-sitio-marca{margin-right:auto}
}

/*
 * Burbujas de WhatsApp de otros plugins: dentro del aula se callan todas. En
 * la lección tapaban «Completar y seguir» en el teléfono, y el contacto ya
 * está en el menú de la lección y en el botón propio del aula. tema.js
 * apaga además las que no usan ninguno de estos nombres.
 */
body.at-pantalla :is(.joinchat,.joinchat__button,.joinchat__chatbox,.ht-ctc,.ht_ctc_chat_greetings_box,
  #ht-ctc-chat,.qlwapp,#qlwapp,.wa__btn_popup,.wa__popup_chat_box,.wa__widget_container,
  .wh-widget-send-button-wrapper,#whatsapp-widget,.ccw_plugin,.wc_whatsapp_app,.wptwa-container){display:none !important}

/* Apariencia aislada a las pantallas del aula. */
body.at-pantalla .at-tema{display:flex;align-items:center;gap:3px;margin-left:auto;padding:3px;border:1px solid var(--borde,#DCE6F4);border-radius:10px;background:var(--blanco,#fff);font:600 12px/1.2 system-ui,sans-serif;white-space:nowrap}
body.at-pantalla .at-tema-etiqueta{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body.at-pantalla .at-tema button{min-height:32px;padding:5px 9px;border:0;border-radius:7px;background:transparent;color:var(--texto-2,#4A5A78);cursor:pointer;font:inherit}
body.at-pantalla .at-tema button[aria-pressed="true"]{background:var(--azul,#2553CB);color:#fff}
body.at-pantalla .at-tema button:focus-visible{outline:3px solid #F28731;outline-offset:2px}
body.at-marco-propio .at-aula-cabecera{min-height:62px;display:flex;align-items:center;gap:16px;padding:8px clamp(16px,3vw,32px);background:#fff;border-bottom:1px solid #DCE6F4}
body.at-marco-propio .at-aula-cabecera .at-sitio-marca img{height:30px;max-width:120px;object-fit:contain}
body.at-marco-propio .at-aula-cabecera-titulo{font:600 16px/1.3 system-ui,sans-serif;color:#0B1B3A}
body.at-marco-propio .at-lienzo{max-width:1200px;min-height:calc(100dvh - 260px);padding:clamp(28px,4vw,56px) clamp(22px,4vw,56px) 70px}
body.at-marco-propio .at-sitio-pie{margin-top:0}
body.at-pantalla .at-sitio-menu-lista{display:flex;flex-wrap:wrap;gap:8px;position:static;box-shadow:none;border:0;padding:0;background:transparent;margin-bottom:20px}
body.at-pantalla .at-sitio-menu-lista ul{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0;padding:0;list-style:none}
body.at-pantalla .at-sitio-menu-lista li{margin:0;list-style:none}
body.at-pantalla .at-sitio-menu-lista a{font-size:13px;color:#C7D9F5;text-decoration:none;display:inline-block;padding:7px 10px;border-radius:7px}
body.at-pantalla .at-sitio-menu-lista a:hover,body.at-pantalla .at-sitio-menu-lista a:focus-visible{color:#fff;background:#244269}
body.at-leccion-pantalla .at-footer .at-sitio-menu-lista{background:#0B1B3A;padding:12px;border-radius:10px}
@media(max-width:640px){
 body.at-pantalla .at-tema button{padding:5px 6px;font-size:11px}
 body.at-leccion-pantalla .at-top{gap:5px;padding-inline:8px}
 body.at-leccion-pantalla .at-logo img{max-width:76px;object-fit:contain}
 body.at-marco-propio .at-aula-cabecera-titulo{font-size:14px}
}
html[data-at-resolved-theme="dark"] body.at-pantalla{
 --blanco:#182741;--gris:#101b2e;--borde:#344967;--texto:#F2F6FF;--texto-2:#BDCCE1;
 --marino:#0B1B3A;--azul:#82ADFF;--verde:#6BDEA3;
 background:#101b2e;color:#F2F6FF;color-scheme:dark}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-top,.at-aula-cabecera,.at-tem-head,.at-card,.at-chip,.at-curso,.at-promo,.at-flecha,.at-menu,.at-hoja,.at-ant,.at-pie,.at-notas-list li,.at-mod,.at-estado,.at-lienzo,.at-vacio){background:#182741;color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-leccion-temario,.at-sitio-pie){background:#15243a;color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-aula-cabecera-titulo,.at-titulo-pantalla,.at-curso h3,.at-mod-k,.at-mod-t,.at-chip b,.at-cert strong,.at-nav a[aria-current],.at-tem-head h2){color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-item,.at-menu a,.at-hoja li a,.at-ant,.at-nav a){color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-meta-leccion,.at-meta,.at-mod-c,.at-sec-h p,.at-curso-m,.at-curso-p,.at-tem-head p,.at-saludo-titulo,.at-resumen,.at-promo-c){color:#BDCCE1}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-item:hover,.at-mod summary:hover,.at-menu a:hover,.at-hoja li a:hover){background:#253b59}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-item.actual{background:#244675;color:#fff}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-item.actual .at-ico{background:#15243a}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-texto,html[data-at-resolved-theme="dark"] body.at-pantalla .at-principal{color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-informe{--lienzo:#101b2e;--tarjeta:#182741;--tinta:#F2F6FF;--tinta-suave:#BDCCE1;--linea:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-informe :is(.at-visual,.at-kpi){border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(input,textarea,select){background:#182741;color:#F2F6FF;border-color:#344967}
@media(max-width:420px){
 body.at-leccion-pantalla .at-top .at-logo,body.at-leccion-pantalla .at-top .at-prog{display:none}
 body.at-marco-propio .at-aula-cabecera-titulo{display:none}
}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-tema{background:#182741;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-icobtn{background:#182741;color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-atencion{background:#253b59;color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-leccion-pantalla .at-tem-busqueda input{background:#182741;color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-leccion-pantalla :is(.at-item-razon,.at-tem-busqueda label,.at-tem-busqueda p){color:#BDCCE1}


/*
 * Modo oscuro: lo que se veía apagado.
 *
 * Los títulos y el texto de los bloques vacíos heredaban el gris del modo
 * claro sobre fondo azul marino y quedaban casi ilegibles. Aquí se les pone
 * su color, y a los botones el contraste que les falta.
 */
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-vacio,.at-vacio h2,.at-vacio p,
  .at-seguir-t,.at-seguir-m,.at-sec-h h2,.at-tarjeta-titulo,.at-tarjeta-titulo a,
  .at-encabezado-leccion h1,.at-titulo-leccion,.at-nota-clase p,.at-nota-clase h4){color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-vacio p,.at-nota-lateral,
  .at-tarjeta-dato,.at-meta-leccion,.at-sub){color:#C6D4E8}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-vacio{background:#15243a;border-color:#344967}

/* El botón principal mantiene su naranja y su texto oscuro: es el que más
   contraste tiene sobre cualquiera de los dos fondos. */
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-btn-marca,.at-cta){
  background:#F28731;color:#0B1B3A}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-btn-suave,.at-btn-borde){
  background:transparent;color:#9EC5FF;border-color:#3D5170}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-nota-clase{background:#1B2A45;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-nota-clase.es-ojo{background:#2A2418}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-nota-clase.es-clave{background:#15281F}

/* La pantalla de entrada no cambia de color: su fondo ya es de la marca. */
html[data-at-resolved-theme="dark"] body.at-acceso-pantalla .at-card{background:#fff;color:#0B1B3A}
html[data-at-resolved-theme="dark"] body.at-acceso-pantalla .at-card :is(h2,label,p){color:#0B1B3A}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-salir{background:#182741;color:#F2F6FF;
  border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-salir:hover{background:#253b59}


/* --- Modo oscuro: lo añadido en las últimas versiones ------------------
 * Varias piezas nuevas traían colores fijos pensados para fondo claro —el
 * bloque del certificado, las tarjetas de material, los candados, el menú de
 * configuración—. Sobre el azul marino del modo oscuro quedaban ilegibles.
 * Aquí se les da su versión oscura, manteniendo el mismo significado: ámbar
 * para lo que espera, verde para lo cumplido, naranja para la acción final.
 */
html[data-at-resolved-theme="dark"] body.at-pantalla{
  --fondo:#182741; --suave:#1E2F4C; --linea:#344967;
  --tinta:#F2F6FF; --tinta-suave:#A9BCDB;
}

/* Certificado listo */
html[data-at-resolved-theme="dark"] body.at-pantalla .at-cert{background:#182741;color:#F2F6FF;
  border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-cert.es-listo{background:#2A2318;
  border-color:#F28731}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-cert.es-listo strong{color:#FFC98A}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-cert span,
html[data-at-resolved-theme="dark"] body.at-pantalla .at-cert a:not(.at-cert-bajar){color:#DCE6F4}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-cert-bajar{background:#F28731;color:#12203A}

/* Material de apoyo */
html[data-at-resolved-theme="dark"] body.at-pantalla .at-material a{background:#182741;color:#F2F6FF;
  border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-material a:hover{background:#1E2F4C}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-material-bajar{color:#8FB4FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-material .at-peso{color:#A9BCDB}

/* Módulos cerrados y sus candados */
html[data-at-resolved-theme="dark"] body.at-pantalla .at-mod-resumen,
html[data-at-resolved-theme="dark"] body.at-pantalla .at-item-razon{color:#E0B77A}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-mod-candado::after{background:#E0B77A}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-mod-candado::before{border-color:#E0B77A}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-mod-candado.es-abierto::after{background:#5CCB91}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-mod-candado.es-abierto::before{border-color:#5CCB91}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-item.bloq .at-ico::after{
  border-color:#E0B77A !important; box-shadow:0 -5px 0 -2px #15243a,0 -6px 0 -1px #E0B77A !important}

/* Menú de configuración y navegación */
html[data-at-resolved-theme="dark"] body.at-pantalla .at-menu-ajustes button,
html[data-at-resolved-theme="dark"] body.at-pantalla .at-menu-ajustes a{color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-menu-ajustes button:hover,
html[data-at-resolved-theme="dark"] body.at-pantalla .at-menu-ajustes a:hover{background:#253b59;
  color:#8FB4FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-menu-ajustes small{color:#A9BCDB}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-menu-rotulo{color:#8FA6CC}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-ant,.at-sig){background:#182741;
  color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-ant,.at-sig) span{color:#A9BCDB}

/* Perfil, certificados y encuesta */
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-certs-lista li,.at-perfil-campos input,
  .at-escala label,.at-cuestionario textarea){background:#182741;color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-certs-lista span,.at-escala-pie,
  .at-perfil-nota,.at-nota-lateral){color:#A9BCDB}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-escala label:has(input:checked){
  background:#23406E;border-color:#8FB4FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-perfil-aviso,
html[data-at-resolved-theme="dark"] body.at-pantalla .at-franja-previa{background:#2A2318;
  border-color:#8A5A0B;color:#FFC98A}


/* El foco, en modo oscuro: azul claro y sin halo blanco. */
html[data-at-resolved-theme="dark"] body.at-pantalla :focus-visible{
  outline:3px solid #8FB4FF; outline-offset:2px;
  box-shadow:0 0 0 5px rgba(15,27,48,.85)}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-curso-aviso{color:#E0B77A}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-carpeta{background:#15243a;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-carpeta summary:hover{background:#1E2F4C}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-carpeta-n{color:#A9BCDB}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-carpeta-ico::before,
html[data-at-resolved-theme="dark"] body.at-pantalla .at-carpeta-ico::after{background:#8FB4FF}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-rec-mod{background:#182741;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-rec-mod summary:hover{background:#1E2F4C}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-rec-vacio{color:#A9BCDB}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-rec-mod.es-actual{border-color:#8FB4FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-rec-aqui{background:#23406E;color:#CFE0FF}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-notas{background:#182741;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-notas textarea{background:#15243a;
  color:#F2F6FF;border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-notas-list li{background:#15243a;color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-nota-ir{background:#23406E;color:#CFE0FF}
html[data-at-resolved-theme="dark"] body.at-pantalla :is(.at-notas-privado,.at-nota-marca,
  .at-notas-vacio,.at-nota-borrar){color:#A9BCDB}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-inf-fuente{color:#A9BCDB}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-inf-fuente a{color:#8FB4FF}

html[data-at-resolved-theme="dark"] body.at-pantalla .at-mat-acc{background:#1E2F4C;color:#F2F6FF;
  border-color:#344967}
html[data-at-resolved-theme="dark"] body.at-pantalla .at-mat-acc.es-quitar{color:#FFA89B}

/*
 * Menú de la cuenta en la cabecera del aula (Mi aula, ficha, Mi perfil, Mis
 * certificados). Mismo aspecto que el de la lección.
 */
body.at-marco-propio .at-cuenta{position:relative;margin-left:12px;flex:0 0 auto}
body.at-marco-propio .at-cuenta-boton{width:40px;height:40px;padding:0;border:0;border-radius:50%;
  background:#0B1B3A;color:#fff;font-family:inherit;font-size:14px;font-weight:600;line-height:1;cursor:pointer;overflow:hidden;
  display:grid;place-items:center}
body.at-marco-propio .at-cuenta-boton:focus-visible{outline:3px solid #F28731;outline-offset:2px}
body.at-marco-propio .at-cuenta-boton .at-foto{width:100%;height:100%;border-radius:50%;object-fit:cover}
body.at-marco-propio .at-cuenta-boton .at-foto-letras{background:transparent;color:inherit}
body.at-marco-propio .at-cuenta-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:1000;width:260px;
  padding:8px;background:#fff;border:1px solid #DCE6F4;border-radius:12px;box-shadow:0 12px 32px rgba(11,27,58,.14)}
body.at-marco-propio .at-cuenta-menu[hidden]{display:none !important}
body.at-marco-propio .at-cuenta-menu a{display:flex;align-items:center;min-height:44px;padding:0 12px;
  border-radius:8px;color:#0B1B3A;font-size:15px;text-decoration:none}
body.at-marco-propio .at-cuenta-menu a:hover,body.at-marco-propio .at-cuenta-menu a:focus-visible{background:#F4F7FC}
body.at-marco-propio .at-cuenta-menu .at-sitio{color:#2553CB;font-weight:600}
body.at-marco-propio .at-cuenta-menu hr{border:0;border-top:1px solid #DCE6F4;margin:8px 0}
html[data-at-resolved-theme="dark"] body.at-marco-propio .at-cuenta-menu{background:#13213F;border-color:#2A3B5E}
html[data-at-resolved-theme="dark"] body.at-marco-propio .at-cuenta-menu a{color:#F2F6FF}
html[data-at-resolved-theme="dark"] body.at-marco-propio .at-cuenta-menu a:hover{background:#1C2D52}
html[data-at-resolved-theme="dark"] body.at-marco-propio .at-cuenta-menu .at-sitio{color:#8FB0FF}
html[data-at-resolved-theme="dark"] body.at-marco-propio .at-cuenta-menu hr{border-top-color:#2A3B5E}
