/* =====================================================================
   AK Community — Sistema de diseño · ACADEMIA
   Catálogo, página de curso, lección, examen, resultado/certificados y
   panel del alumno. Reglas del debate:
   - Área de estudio en Nunito Sans; la pregunta del examen a tamaño de
     cuerpo grande para que las opciones quepan en la 1.ª pantalla móvil.
   - «Continúa donde lo dejaste» arriba; lección actual resaltada con fondo.
   - Contadores en IBM Plex Mono; insignias ≥ 12 px.
   - Cuadrícula fina SOLO de fondo en catálogo, panel y examen.
   ===================================================================== */
@layer componentes {

  /* ---------------------------------------------------------------
     1. «Continúa donde lo dejaste»
     --------------------------------------------------------------- */
  .ak-resume {
    display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(200px, 300px); gap: var(--space-5); align-items: center;
    padding: var(--space-4); text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
    border-radius: var(--radius-md); box-shadow: var(--shadow-1);
    transition: box-shadow var(--dur-base), transform var(--dur-base) var(--ease-out);
  }
  .ak-resume:hover { color: var(--text); box-shadow: var(--shadow-2); transform: translateY(-2px); }
  .ak-resume-thumb {
    display: grid; place-items: center; width: 88px; aspect-ratio: 16 / 10; border-radius: var(--radius-sm);
    background-color: var(--course-tint); color: var(--on-course-tint);
    background-image: repeating-linear-gradient(transparent 0 11px, rgba(255, 255, 255, .10) 11px 12px);
  }
  .ak-resume-thumb .ak-icon { width: 26px; height: 26px; }
  .ak-resume-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ak-resume-copy .ak-eyebrow { margin-bottom: 2px; }
  .ak-resume-title { font-size: var(--step-1); font-weight: var(--weight-black); line-height: 1.25; color: var(--text); }
  .ak-resume-meta { font-size: var(--step--1); color: var(--text-muted); }
  .ak-resume-meta .ak-mono { color: var(--accent-text); }
  .ak-resume-progress { display: grid; gap: var(--space-3); }
  .ak-resume-progress .ak-btn { justify-self: stretch; }
  .ak-resume--compacta { grid-template-columns: auto minmax(0, 1fr); }
  .ak-resume--compacta .ak-resume-progress { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; }

  @media (max-width: 600px) {
    .ak-resume { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); }
    .ak-resume-thumb { width: 60px; }
    .ak-resume-progress { grid-column: 1 / -1; }
    .ak-resume--compacta .ak-resume-progress { grid-template-columns: 1fr; }
  }

  /* ---------------------------------------------------------------
     2. Marco de las pantallas de app (catálogo, panel)
     --------------------------------------------------------------- */
  .ak-app { padding-bottom: var(--space-9); }
  .ak-app .ak-page-head h1 { font-size: var(--step-5); }
  .ak-acciones { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); }
  .ak-catalogo-resume { margin-bottom: var(--space-6); }
  .ak-filters { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
  /* El nombre ya se lee en la portada del curso: el título queda para lectores de pantalla */
  .ak-course-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
  .ak-course-title a { color: var(--text); text-decoration: none; }
  .ak-course-title a:hover { color: var(--link); }
  .ak-course-title .ak-mono { color: var(--accent-text); font-size: .75em; }
  .ak-catalog-foot { margin-top: var(--space-7); display: grid; gap: var(--space-4); }
  .ak-cert-callout {
    display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: center;
    padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-1);
  }
  .ak-cert-callout .ak-include-ic { margin: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
  .ak-cert-callout strong { color: var(--text); }
  .ak-cert-callout p { margin: 2px 0 0; font-size: var(--step--1); }
  .ak-catalog-links { display: flex; gap: var(--space-5); flex-wrap: wrap; margin: var(--space-3) 0 0; }

  /* Panel */
  .ak-dash-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-5); flex-wrap: wrap; }
  .ak-dash-head h1 { font-size: var(--step-4); }
  .ak-dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
  .ak-dash-continue { grid-column: span 7; }
  .ak-dash-continue .ak-resume { grid-template-columns: auto minmax(0, 1fr); height: 100%; }
  .ak-dash-continue .ak-resume-progress { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; }
  .ak-dash-stats { grid-column: span 5; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
  .ak-dash-courses { grid-column: span 7; }
  .ak-dash-side { grid-column: span 5; display: grid; gap: var(--space-5); }
  .ak-dash-offer { grid-column: 1 / -1; }
  .ak-dash-side h3 { font-size: var(--step-0); margin: 2px 0 6px; }
  .ak-dash-side .ak-btn { margin-top: var(--space-3); }
  .ak-dash-side p:not(.ak-eyebrow) { color: var(--text-2); font-size: var(--step--1); }
  .ak-dc-list { list-style: none; margin: 0; padding: 0; }
  .ak-dc-list li {
    display: grid; grid-template-columns: 2.6em minmax(0, 1fr) minmax(120px, 220px); gap: var(--space-4); align-items: center;
    margin: 0; padding-block: 14px; border-top: 1px dashed var(--rule);
  }
  .ak-dcl-n { color: var(--accent-text); font-size: var(--step--1); }
  .ak-dcl-main { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
  .ak-dcl-main strong { font-size: var(--step-0); }
  .ak-dcl-main:hover strong { color: var(--link); }
  .ak-cert-mini { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-block: 12px; }
  .ak-cert-mini > div { display: flex; flex-direction: column; }
  .ak-cert-mini strong { font-size: var(--step--1); line-height: 1.3; color: var(--text); }
  .ak-cm-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }

  /* ---------------------------------------------------------------
     3. Lección (sin cuadrícula: solo papel)
     --------------------------------------------------------------- */
  .ak-lesson-crumbs { padding-top: var(--space-5); }
  .ak-crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: var(--step--1); color: var(--text-muted); }
  .ak-crumbs a { color: var(--text-2); font-weight: var(--weight-bold); text-decoration: none; }
  .ak-crumbs a:hover { color: var(--link); text-decoration: underline; }
  .ak-lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-7); padding-block: var(--space-4) var(--space-9); align-items: start; }
  .ak-lesson-head { margin-bottom: var(--space-6); }
  .ak-lesson-head h1 { font-size: var(--step-4); max-width: 24ch; }
  .ak-lesson-meta { display: flex; gap: var(--space-5); flex-wrap: wrap; align-items: center; font-size: var(--step--1); color: var(--text-muted); }
  .ak-lesson-meta > span, .ak-lesson-meta > a { display: inline-flex; gap: 6px; align-items: center; }
  .ak-lesson-meta a { color: var(--text-muted); text-decoration: none; }
  .ak-lesson-meta a:hover { color: var(--link); }

  /* Texto de la lección: legibilidad ante todo */
  .ak-prose { font-size: var(--step-0); line-height: var(--leading-body); color: var(--text-2); }
  .ak-prose p, .ak-prose li { max-width: var(--measure); }
  .ak-prose h2, .ak-prose h3 { font-family: var(--font-text); font-weight: var(--weight-black); color: var(--text); line-height: 1.3; margin: var(--space-6) 0 var(--space-3); }
  .ak-prose h2 { font-size: var(--step-2); }
  .ak-prose h3 { font-size: var(--step-1); }
  .ak-prose h4 { font-size: var(--step-0); color: var(--text); margin: var(--space-5) 0 var(--space-2); }
  .ak-prose strong, .ak-prose b { color: var(--text); }
  .ak-prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
  .ak-prose ul, .ak-prose ol { padding-left: 1.4em; }
  .ak-prose li::marker { color: var(--accent-text); }
  .ak-prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
  .ak-prose iframe, .ak-prose video, .ak-prose .elementor-video, .ak-prose .elementor-wrapper {
    width: 100%; border-radius: var(--radius-lg); border: 0; box-shadow: var(--shadow-3); background: var(--brand-ink);
  }
  .ak-prose iframe[src*="vimeo"], .ak-prose iframe[src*="youtube"] { aspect-ratio: 16 / 9; height: auto; }
  .ak-prose .elementor-widget-container { color: inherit; }
  .ak-prose .e-con, .ak-prose .elementor-section { --padding-left: 0; --padding-right: 0; }
  .ak-prose blockquote { font-family: var(--font-text); font-style: normal; font-size: var(--step-0); background: var(--accent-soft); border-left: 4px solid var(--accent); padding: var(--space-4) var(--space-5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); }
  /* Cuestionarios en widgets HTML dentro de la lección (formularios con radios) */
  .ak-prose form, .ak-prose .quiz, .ak-prose [class*="quiz"], .ak-prose [class*="cuestionario"] { font-family: var(--font-text); }

  /* Contenido heredado de las lecciones (widgets HTML de Elementor) */
  .quiz-container {
    display: grid; gap: var(--space-2); margin-block: var(--space-6);
    padding: clamp(18px, 3vw, 32px); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  }
  .quiz-container h3 { font-size: var(--step-1); margin: 0 0 var(--space-3); color: var(--text); }
  .quiz-container p { margin: var(--space-4) 0 var(--space-1); font-weight: var(--weight-bold); color: var(--text); }
  .quiz-container label {
    display: flex; gap: var(--space-3); align-items: center; padding: 10px var(--space-4);
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-weight: var(--weight-regular); color: var(--text-2); cursor: pointer;
  }
  .quiz-container label:hover { border-color: var(--border-strong); }
  .quiz-container label input { flex: none; margin: 0; } /* el radio no encoge cuando la opción ocupa dos líneas */
  .quiz-container .quiz-item { display: grid; gap: var(--space-2); }
  .quiz-flex { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-4); }
  .quiz-flex .quiz-container { margin-block: 0; }
  /* Código en línea (lecciones de Make): antes azul #0036FF fijo en el CSS de cada widget */
  .ak-prose code, .ak-prose kbd {
    font-family: var(--font-mono); font-size: .9em; padding: 2px 6px; border-radius: var(--radius-xs);
    background: var(--info-bg); color: var(--info); border: 1px solid var(--border); overflow-wrap: anywhere;
  }
  .ak-prose pre { font-family: var(--font-mono); font-size: var(--step--1); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-4); overflow-x: auto; }
  .ak-prose pre code { background: none; border: 0; padding: 0; color: inherit; }
  /* Figuras con pie de foto */
  .ak-prose figure { margin: var(--space-6) 0; }
  .ak-prose figure img { margin-inline: auto; }
  .ak-prose figcaption { margin-top: var(--space-2); font-size: var(--step--1); color: var(--text-muted); text-align: center; }
  /* Tablas: cabecera y filas con los tokens */
  .ak-prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
  .ak-prose th, .ak-prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; color: var(--text-2); }
  .ak-prose th { background: var(--surface-2); color: var(--text); font-weight: var(--weight-black); }
  .ak-prose hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-6) 0; }

  .quiz-container label:has(input:checked) { border-color: var(--primary); background: var(--info-bg); color: var(--text); }
  .quiz-container button {
    justify-self: start; margin-top: var(--space-4); min-height: 48px; padding: 12px 24px; border: 0; border-radius: var(--radius-pill);
    background: var(--primary); color: var(--on-primary); font-weight: var(--weight-black); cursor: pointer;
  }
  #quiz-result, .quiz-feedback { margin-top: var(--space-3); font-weight: var(--weight-bold); }
  #quiz-result.success { color: var(--success); }
  #quiz-result.error { color: var(--danger); }
  .comparison-table, .ak-prose table { display: block; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
  /* Botón «+» que abre la captura en grande (popup-images.js) */
  .ver-imagen {
    display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 4px; vertical-align: middle;
    border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent);
    font-weight: var(--weight-black); cursor: pointer; line-height: 1;
  }
  .ver-imagen:hover { background: var(--accent); color: var(--on-accent); }
  .popup-img {
    display: none; position: fixed; inset: 0; z-index: var(--z-modal);
    align-items: center; justify-content: center; padding: var(--space-5);
    background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  }
  .popup-img img, .popup-img video { max-width: min(96%, 1200px); max-height: 88vh; border-radius: var(--radius-md); box-shadow: var(--shadow-3); background: var(--surface); }
  .popup-img .cerrar {
    position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 48px; height: 48px;
    border-radius: 50%; background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; box-shadow: var(--shadow-2);
  }

  .ak-lesson-actions { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); margin-top: var(--space-7); align-items: stretch; }
  .ak-lesson-progress { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
  #ak-boton-completar-leccion {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
    padding: 13px 24px; border-radius: var(--radius-pill); cursor: pointer;
    font-family: var(--font-text); font-weight: var(--weight-black); font-size: var(--step-0);
    background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong);
  }
  #ak-boton-completar-leccion:hover { border-color: var(--text); }
  #ak-boton-completar-leccion::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
  #ak-boton-completar-leccion[data-ak-state="1"] { background: var(--success-bg); color: var(--success); border-color: transparent; }
  #ak-boton-completar-leccion[data-ak-state="1"]::before { background: currentColor; box-shadow: inset 0 0 0 3px var(--success-bg); }
  .ak-progreso-msg { font-size: var(--step--1); color: var(--success); }
  .ak-next-lesson {
    display: grid; grid-template-columns: 1fr auto; column-gap: var(--space-4); align-items: center;
    background: var(--primary); color: var(--on-primary); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); text-decoration: none;
  }
  .ak-next-lesson:hover { background: var(--primary-hover); color: var(--on-primary); }
  .ak-nl-k { grid-column: 1; font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
  .ak-nl-t { grid-column: 1; font-weight: var(--weight-black); font-size: var(--step-1); line-height: 1.25; }
  .ak-nl-go { grid-column: 2; grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
  .ak-lesson-prev { margin-top: var(--space-5); font-size: var(--step--1); }
  .ak-lesson-prev .ak-link-arrow { font-weight: var(--weight-bold); color: var(--text-2); }
  .ak-lesson-comments { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--rule); }
  .ak-lesson-comments .comments-title, .ak-lesson-comments .comment-reply-title { font-family: var(--font-text); font-weight: var(--weight-black); font-size: var(--step-1); }
  .ak-lesson-comments .ast-comment-list, .ak-lesson-comments .comment-list { list-style: none; padding: 0; }
  .ak-lesson-comments .comment-body, .ak-lesson-comments .ast-comment {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-3);
  }
  .ak-lesson-comments .avatar { border-radius: 50%; }

  .ak-lesson-aside { display: grid; gap: var(--space-5); position: sticky; top: calc(var(--header-h) + 20px); }
  .ak-module-index { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-1); padding: var(--space-5); }
  .ak-mi-head .ak-eyebrow { margin-bottom: 4px; }
  .ak-mi-title { font-weight: var(--weight-black); font-size: var(--step-1); line-height: 1.25; color: var(--text); margin: 0 0 var(--space-3); }
  .ak-mi-head .ak-small { margin: 6px 0 0; }
  .ak-module-index ol { list-style: none; margin: var(--space-4) 0 0; padding: 0; border-top: 1px solid var(--rule); }
  .ak-module-index li { margin: 0; }
  .ak-module-index li a {
    display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start;
    padding: 10px 8px; margin-inline: -8px; border-bottom: 1px dashed var(--rule); border-radius: var(--radius-sm);
    font-size: var(--step--1); color: var(--text-2); font-weight: var(--weight-semibold); text-decoration: none;
  }
  .ak-module-index li a:hover { background: var(--surface-2); color: var(--text); }
  /* Lección actual resaltada con fondo (regla 3) */
  .ak-module-index li.is-actual a { background: var(--info-bg); color: var(--text); font-weight: var(--weight-black); box-shadow: inset 3px 0 0 var(--primary); }
  .ak-mi-dot {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); font-size: .78rem;
  }
  .ak-mi-dot .ak-icon { width: 14px; height: 14px; }
  .is-hecha .ak-mi-dot { background: var(--success-bg); color: var(--success); border-color: transparent; }
  .is-actual .ak-mi-dot { background: var(--primary); color: var(--on-primary); border-color: transparent; }
  .ak-mi-foot { padding-top: var(--space-4); font-size: var(--step--1); }

  /* ---------------------------------------------------------------
     4. Página de curso (Elementor + shortcodes akademia)
     --------------------------------------------------------------- */
  /* Cabecera de la página de curso (sustituye al widget heading de Elementor: ak-diseno.php) */
  .ak-pagina-curso .elementor-widget-heading:has(.ak-curso-head) { text-align: left; }
  .ak-curso-head { padding-block: clamp(24px, 4vw, 56px) var(--space-4); }
  .ak-curso-head .ak-eyebrow::before { background: var(--course-tint); }
  [data-theme="dark"] .ak-curso-head .ak-eyebrow::before { background: var(--accent); }
  .ak-curso-head .elementor-heading-title {
    font-family: var(--font-display); font-weight: 600; font-size: var(--step-5); line-height: var(--leading-tight);
    letter-spacing: -.01em; text-transform: none; color: var(--text); margin: 0;
  }
  /* Sin sesión los módulos no se listan: no dejar sus títulos sueltos */
  body:not(.logged-in).ak-pagina-curso .elementor-widget-shortcode h2 { display: none; }
  .ak-curso-cta { margin-top: var(--space-5); display: grid; gap: var(--space-4); max-width: 760px; }
  .ak-curso-cta p { margin: 0; color: var(--text-2); }
  .ak-curso-cta-acc { display: flex; flex-wrap: wrap; gap: var(--space-3); }
  .ak-curso-head em { font-style: italic; font-weight: 500; background: linear-gradient(transparent 64%, var(--accent-soft) 64%, var(--accent-soft) 94%, transparent 94%); padding-inline: 2px; }
  .ak-curso-barra { padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
  .ak-curso-barra .ak-eyebrow { margin-bottom: var(--space-2); }
  .elementor-widget-shortcode h2 { font-family: var(--font-text); font-weight: var(--weight-black); font-size: var(--step-1); color: var(--text); margin: var(--space-5) 0 var(--space-3); }
  .modulo-contenedor {
    counter-reset: ak-leccion; display: grid;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-1); overflow: hidden;
  }
  .tarjeta-leccion {
    counter-increment: ak-leccion;
    display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
    padding: 12px var(--space-5); border-top: 1px dashed var(--rule);
  }
  .tarjeta-leccion:first-child { border-top: 0; }
  .tarjeta-leccion::before { content: counter(ak-leccion, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent-text); }
  .tarjeta-leccion .titulo-leccion { margin: 0; font-family: var(--font-text); font-size: var(--step-0); font-weight: var(--weight-bold); line-height: 1.35; }
  .tarjeta-leccion .titulo-leccion a { color: var(--text); text-decoration: none; }
  .tarjeta-leccion .titulo-leccion a:hover { color: var(--link); text-decoration: underline; }
  .tarjeta-leccion .estado {
    font-size: var(--step--2); font-weight: var(--weight-black); padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap;
    background: var(--surface-2); color: var(--text-muted);
  }
  .tarjeta-leccion .estado.completada { background: var(--success-bg); color: var(--success); }
  .tarjeta-leccion .estado.siguiente { background: var(--primary); color: var(--on-primary); }
  .tarjeta-leccion.is-actual { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--primary); }
  .ak-leccion-nav .ak-btn-next { display: inline-flex; gap: 8px; align-items: center; padding: 12px 22px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font-weight: var(--weight-black); text-decoration: none; }

  /* ---------------------------------------------------------------
     5. Examen (shortcode [akademia_exam] + akademia-exam-client.js)
     --------------------------------------------------------------- */
  .ak-exam-container { font-family: var(--font-text); color: var(--text-2); margin-block: var(--space-6); }
  .ak-exam-collapsed-view {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    padding: var(--space-5); cursor: pointer;
    background-color: var(--surface);
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 28px 28px;
    border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-md); box-shadow: var(--shadow-1);
    transition: box-shadow var(--dur-base), transform var(--dur-base) var(--ease-out);
  }
  .ak-exam-collapsed-view:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
  .ak-exam-collapsed-content { display: flex; flex-direction: column; gap: 4px; }
  .ak-exam-collapsed-label { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--accent-text); }
  .ak-exam-collapsed-title { margin: 0; font-family: var(--font-text); font-size: var(--step-1); font-weight: var(--weight-black); color: var(--text); }
  .ak-exam-toggle-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 14px; transition: transform var(--dur-base); flex: none; }
  .ak-exam-expandable-content { display: none; position: relative; }
  .ak-exam-collapsible.ak-exam-expanded .ak-exam-collapsed-view { display: none; }
  .ak-exam-collapsible.ak-exam-expanded .ak-exam-expandable-content { display: block; }
  .ak-exam-expandable-content {
    padding: clamp(20px, 4vw, 40px); border: 1px solid var(--border); border-radius: var(--radius-lg);
    background-color: var(--bg);
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 28px 28px;
  }
  /* «Minimizar» ya no se superpone a la barra: va en su propia fila */
  .ak-exam-collapse-btn {
    display: flex; width: max-content; align-items: center; gap: 6px; margin: 0 0 var(--space-4) auto;
    padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface);
    color: var(--text-2); font-size: var(--step--2); font-weight: var(--weight-bold); cursor: pointer;
  }
  .ak-exam-header { clear: both; margin-bottom: var(--space-5); }
  .ak-exam-title { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; color: var(--text); max-width: 26ch; margin: 0 0 var(--space-3); }
  .ak-exam-description { color: var(--text-2); }
  .ak-exam-meta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
  .ak-exam-meta-item {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: var(--radius-pill);
    background: var(--surface); border: 1px solid var(--border); font-size: var(--step--1);
  }
  .ak-meta-icon { display: none; }
  .ak-meta-label { color: var(--text-muted); }
  .ak-meta-value { font-family: var(--font-mono); color: var(--text); }
  .ak-exam-attempts { margin-bottom: var(--space-5); }
  .ak-exam-attempts h3 { font-size: var(--step-1); }
  .ak-attempts-table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .ak-attempts-table { margin: 0; }
  .ak-attempts-table td { font-family: var(--font-text); }
  .ak-attempts-table .attempt-date, .ak-attempts-table .attempt-time, .ak-attempts-table .attempt-number { font-family: var(--font-mono); font-size: var(--step--2); }
  .score-badge { display: inline-block; font-family: var(--font-mono); padding: 3px 10px; border-radius: var(--radius-pill); }
  .score-badge.passed, .result-passed { color: var(--success); background: var(--success-bg); }
  .score-badge.failed, .result-failed { color: var(--danger); background: var(--danger-bg); }
  .result-passed, .result-failed { padding: 3px 10px; border-radius: var(--radius-pill); font-weight: var(--weight-black); font-size: var(--step--2); white-space: nowrap; }
  .ak-btn-view-attempt, .ak-btn-cert-open-modal {
    padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); font-weight: var(--weight-bold); font-size: var(--step--2); cursor: pointer; white-space: nowrap;
  }
  .ak-exam-actions { display: grid; justify-items: start; gap: var(--space-2); }
  .ak-btn-primary, .ak-btn-secondary, #ak-start-exam-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
    padding: 12px 24px; border-radius: var(--radius-pill); cursor: pointer;
    font-family: var(--font-text); font-weight: var(--weight-black); font-size: var(--step-0); text-decoration: none;
  }
  .ak-btn-primary, #ak-start-exam-btn { background: var(--primary); color: var(--on-primary); border: 0; }
  .ak-btn-primary:hover, #ak-start-exam-btn:hover { background: var(--primary-hover); color: var(--on-primary); }
  .ak-btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong); }
  .ak-btn-secondary:hover { border-color: var(--text); }
  /* «Anterior» deshabilitado: visible pero claramente inactivo */
  .ak-btn-secondary:disabled { color: var(--text-muted); border-color: var(--border); background: var(--surface-2); cursor: not-allowed; }
  .ak-exam-hint { font-size: var(--step--1); color: var(--text-muted); margin: 0; }
  .ak-exam-notice { padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); color: var(--text); }
  .ak-notice-warning { border-left-color: var(--warning); background: var(--warning-bg); }
  .ak-exam-notice p { margin: 0 0 6px; }

  .ak-exam-progress { margin-bottom: var(--space-4); }
  .ak-progress-info { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--text-2); margin-bottom: 8px; }
  .ak-progress-text, .ak-progress-percentage { font-family: var(--font-mono); }
  .ak-progress-bar { height: 8px; border-radius: 99px; background: var(--progress-track); overflow: hidden; }
  .ak-progress-fill { height: 100%; background: var(--progress-fill); border-radius: 99px; transition: width var(--dur-slow) var(--ease-out); }
  .ak-exam-timer {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--space-4);
    padding: 8px 16px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-size: var(--step--1);
  }
  .ak-exam-timer .timer-icon { display: none; }
  .ak-exam-timer .timer-label { color: var(--text-muted); }
  .ak-exam-timer .timer-value { font-family: var(--font-mono); font-size: var(--step-1); color: var(--text); }
  .ak-exam-timer .timer-value.warning { color: var(--warning); }
  .ak-exam-timer .timer-value.critical { color: var(--danger); }

  .ak-question-wrapper {
    padding: clamp(18px, 4vw, 36px); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-1); scroll-margin-top: calc(var(--header-h) + 16px);
  }
  .ak-question-header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-3); }
  .ak-question-title { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-text); }
  .ak-question-points { font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-muted); }
  /* Pregunta en sans a tamaño de cuerpo grande (regla 1): las opciones caben en la 1.ª pantalla móvil */
  .ak-question-text { font-family: var(--font-text); font-size: var(--step-1); font-weight: var(--weight-semibold); line-height: 1.45; color: var(--text); margin-bottom: var(--space-4); }
  .ak-question-text p { margin: 0 0 8px; }
  .ak-mc-container { display: grid; gap: var(--space-3); counter-reset: ak-opcion; }
  .ak-mc-option {
    position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: center;
    padding: 12px var(--space-4); border: 1.5px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text-2); cursor: pointer; counter-increment: ak-opcion;
    font-size: var(--step-0); line-height: 1.4;
    transition: border-color var(--dur-base), background-color var(--dur-base);
  }
  .ak-mc-option::before {
    content: counter(ak-opcion, upper-alpha); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-mono); font-size: .85rem; color: var(--text-2);
  }
  .ak-mc-option:hover { border-color: var(--border-strong); }
  .ak-mc-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
  .ak-mc-option:has(input:checked) { border-color: var(--primary); background: var(--info-bg); color: var(--text); }
  .ak-mc-option:has(input:checked)::before { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
  .ak-mc-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
  .ak-fill-blanks-container { display: grid; gap: var(--space-3); }
  .fill-instructions { font-size: var(--step--1); color: var(--text-muted); }
  .fill-text-container { font-size: var(--step-1); line-height: 2.1; color: var(--text); }
  .ak-blank-select, .ak-blank-input { display: inline-block; width: auto; max-width: 100%; min-height: 40px; padding: 4px 32px 4px 10px; margin: 0 4px; font-size: var(--step-0); }
  .fill-hint { font-size: var(--step--1); color: var(--text-muted); }
  .ak-exam-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-top: var(--space-5); flex-wrap: wrap; }
  .ak-btn-submit { background: var(--accent); color: var(--on-accent); }
  .ak-btn-submit:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--on-accent); }
  .ak-auto-save-indicator { font-size: var(--step--2); color: var(--text-muted); margin-top: var(--space-2); }

  /* Resultados */
  .ak-results-header { text-align: center; padding: var(--space-6) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
  .ak-results-header h2 { font-size: var(--step-4); margin: var(--space-3) 0; }
  .ak-results-header .result-icon { font-size: 2rem; }
  .ak-results-header .result-message { color: var(--text-2); }
  .ak-score-display { display: grid; justify-items: center; gap: var(--space-3); margin-top: var(--space-4); }
  .ak-score-circle {
    display: grid; place-items: center; width: 160px; height: 160px; border-radius: 50%;
    background: conic-gradient(var(--success) calc(var(--p, 100) * 1%), var(--progress-track) 0); position: relative;
    box-shadow: inset 0 0 0 12px var(--success);
  }
  .ak-score-circle.failed { box-shadow: inset 0 0 0 12px var(--danger); }
  .ak-score-circle::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
  .ak-score-percentage { position: relative; z-index: 1; font-family: var(--font-mono); font-size: var(--step-2); color: var(--text); }
  .score-detail { color: var(--text-2); font-size: var(--step--1); }
  .ak-results-feedback { margin-top: var(--space-6); display: grid; gap: var(--space-4); }
  .ak-results-feedback, .ak-error-item, .ak-exam-container { overflow-wrap: anywhere; }
  .ak-results-feedback > h3 { font-size: var(--step-1); }
  .feedback-section { display: grid; gap: var(--space-3); }
  .feedback-section .section-title { font-size: var(--step-0); color: var(--text); margin: var(--space-3) 0 0; }
  .ak-feedback-item { padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--success); border-radius: var(--radius-md); }
  .ak-feedback-item.incorrect { border-left-color: var(--danger); }
  .ak-feedback-item h5 { margin: 0; font-size: var(--step--1); color: var(--text); display: flex; gap: 8px; align-items: center; }
  .feedback-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: .8rem; }
  .incorrect .feedback-icon { background: var(--danger-bg); color: var(--danger); }
  .ak-feedback-explanation { margin: var(--space-2) 0 0; color: var(--text-2); font-size: var(--step--1); padding-left: var(--space-4); border-left: 2px solid var(--rule); }
  .feedback-answers { display: grid; gap: 4px; margin-top: var(--space-3); font-size: var(--step--1); }
  .your-answer { color: var(--danger); }
  .correct-answer { color: var(--success); font-weight: var(--weight-bold); }
  .ak-retry-section, .ak-success-section { margin-top: var(--space-6); padding: var(--space-5); background: var(--surface-2); border-radius: var(--radius-md); display: grid; gap: var(--space-3); justify-items: start; }

  /* Modales del examen (errores y descarga de certificado) */
  .ak-modal { display: none; position: fixed; inset: 0; z-index: var(--z-modal); background: var(--overlay); align-items: center; justify-content: center; padding: var(--space-4); }
  .ak-modal-content { width: min(720px, 100%); max-height: 86vh; overflow: auto; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); }
  .ak-modal-header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
  .ak-modal-title { font-family: var(--font-text); font-size: var(--step-1); font-weight: var(--weight-black); margin: 0; }
  .ak-modal-close, .ak-cert-close-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
  .ak-modal-body { padding: var(--space-5); }
  .ak-error-item { padding: var(--space-4); border: 1px solid var(--border); border-left: 4px solid var(--danger); border-radius: var(--radius-sm); margin-bottom: var(--space-3); }
  .ak-error-header { display: flex; justify-content: space-between; font-weight: var(--weight-black); margin-bottom: 6px; }
  .ak-error-points { font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-muted); }
  .ak-error-hint, .ak-errors-summary { font-size: var(--step--1); color: var(--text-muted); margin-top: 6px; }
  .ak-cert-modal-overlay { display: none; position: fixed; inset: 0; z-index: var(--z-modal); background: var(--overlay); align-items: center; justify-content: center; padding: var(--space-4); }
  .ak-cert-modal-overlay.active { display: flex; }
  .ak-cert-modal-content { position: relative; width: min(520px, 100%); background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-5) var(--space-5); box-shadow: var(--shadow-3); }
  .ak-cert-close-btn { position: absolute; top: 12px; right: 12px; }
  .dropdown-section { display: grid; gap: 6px; margin-bottom: var(--space-4); }
  .dropdown-label { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
  .dropdown-item { display: block; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: var(--weight-bold); }
  .dropdown-item:hover { background: var(--surface-2); color: var(--text); }

  /* ---------------------------------------------------------------
     6. Mis certificados y verificación
     --------------------------------------------------------------- */
  .ak-certificates-container, .ak-cert-verification-page { max-width: 960px; margin: var(--space-6) auto; padding-inline: var(--gutter); font-family: var(--font-text); }
  .ak-certificates-empty, .ak-certificates-notice {
    text-align: center; padding: var(--space-7) var(--space-5); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-2);
  }
  .ak-empty-icon { font-size: 2.4rem; line-height: 1; margin-bottom: var(--space-3); }
  .ak-certificates-empty h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); }
  .ak-certificates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-5); }
  .ak-certificate-card {
    display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
    padding: 10px; overflow: visible;
  }
  .ak-cert-card-header { min-height: 8px; border: 2px solid var(--primary); border-bottom: 0; border-radius: 12px 12px 0 0; padding: var(--space-3); background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 70%); }
  .ak-cert-logo { max-height: 36px; width: auto; }
  .ak-cert-card-body { border: 2px solid var(--primary); border-top: 0; border-radius: 0 0 12px 12px; padding: var(--space-4) var(--space-5) var(--space-5); text-align: center; }
  .ak-cert-title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--text); margin-bottom: var(--space-4); }
  .ak-cert-info { display: grid; gap: 8px; text-align: left; }
  .ak-cert-info-item { display: flex; justify-content: space-between; gap: var(--space-3); border-top: 1px dashed var(--rule); padding-top: 8px; }
  .ak-cert-label { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
  .ak-cert-value { font-family: var(--font-mono); color: var(--text); }
  .ak-cert-card-footer { padding: var(--space-4) var(--space-2) var(--space-2); }
  .ak-cert-dropdown { position: relative; }
  .ak-btn-download, .ak-btn-verify {
    width: 100%; min-height: 48px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
    background: var(--primary); color: var(--on-primary); font-family: var(--font-text); font-weight: var(--weight-black); font-size: var(--step-0);
  }
  .ak-btn-download:hover, .ak-btn-verify:hover { background: var(--primary-hover); }
  .ak-cert-dropdown-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-3); padding: 6px; }
  .ak-cert-dropdown-menu.show { display: grid; }
  .ak-cert-option { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
  .ak-cert-option:hover { background: var(--surface-2); color: var(--text); }
  .ak-cert-option-text { display: flex; flex-direction: column; }
  .ak-cert-option-text small { color: var(--text-muted); }

  .ak-verification-form, .ak-verification-result > div {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: clamp(20px, 4vw, 40px);
  }
  .ak-verification-header { text-align: center; padding-bottom: var(--space-5); margin-bottom: var(--space-5); border-bottom: 1px solid var(--rule); }
  .ak-verification-header h1 { font-size: var(--step-4); color: var(--text); }
  .ak-verification-header p { color: var(--text-2); margin: 0; }
  .ak-form-group { display: grid; gap: 8px; margin-bottom: var(--space-4); }
  .ak-form-group input { width: 100%; font-family: var(--font-mono); }
  .ak-verification-result { margin-top: var(--space-5); }
  .ak-result-success { border-top: 4px solid var(--success); text-align: center; }
  .ak-result-error { border-top: 4px solid var(--danger); text-align: center; }
  .ak-result-icon { font-size: 2rem; }
  .ak-cert-details { display: grid; gap: 8px; text-align: left; margin-top: var(--space-5); }
  .ak-cert-detail-row { display: flex; justify-content: space-between; gap: var(--space-4); border-top: 1px dashed var(--rule); padding-top: 8px; flex-wrap: wrap; }
  .ak-detail-label { color: var(--text-muted); }
  .ak-detail-value { color: var(--text); font-weight: var(--weight-bold); }
  .ak-detail-value.passed, .status-approved { color: var(--success); }
  .ak-detail-value.failed, .status-failed { color: var(--danger); }
  .ak-cert-id { font-family: var(--font-mono); }

  /* ---------------------------------------------------------------
     6b. Mis certificados y verificación · marcado nuevo (fase 6)
         template-parts/ak-mis-certificados.php y ak-verificacion.php.
         Las clases de arriba (6) quedan para el modal del examen.
     --------------------------------------------------------------- */
  .ak-pag-certificados .ak-page-head .ak-lead a, .ak-pag-validacion .ak-page-head .ak-lead a { color: var(--link); }
  .ak-certs-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); align-items: start; }
  .ak-cert-card {
    display: grid; gap: var(--space-3); padding: 10px 10px var(--space-4);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
  }
  /* «Papel» del certificado: doble filete como el impreso */
  .ak-cert-card-papel {
    position: relative; display: grid; gap: 6px; text-align: center; justify-items: center;
    padding: var(--space-5) var(--space-5) var(--space-4);
    border: 2px solid var(--primary); border-radius: 14px; outline: 1px solid var(--primary); outline-offset: -7px;
    background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 62%), var(--surface);
  }
  .ak-cert-card-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: 32px; }
  .ak-cert-card-top .ak-badge { margin-left: auto; }
  .ak-cert-card-logo { height: 30px; width: auto; }
  /* logos de plataforma con texto oscuro (Meta): pastilla clara en oscuro */
  [data-theme="dark"] .ak-cert-card-logo { height: 36px; padding: 3px 8px; background: #fffaf2; border-radius: 8px; }
  .ak-cert-card-k { margin: var(--space-2) 0 0; font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--accent-text); }
  .ak-cert-card-titulo { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); line-height: var(--leading-snug); color: var(--text); text-wrap: balance; }
  .ak-cert-card-examen { margin: 0; font-size: var(--step--1); color: var(--text-muted); }
  .ak-cert-card-datos { width: 100%; margin: var(--space-3) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); text-align: left; }
  .ak-cert-card-datos div { display: grid; gap: 2px; min-width: 0; }
  .ak-cert-card-datos dt { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
  .ak-cert-card-datos dd { margin: 0; font-weight: var(--weight-bold); color: var(--text); font-size: var(--step--1); }
  .ak-cert-card-codigo { grid-column: 1 / -1; }
  .ak-cert-card-codigo dd { font-family: var(--font-mono); font-weight: 500; letter-spacing: .04em; overflow-wrap: anywhere; }
  .ak-cert-card-sello { position: absolute; right: 22px; bottom: 22px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--accent-soft); }
  .ak-cert-card-sello .ak-icon { width: 22px; height: 22px; }

  /* Descarga: botón que despliega los 4 formatos dentro de la tarjeta (sin capas flotantes) */
  .ak-cert-descarga { margin-top: var(--space-3); padding-inline: 6px; }
  .ak-cert-descarga > summary { list-style: none; cursor: pointer; gap: 10px; }
  .ak-cert-descarga > summary::-webkit-details-marker { display: none; }
  .ak-cert-descarga-chev { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-base) var(--ease-out); }
  .ak-cert-descarga[open] .ak-cert-descarga-chev { transform: translateY(2px) rotate(-135deg); }
  .ak-cert-descarga-panel { display: grid; gap: var(--space-3); margin-top: var(--space-3); padding: var(--space-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
  .ak-cert-formato { display: grid; gap: var(--space-2); }
  .ak-cert-formato + .ak-cert-formato { padding-top: var(--space-3); border-top: 1px dashed var(--rule); }
  .ak-cert-formato-head { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: center; }
  .ak-cert-formato-head div { display: grid; }
  .ak-cert-formato-head strong { color: var(--text); font-size: var(--step--1); }
  .ak-cert-formato-head span { color: var(--text-muted); font-size: var(--step--2); font-family: var(--font-mono); letter-spacing: .02em; }
  /* Pictograma del formato: hoja apaisada / hoja vertical */
  .ak-cert-formato-ic { display: block; border: 2px solid var(--text-2); border-radius: 3px; background: var(--surface); }
  .ak-cert-formato-ic--h { width: 30px; height: 21px; margin-block: 4px; }
  .ak-cert-formato-ic--v { width: 17px; height: 30px; margin-inline: 6px 7px; }
  .ak-cert-formato-ops { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
  .ak-cert-op {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface);
    color: var(--text); font-weight: var(--weight-black); font-size: var(--step--1); text-decoration: none;
  }
  .ak-cert-op:hover { border-color: var(--text); color: var(--text); background: var(--surface); }
  .ak-cert-op:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  .ak-cert-op .ak-icon { width: 18px; height: 18px; }
  .ak-cert-modal-titulo { font-size: var(--step-2); margin: 0 48px var(--space-4) 0; }
  .ak-cert-modal-content .ak-cert-op.dropdown-item { display: inline-flex; padding: 8px 12px; border-color: var(--border-strong); border-radius: var(--radius-pill); }
  .ak-cert-descarga-nota { margin: 0; font-size: var(--step--2); color: var(--text-muted); }
  .ak-cert-verif { justify-self: center; font-size: var(--step--1); }

  .ak-certs-vacio { max-width: 560px; margin-inline: auto; display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-7) var(--space-5); border-style: dashed; border-color: var(--border-strong); }
  .ak-certs-vacio h2 { font-size: var(--step-2); margin: 0; }
  .ak-certs-vacio p { margin: 0 0 var(--space-2); }
  .ak-certs-vacio-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
  .ak-certs-vacio-ic .ak-icon { width: 26px; height: 26px; }

  .ak-verif { display: grid; gap: var(--space-5); }
  .ak-verif-form { display: grid; gap: var(--space-2); }
  .ak-verif-form label { font-weight: var(--weight-black); color: var(--text); }
  .ak-verif-fila { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); }
  .ak-verif-fila input { width: 100%; min-height: 48px; font-family: var(--font-mono); font-size: var(--step-0); letter-spacing: .06em; text-transform: uppercase; }
  .ak-verif-fila input::placeholder { text-transform: none; letter-spacing: .06em; }
  .ak-verif-res { border-top: 4px solid var(--success); }
  .ak-verif-res.is-no-aprobado { border-top-color: var(--warning); }
  .ak-verif-res.is-no-encontrado { border-top-color: var(--danger); }
  .ak-verif-res-head { display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start; }
  .ak-verif-res-head h2 { margin: 2px 0 4px; font-size: var(--step-2); overflow-wrap: anywhere; }
  .ak-verif-res-head p { margin: 0; }
  .ak-verif-k { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--success); }
  .is-no-aprobado .ak-verif-k { color: var(--warning); }
  .is-no-encontrado .ak-verif-k { color: var(--danger); }
  .ak-verif-sello { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--success-bg); color: var(--success); }
  .is-no-aprobado .ak-verif-sello { background: var(--warning-bg); color: var(--warning); }
  .is-no-encontrado .ak-verif-sello { background: var(--danger-bg); color: var(--danger); }
  .ak-verif-sello .ak-icon { width: 26px; height: 26px; }
  .ak-verif-datos { margin: var(--space-5) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); }
  .ak-verif-datos div { display: grid; gap: 2px; padding-top: var(--space-2); border-top: 1px dashed var(--rule); }
  .ak-verif-datos dt { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
  .ak-verif-datos dd { margin: 0; color: var(--text); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
  @media (max-width: 600px) {
    .ak-verif-fila { grid-template-columns: 1fr; }
    .ak-verif-datos { grid-template-columns: 1fr; }
  }

  /* ---------------------------------------------------------------
     7. Responsive de academia
     --------------------------------------------------------------- */
  @media (max-width: 960px) {
    .ak-lesson-layout { grid-template-columns: 1fr; }
    .ak-lesson-aside { position: static; }
    .ak-dash-continue, .ak-dash-stats, .ak-dash-courses, .ak-dash-side { grid-column: 1 / -1; }
  }
  @media (max-width: 600px) {
    .ak-app .ak-page-head h1 { font-size: var(--step-4); }
    .ak-cert-callout { grid-template-columns: auto 1fr; }
    .ak-cert-callout .ak-btn { grid-column: 1 / -1; }
    .ak-lesson-actions { grid-template-columns: 1fr; }
    .ak-lesson-head h1 { font-size: var(--step-3); }
    .ak-dash-stats { grid-template-columns: 1fr; gap: var(--space-2); }
    .ak-dash-stats .ak-stat { flex-direction: row; align-items: center; }
    .ak-dash-continue .ak-resume-progress { grid-template-columns: 1fr; }
    .ak-dc-list li { grid-template-columns: 2.4em 1fr; }
    .ak-dcl-prog { grid-column: 2; }
    .tarjeta-leccion { grid-template-columns: 2em minmax(0, 1fr); padding-inline: var(--space-4); }
    .tarjeta-leccion .estado { grid-column: 2; justify-self: start; }
    .ak-exam-expandable-content { padding: 10px; border-radius: var(--radius-md); }
    .ak-question-wrapper { padding: var(--space-4) 14px; }
    .ak-question-text { font-size: var(--step-0); margin-bottom: var(--space-3); }
    .ak-mc-container { gap: var(--space-2); }
    .ak-mc-option { padding: 10px 12px; font-size: var(--step--1); gap: 10px; }
    .ak-mc-option::before { width: 28px; height: 28px; }
    .ak-exam-nav .ak-btn-secondary, .ak-exam-nav .ak-btn-primary { flex: 1; }
    .ak-exam-nav { flex-wrap: nowrap; }
  }
}
