/* =========================================================================
   Centro de ayuda Tablia — layout, contenido y secciones
   Depende de los tokens de base.css.
   ========================================================================= */

/* ================================================================== HOME =====
   El buscador es el protagonista (estructura del prototipo Floot), alineado a
   la izquierda y al ancho de la columna de contenido.
   ========================================================================== */

.tkb-hero {
  padding: var(--s-16) 0 var(--s-12);
  border-bottom: 1px solid var(--line);
  /* `--hero-tint` y no `--brand-soft`: el degradado cubre toda la cabecera y
     necesita ser más tenue que un tono de insignia. */
  background: linear-gradient(180deg, var(--hero-tint) 0%, var(--paper) 100%);
}

.tkb-hero__title {
  max-width: 24ch;
  font-size: var(--fs-5xl);
}

.tkb-hero__lead {
  max-width: 56ch;
  margin-top: var(--s-4);
  color: var(--ink-muted);
  font-size: var(--fs-lg);
}

.tkb-hero__search {
  max-width: var(--prose);
  margin-top: var(--s-8);
}

.tkb-hero__popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}

.tkb-chip {
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.tkb-chip:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  text-decoration: none;
}

.tkb-chip[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 500;
}

/* Buscador grande: se ve como un input pero es un botón que abre la paleta */
.tkb-bigsearch {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink-faint);
  font: inherit;
  font-size: var(--fs-md);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tkb-bigsearch:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.tkb-bigsearch__icon {
  flex-shrink: 0;
  color: var(--brand);
}

.tkb-bigsearch__ph {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tkb-bigsearch kbd {
  flex-shrink: 0;
  padding: 2px var(--s-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  font-family: inherit;
  font-size: var(--fs-xs);
}

@media (max-width: 640px) {
  .tkb-hero {
    padding: var(--s-10) 0 var(--s-8);
  }

  .tkb-hero__title {
    font-size: var(--fs-3xl);
  }

  .tkb-bigsearch kbd {
    display: none;
  }
}

/* Contador de guías por sección en el home */
.tkb-catrow {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  color: inherit;
}

.tkb-catrow:first-of-type {
  border-top: 0;
}

.tkb-catrow:hover {
  text-decoration: none;
}

.tkb-catrow:hover .tkb-catrow__title {
  color: var(--brand-strong);
}

.tkb-catrow__title {
  font-weight: 500;
}

.tkb-catrow__count {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* ========================================================== DOCS LAYOUT =====
   3 columnas: sidebar de subsecciones / contenido / índice de la página.
   ========================================================================== */

.tkb-docs {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: var(--s-10);
  align-items: start;
  padding: var(--s-8) 0 var(--s-16);
}

.tkb-docs--wide {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.tkb-docs__main {
  min-width: 0;
  max-width: var(--prose);
}

/* --- sidebar (SECCIÓN → SUBSECCIÓN → CONTENIDO) --------------------------- */

.tkb-side {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  max-height: calc(100vh - var(--header-h) - var(--s-10));
  overflow-y: auto;
  padding-right: var(--s-2);
}

.tkb-side__label {
  margin-bottom: var(--s-3);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tkb-side__group {
  margin-bottom: var(--s-5);
}

.tkb-side__group-title {
  margin-bottom: var(--s-2);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.tkb-side__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  list-style: none;
}

.tkb-side__link {
  display: block;
  padding: var(--s-2) var(--s-3);
  border-left: 2px solid var(--line);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}

.tkb-side__link:hover {
  border-left-color: var(--line-strong);
  background: var(--surface-alt);
  color: var(--ink);
  text-decoration: none;
}

.tkb-side__link[aria-current='page'] {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 500;
}

/* Artículos `propuesto`: visibles pero atenuados y sin enlace activo */
.tkb-side__link--soon {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink-faint);
  cursor: default;
}

.tkb-side__link--soon:hover {
  border-left-color: var(--line);
  background: transparent;
  color: var(--ink-faint);
}

/* --- índice de la página (scroll-spy) ------------------------------------- */

.tkb-toc {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  max-height: calc(100vh - var(--header-h) - var(--s-10));
  overflow-y: auto;
  font-size: var(--fs-sm);
}

.tkb-toc__title {
  margin-bottom: var(--s-3);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tkb-toc__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  list-style: none;
}

.tkb-toc__link {
  display: block;
  padding: var(--s-1) var(--s-3);
  border-left: 2px solid var(--line);
  color: var(--ink-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tkb-toc__link--sub {
  padding-left: var(--s-6);
}

.tkb-toc__link:hover {
  border-left-color: var(--line-strong);
  color: var(--ink);
  text-decoration: none;
}

/* "Estás aquí": barra de marca, fondo suave y texto de marca. Los tres a la vez
   porque el borde de 2 px por sí solo se perdía en pantallas grandes. */
.tkb-toc__link.is-active {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 500;
}

.tkb-toc__aside {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

/* --- sidebar móvil: se colapsa en un <details> --------------------------- */

.tkb-side-mobile {
  display: none;
  margin-bottom: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tkb-side-mobile > summary {
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}

.tkb-side-mobile__body {
  padding: 0 var(--s-4) var(--s-4);
}

@media (max-width: 1180px) {
  .tkb-docs {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .tkb-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .tkb-docs {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tkb-side {
    display: none;
  }

  .tkb-side-mobile {
    display: block;
  }
}

/* ======================================================== ARTÍCULO ==========
   Cabecera, prerrequisitos, cuerpo (directivas) y pie.
   ========================================================================== */

.tkb-article__head {
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
}

.tkb-article__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--fs-4xl);
}

.tkb-article__summary {
  margin-top: var(--s-3);
  color: var(--ink-muted);
  font-size: var(--fs-lg);
}

.tkb-article__meta {
  margin-top: var(--s-4);
}

.tkb-article__cta {
  margin-top: var(--s-5);
}

@media (max-width: 640px) {
  .tkb-article__title {
    font-size: var(--fs-2xl);
  }
}

/* Antes de empezar */
.tkb-prereq {
  margin-top: var(--s-8);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tkb-prereq__title {
  margin-bottom: var(--s-3);
  font-size: var(--fs-md);
  font-weight: 500;
}

.tkb-prereq__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: 0;
  list-style: none;
}

.tkb-prereq__list li {
  display: flex;
  gap: var(--s-3);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-prereq__list li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
}

/* Video del artículo: franja colapsada que se expande al hacer clic */
.tkb-videostrip {
  margin-top: var(--s-8);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  overflow: hidden;
}

.tkb-videostrip > summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  cursor: pointer;
  list-style: none;
}

.tkb-videostrip > summary::-webkit-details-marker {
  display: none;
}

/* Solo el icono, sin círculo de fondo (igual que .tkb-card__icon). */
.tkb-videostrip__play {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--brand);
}

.tkb-videostrip__label {
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tkb-videostrip__title {
  font-weight: 500;
}

.tkb-videostrip__meta {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

.tkb-videostrip__body {
  padding: 0 var(--s-4) var(--s-4);
}

/* --- cuerpo (prosa) ------------------------------------------------------- */

.tkb-prose {
  margin-top: var(--s-8);
}

.tkb-prose > * + * {
  margin-top: var(--s-4);
}

/* Los bloques ricos pesan más que un párrafo: necesitan más aire alrededor.
   Sin esto, unos pasos justo debajo de un título quedaban pegados al título. */
.tkb-prose > .tkb-steps,
.tkb-prose > .tkb-callout,
.tkb-prose > .tkb-figure,
.tkb-prose > .tkb-deflist,
.tkb-prose > .tkb-video,
.tkb-prose > .tkb-video-card,
.tkb-prose > .tkb-faq,
.tkb-prose > .tkb-table-scroll,
.tkb-prose > table {
  margin-top: var(--s-6);
  margin-bottom: var(--s-6);
}

/* Tras un título el salto es mayor: el título ya introduce el bloque, pero su
   tamaño necesita separación para que no se lean como una sola pieza. */
.tkb-prose > h2 + .tkb-steps,
.tkb-prose > h3 + .tkb-steps,
.tkb-prose > h2 + .tkb-deflist,
.tkb-prose > h3 + .tkb-deflist,
.tkb-prose > h2 + .tkb-figure,
.tkb-prose > h3 + .tkb-figure,
.tkb-prose > h2 + .tkb-callout,
.tkb-prose > h3 + .tkb-callout {
  margin-top: var(--s-5);
}

/* El primer bloque del cuerpo no necesita margen superior. */
.tkb-prose > :first-child {
  margin-top: 0;
}

.tkb-prose h2 {
  margin-top: var(--s-10);
  font-size: var(--fs-2xl);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.tkb-prose h3 {
  margin-top: var(--s-8);
  font-size: var(--fs-lg);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.tkb-prose p,
.tkb-prose li {
  color: var(--ink-soft);
}

.tkb-prose strong {
  color: var(--ink);
  font-weight: 500;
}

.tkb-prose ul,
.tkb-prose ol {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-left: 1.35em;
}

.tkb-prose a:not(.tkb-term):not(.tkb-video-card) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
  text-underline-offset: 2px;
}

/* Tablas: contenedor con scroll propio para no desbordar el body */
.tkb-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.tkb-prose thead th {
  padding: var(--s-3);
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}

.tkb-prose tbody td {
  padding: var(--s-3);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}

.tkb-table-scroll {
  overflow-x: auto;
}

/* --------------------------------------------------- bloques de directivas */

/* callout */
.tkb-callout {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.tkb-callout__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.tkb-callout__body > * + * {
  margin-top: var(--s-2);
}

.tkb-callout__title {
  font-weight: 500;
}

.tkb-callout p {
  color: var(--ink-soft);
}

.tkb-callout--info {
  border-left-color: var(--accent-info);
  background: var(--accent-info-soft);
}

.tkb-callout--info .tkb-callout__icon,
.tkb-callout--info .tkb-callout__title {
  color: var(--accent-info);
}

.tkb-callout--tip {
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

.tkb-callout--tip .tkb-callout__icon,
.tkb-callout--tip .tkb-callout__title {
  color: var(--brand-strong);
}

.tkb-callout--warning {
  border-left-color: var(--accent-warning);
  background: var(--accent-warning-soft);
}

.tkb-callout--warning .tkb-callout__icon,
.tkb-callout--warning .tkb-callout__title {
  color: var(--accent-warning);
}

.tkb-callout--success {
  border-left-color: var(--accent-success);
  background: var(--accent-success-soft);
}

.tkb-callout--success .tkb-callout__icon,
.tkb-callout--success .tkb-callout__title {
  color: var(--accent-success);
}

/* steps: numeración por contador (lo único numerado junto a las lecciones) */
.tkb-steps {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tkb-step;
}

.tkb-step {
  position: relative;
  padding-left: calc(28px + var(--s-4));
  counter-increment: tkb-step;
}

.tkb-step::before {
  content: counter(tkb-step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* Conector vertical entre pasos */
.tkb-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: calc(-1 * var(--s-5));
  width: 1px;
  background: var(--line);
}

.tkb-step__title {
  font-weight: 500;
}

.tkb-step__body {
  margin-top: var(--s-1);
  color: var(--ink-soft);
}

.tkb-step__body > * + * {
  margin-top: var(--s-2);
}

.tkb-step__image {
  margin-top: var(--s-3);
}

/* marco de imagen: borde y radio, sin sombra ni marco de navegador falso */
.tkb-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  overflow: hidden;
}

.tkb-frame img {
  display: block;
  width: 100%;
}

/* Imagen ausente: se muestra el alt como texto (no un icono roto) */
.tkb-frame img:not([src]),
.tkb-frame img[src=''] {
  display: none;
}

.tkb-frame--interactive img {
  cursor: zoom-in;
}

.tkb-frame__zoom {
  position: absolute;
  right: var(--s-2);
  top: var(--s-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--ink-soft);
  cursor: pointer;
}

.tkb-frame__zoom svg {
  width: 18px;
  height: 18px;
}

.tkb-frame__zoom:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.tkb-frame__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: var(--s-5);
  color: var(--ink-faint);
  font-size: var(--fs-sm);
  text-align: center;
}

.tkb-figure {
  margin: 0;
}

.tkb-figure__caption {
  margin-top: var(--s-2);
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

/* marcadores numerados sobre la captura */
.tkb-annotation {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.tkb-annotation__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--surface);
  border-radius: var(--r-full);
  background: var(--brand);
  box-shadow: var(--shadow-md);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 500;
}

.tkb-annotation__label {
  max-width: 220px;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-xs);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.tkb-annotation:hover .tkb-annotation__label,
.tkb-annotation:focus-visible .tkb-annotation__label {
  opacity: 1;
  transform: translateX(0);
}

.tkb-annotation-legend {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-top: var(--s-3);
  padding-left: 1.5em;
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}

/* lightbox */
.tkb-lightbox {
  border: 0;
  padding: 0;
  max-width: 96vw;
  max-height: 92vh;
  background: transparent;
}

.tkb-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.tkb-lightbox img {
  display: block;
  max-width: 96vw;
  max-height: 92vh;
  border-radius: var(--r-lg);
}

.tkb-lightbox__close {
  position: absolute;
  right: var(--s-3);
  top: var(--s-3);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: var(--fs-lg);
  cursor: pointer;
}

/* lista de definiciones */
.tkb-deflist {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: 0;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.tkb-deflist__row + .tkb-deflist__row {
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}

.tkb-deflist__term {
  color: var(--ink);
  font-weight: 500;
}

.tkb-deflist__desc {
  margin: var(--s-1) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

/* nombre de botón/pestaña de la app */
.tkb-ui {
  display: inline-block;
  padding: 1px var(--s-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 0.92em;
  font-weight: 500;
  white-space: nowrap;
}

/* término de glosario con tooltip */
.tkb-term {
  position: relative;
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--brand);
  text-underline-offset: 3px;
  cursor: help;
}

.tkb-term:hover {
  color: var(--brand-strong);
}

.tkb-term__tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  width: max-content;
  max-width: 280px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--ink);
  box-shadow: var(--shadow-md);
  color: var(--paper);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
}

.tkb-term:hover .tkb-term__tip,
.tkb-term:focus-visible .tkb-term__tip {
  opacity: 1;
  visibility: visible;
}

/* video embebido y tarjeta placeholder */
.tkb-video {
  position: relative;
  border-radius: var(--r-xl);
  background: #000;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.tkb-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tkb-video-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: inherit;
}

.tkb-video-card:hover {
  border-color: var(--brand);
  text-decoration: none;
}

/* Solo el icono, sin recuadro verde. */
.tkb-video-card__thumb {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--brand);
}

.tkb-video-card__thumb svg {
  width: 20px;
  height: 20px;
}

.tkb-video-card__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tkb-video-card__title {
  font-weight: 500;
}

.tkb-video-card__meta {
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

/* acordeón de preguntas */
.tkb-faq {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  overflow: hidden;
}

.tkb-faq__item + .tkb-faq__item {
  border-top: 1px solid var(--line);
}

.tkb-faq__question {
  padding: var(--s-4);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}

.tkb-faq__question::marker,
.tkb-faq__question::-webkit-details-marker {
  color: var(--brand);
}

.tkb-faq__answer {
  padding: 0 var(--s-4) var(--s-4);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

/* Contenedor de una directiva desconocida: no debe verse como bloque roto */
.tkb-unknown-directive {
  display: contents;
}

/* --- pie del artículo ---------------------------------------------------- */

.tkb-article__foot {
  margin-top: var(--s-12);
  padding-top: var(--s-8);
  border-top: 1px solid var(--line);
}

.tkb-article__foot > * + * {
  margin-top: var(--s-8);
}

.tkb-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tkb-feedback__q {
  font-weight: 500;
}

.tkb-feedback__actions {
  display: flex;
  gap: var(--s-2);
  margin-left: auto;
}

.tkb-feedback__thanks {
  color: var(--brand-strong);
  font-size: var(--fs-sm);
}

.tkb-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.tkb-prevnext__link {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: inherit;
}

.tkb-prevnext__link:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.tkb-prevnext__link--next {
  text-align: right;
}

.tkb-prevnext__label {
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tkb-prevnext__title {
  font-weight: 500;
}

@media (max-width: 640px) {
  .tkb-prevnext {
    grid-template-columns: 1fr;
  }

  .tkb-prevnext__link--next {
    text-align: left;
  }
}

/* ========================================================== ACADEMY =========
   El progreso usa el lenguaje del panel de conciliación: Visto / Total / Por ver.
   ========================================================================== */

.tkb-cuadre {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  font-size: var(--fs-sm);
}

.tkb-cuadre__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-1) 0;
  color: var(--ink-muted);
}

.tkb-cuadre__row--total {
  color: var(--ink-soft);
}

.tkb-cuadre__row--rest {
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
  color: var(--accent-warning);
  font-weight: 500;
}

.tkb-cuadre__row--rest[data-done='true'] {
  color: var(--brand-strong);
}

.tkb-cuadre__bar {
  height: 4px;
  margin-top: var(--s-3);
  border-radius: var(--r-full);
  background: var(--surface-alt);
  overflow: hidden;
}

.tkb-cuadre__fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand);
  transition: width 0.3s ease;
}

.tkb-pathcard {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: inherit;
}

.tkb-pathcard:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.tkb-pathcard__title {
  font-size: var(--fs-lg);
  font-weight: 500;
}

.tkb-videocard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: inherit;
  overflow: hidden;
}

.tkb-videocard:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.tkb-videocard__thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--brand-strong);
}

/* Absoluta para que el boton de play quede encima y centrado. */
.tkb-videocard__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* El play sobre la imagen: blanco con sombra, porque el fondo es una captura. */
.tkb-videocard__thumb:not([data-placeholder]) svg {
  position: relative;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.55));
}

.tkb-videocard__duration {
  position: absolute;
  right: var(--s-2);
  bottom: var(--s-2);
  padding: 1px var(--s-2);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: var(--fs-xs);
}

.tkb-videocard__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding: var(--s-4);
}

.tkb-videocard__title {
  font-weight: 500;
}

.tkb-lessons {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  list-style: none;
  overflow: hidden;
  counter-reset: tkb-lesson;
}

.tkb-lessons li {
  counter-increment: tkb-lesson;
}

.tkb-lessons li + li {
  border-top: 1px solid var(--line);
}

.tkb-lesson {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  color: inherit;
}

.tkb-lesson:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.tkb-lesson::before {
  content: counter(tkb-lesson);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  color: var(--ink-muted);
  font-size: var(--fs-xs);
}

.tkb-lesson[data-state='watched']::before {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tkb-lesson[data-state='current']::before {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tkb-lesson__title {
  font-weight: 500;
}

.tkb-lesson__meta {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

/* Reproductor: 2 columnas */
.tkb-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--s-8);
  align-items: start;
  padding: var(--s-8) 0 var(--s-16);
}

.tkb-player__aside {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

.tkb-panel {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tkb-panel__title {
  margin-bottom: var(--s-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.tkb-chapters {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}

.tkb-chapters a {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-2);
  border-radius: var(--r-md);
  color: var(--ink-soft);
}

.tkb-chapters a:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.tkb-chapters__time {
  flex-shrink: 0;
  color: var(--ink-faint);
}

.tkb-transcript {
  margin-top: var(--s-8);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tkb-transcript > summary {
  padding: var(--s-4);
  font-weight: 500;
  cursor: pointer;
}

.tkb-transcript__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: 0 var(--s-4) var(--s-4);
  font-size: var(--fs-sm);
}

.tkb-transcript__line {
  display: flex;
  gap: var(--s-3);
  color: var(--ink-soft);
}

.tkb-transcript__time {
  flex-shrink: 0;
  color: var(--ink-faint);
}

@media (max-width: 1080px) {
  .tkb-player {
    grid-template-columns: 1fr;
  }

  .tkb-player__aside {
    position: static;
  }
}

/* Aviso de video en producción */
.tkb-videoplaceholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--surface-alt);
  color: var(--ink-muted);
  text-align: center;
}

.tkb-videoplaceholder svg {
  width: 32px;
  height: 32px;
  color: var(--ink-faint);
}

/* ========================================================== GLOSARIO ========= */

.tkb-azbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  padding: var(--s-3) 0;
}

.tkb-azbar a,
.tkb-azbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 var(--s-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.tkb-azbar a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
  text-decoration: none;
}

.tkb-azbar span {
  color: var(--ink-faint);
  opacity: 0.55;
}

.tkb-azgroup {
  margin-top: var(--s-8);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.tkb-azgroup__letter {
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  color: var(--brand-strong);
  font-size: var(--fs-xl);
}

.tkb-termrow__term {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  font-weight: 500;
}

.tkb-termrow__expanded {
  color: var(--ink-faint);
  font-size: var(--fs-sm);
  font-weight: 400;
}

/* Buscador local del glosario */
.tkb-filter {
  width: 100%;
  max-width: 420px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
}

.tkb-filter:focus-visible {
  border-color: var(--brand);
}

/* ======================================================== BÚSQUEDA ========== */

.tkb-dialog {
  width: min(640px, 94vw);
  max-height: 80vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  overflow: hidden;
}

.tkb-dialog::backdrop {
  background: rgba(10, 13, 18, 0.45);
  backdrop-filter: blur(2px);
}

.tkb-dialog__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--line);
}

.tkb-dialog__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-lg);
}

.tkb-dialog__input:focus {
  outline: 0;
}

.tkb-dialog__close {
  padding: var(--s-1) var(--s-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  color: var(--ink-muted);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.tkb-dialog__body {
  max-height: calc(80vh - 72px);
  overflow-y: auto;
  padding: var(--s-3);
}

.tkb-results__group + .tkb-results__group {
  margin-top: var(--s-4);
}

.tkb-results__label {
  padding: 0 var(--s-2) var(--s-2);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sirve para <a> y para <button>: las sugerencias son botones, así que hay que
   neutralizar los estilos nativos (borde, fondo y tipografía propios). */
.tkb-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--s-3);
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tkb-result:hover,
.tkb-result.is-active {
  background: var(--surface-alt);
  text-decoration: none;
}

.tkb-result:hover .tkb-result__title,
.tkb-result.is-active .tkb-result__title {
  color: var(--brand-strong);
}

/* Sugerencia (búsqueda frecuente o reciente): una sola línea con lupa delante.
   Se distingue de un resultado, que apila título y extracto. */
.tkb-result--suggest {
  flex-direction: row;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink-soft);
}

.tkb-result--suggest::before {
  content: '';
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  background: var(--ink-faint);
  -webkit-mask: var(--tkb-icon-search) center / contain no-repeat;
  mask: var(--tkb-icon-search) center / contain no-repeat;
}

.tkb-result--suggest:hover::before {
  background: var(--brand);
}

.tkb-result__title {
  font-weight: 500;
}

.tkb-result__text {
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}

.tkb-result mark {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tkb-dialog__hint {
  padding: var(--s-3);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  border-top: 1px solid var(--line);
}

/* ==================================================== CÓMO FUNCIONA ========= */

.tkb-tourstep {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--s-8);
  align-items: center;
  padding: var(--s-12) 0;
  border-top: 1px solid var(--line);
}

.tkb-tourstep:nth-child(even) .tkb-tourstep__media {
  order: -1;
}

.tkb-tourstep__title {
  font-size: var(--fs-2xl);
}

.tkb-tourstep__body {
  margin-top: var(--s-3);
  color: var(--ink-soft);
}

.tkb-tourstep__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-5);
}

@media (max-width: 900px) {
  .tkb-tourstep {
    grid-template-columns: 1fr;
    gap: var(--s-6);
    padding: var(--s-8) 0;
  }

  .tkb-tourstep:nth-child(even) .tkb-tourstep__media {
    order: 0;
  }
}

/* ========================================================= SOPORTE ========== */

.tkb-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
}

.tkb-faqgroup + .tkb-faqgroup {
  margin-top: var(--s-8);
}

.tkb-faqgroup__title {
  margin-bottom: var(--s-3);
  font-size: var(--fs-lg);
}

/* ================================================== MOVIMIENTO REDUCIDO ===== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------- academia: formularios */

/* El sitio no tenía formularios. Mismo patrón que el panel: los controles se
   estilizan por selector de elemento dentro de `.tkb-field`, así un campo nuevo
   hereda el aspecto sin tocar el CSS. */

.tkb-auth {
  max-width: 26rem;
  margin: var(--s-10) auto;
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.tkb-auth__title {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-xl);
}

.tkb-auth__hint {
  margin: 0 0 var(--s-5);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-auth__msg {
  margin-bottom: var(--s-4);
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-auth__msg--error {
  background: color-mix(in srgb, var(--accent-danger) 12%, transparent);
  color: var(--accent-danger);
}

.tkb-auth__msg--ok {
  background: color-mix(in srgb, var(--accent-success) 14%, transparent);
  color: var(--ink);
}

.tkb-auth__foot {
  margin: var(--s-5) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  text-align: center;
}

/* El botón que cierra el formulario, a todo el ancho. Solo los hijos directos:
   los del pie —"mandar otro código"— son secundarios y no deben competir. */
.tkb-auth > button[type='submit'] {
  width: 100%;
}

.tkb-field {
  display: block;
  margin-bottom: var(--s-4);
}

.tkb-field__label {
  display: block;
  margin-bottom: var(--s-1);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.tkb-field__help {
  display: block;
  margin-top: var(--s-1);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
}

.tkb-field__error {
  display: block;
  margin-top: var(--s-1);
  color: var(--accent-danger);
  font-size: var(--fs-xs);
}

.tkb-field input[type='text'],
.tkb-field input[type='email'],
.tkb-field input[type='password'],
.tkb-field input[type='url'],
.tkb-field input[type='tel'],
.tkb-field select,
.tkb-field textarea {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
}

.tkb-field textarea {
  min-height: 7rem;
  resize: vertical;
}

/* El código de verificación: seis dígitos que se leen de un correo. */
.tkb-field input[inputmode='numeric'] {
  letter-spacing: 0.3em;
  text-align: center;
  font-size: var(--fs-lg);
}

/* ------------------------------------------------- academia: perfil */

/* Columna centrada para las páginas de una sola cosa. Sin el margen automático el
   contenido se queda a la izquierda del contenedor, que en pantalla ancha se lee
   como descuadrado. */
.tkb-column {
  max-width: 44rem;
  margin-inline: auto;
}

/* La tarjeta del perfil público: es para leer, no para rellenar, y aguanta más. */
.tkb-column--wide {
  max-width: 52rem;
}

.tkb-profile__head {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

/* La foto, o el hueco. Las dos miden lo mismo para que rellenarla no mueva nada. */
.tkb-avatar {
  flex: 0 0 auto;
  width: 6rem;
  height: 6rem;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  object-fit: cover;
}

.tkb-avatar--vacio {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.tkb-avatar--vacio svg {
  width: 60%;
  height: 60%;
}

/* La tarjeta del perfil público. La franja de color es el patrón que se reconoce
   como "perfil"; el avatar se monta encima con un aro del color de la tarjeta. */
.tkb-member {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tkb-member__band {
  height: 6rem;
  background: var(--brand-soft);
}

.tkb-member__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 0 var(--s-6) var(--s-6);
}

.tkb-member__who {
  min-width: 0;
}

.tkb-member .tkb-avatar {
  width: 9rem;
  height: 9rem;
  /* La mitad del alto: el centro del círculo queda en el borde de la franja. */
  margin-top: -4.5rem;
  margin-bottom: var(--s-3);
  border: 4px solid var(--surface);
}

.tkb-member__name {
  margin: 0;
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

.tkb-member__headline {
  margin: var(--s-1) 0 0;
  color: var(--ink-soft);
}

.tkb-member__meta {
  margin: var(--s-3) 0 0;
}

.tkb-member__links {
  display: flex;
  gap: var(--s-2);
}

.tkb-member__section {
  padding: var(--s-6);
  border-top: 1px solid var(--line);
}

.tkb-member__label {
  margin: 0 0 var(--s-3);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tkb-member__section .tkb-prose > :last-child {
  margin-bottom: 0;
}

/* Los botones de icono con texto oculto: el icono no lleva alt. */
.tkb-member__links svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------- academia: insignias */

.tkb-insignias {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: var(--s-8) var(--s-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tkb-insignia {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* El ancla de "copiar enlace" no debe quedar bajo el header fijo. */
  scroll-margin-top: 6rem;
}

/* La insignia en sí: una ficha clara con la franja de color abajo. La franja
   cambia con el nivel, que es lo que distingue una de otra de un vistazo. */
.tkb-insignia__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  aspect-ratio: 3 / 2;
  justify-content: center;
  padding: var(--s-4) var(--s-4) calc(var(--s-4) + 4px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    linear-gradient(var(--franja), var(--franja)) bottom / 100% 4px no-repeat,
    var(--surface);
  --franja: var(--brand);
}

.tkb-insignia__card--intermedio {
  --franja: var(--accent-info);
}

.tkb-insignia__card--avanzado {
  --franja: var(--accent-warning);
}

.tkb-insignia__marca {
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.tkb-insignia__marca span {
  color: var(--ink-soft);
  font-weight: 500;
}

.tkb-insignia__titulo {
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.25;
}

.tkb-insignia__area {
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
}

.tkb-insignia__nivel {
  color: var(--ink-faint);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tkb-insignia__nombre {
  margin: var(--s-4) 0 0;
  font-size: var(--fs-md);
  font-weight: 500;
}

.tkb-insignia__fecha {
  margin: var(--s-1) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-insignia__acciones {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin-top: var(--s-3);
}

.tkb-insignia__acciones svg {
  width: 18px;
  height: 18px;
}

.tkb-profile__name {
  margin: 0;
  font-size: var(--fs-2xl);
}

.tkb-profile__headline {
  margin: var(--s-1) 0 0;
  color: var(--ink-soft);
}

.tkb-profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}

/* ------------------------------------------------- academy: área de cursos */

/* El header de la Academy: otro sitio, con su propia navegación. Misma altura y
   el mismo vidrio que el del centro de ayuda, para que no se sienta ajeno. */
.tkb-acheader {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
}

.tkb-acheader__inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  height: var(--header-h);
}

.tkb-acheader__logo {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--ink);
  text-decoration: none;
}

.tkb-acheader__marca {
  padding-left: var(--s-2);
  border-left: 1px solid var(--line-strong);
  color: var(--brand);
  font-weight: 600;
}

.tkb-acheader__acciones {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-left: auto;
}

.tkb-acheader__grupo {
  display: flex;
  gap: var(--s-2);
}

.tkb-acheader__correo {
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

@media (max-width: 720px) {
  .tkb-acheader__correo {
    display: none;
  }

  .tkb-acheader__inner {
    gap: var(--s-3);
  }
}

.tkb-acfooter {
  margin-top: var(--s-16);
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

.tkb-acfooter__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-6) 0;
}

.tkb-acfooter__links {
  display: flex;
  gap: var(--s-5);
}

.tkb-acfooter__links a {
  color: var(--ink-soft);
}

/* Los botones que dependen de la sesión los elige un atributo que pone el
   head antes del pintado, así no parpadean. */

[data-con-sesion] {
  display: none;
}

[data-academy-sesion] [data-con-sesion] {
  display: flex;
}

[data-academy-sesion] [data-sin-sesion] {
  display: none;
}

.tkb-accta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-10);
  padding: var(--s-6);
}

.tkb-accta__texto {
  max-width: 62ch;
}

.tkb-accta__nota {
  margin: var(--s-3) 0 0;
  color: var(--ink-faint);
  font-size: var(--fs-xs);
}

/* La tarjeta de curso: el nivel arriba y la duración al pie. */
.tkb-coursecard {
  color: inherit;
  text-decoration: none;
}

.tkb-coursecard .tkb-badge {
  align-self: flex-start;
}

.tkb-coursecard__meta {
  margin-top: auto;
  padding-top: var(--s-2);
}

/* El detalle del curso, con la estructura de Google Skills. */

/* La banda: oscura, con el verde de la marca como acento. */
.tkb-cursohero {
  --cursohero-bg: #0f2a1a;
  --cursohero-chip: rgba(255, 255, 255, 0.1);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-6);
  margin: var(--s-4) 0 var(--s-6);
  padding: var(--s-8);
  border-radius: 24px;
  background: var(--cursohero-bg);
  color: #fff;
  overflow: hidden;
}

[data-theme='dark'] .tkb-cursohero {
  --cursohero-bg: #13321f;
  border: 1px solid var(--line);
}

.tkb-cursohero__texto {
  min-width: 0;
}

.tkb-cursohero__tipo {
  display: inline-block;
  padding: 2px var(--s-2);
  border-radius: var(--r-full);
  background: var(--cursohero-chip, var(--brand-soft));
  font-size: var(--fs-xs);
  font-weight: 500;
}

.tkb-cursohero__titulo {
  margin: var(--s-3) 0 var(--s-4);
  color: #fff;
  font-size: var(--fs-3xl);
  line-height: 1.15;
}

.tkb-cursohero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0 0 var(--s-6);
  padding: 0;
  list-style: none;
}

.tkb-cursohero__chips li {
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-md);
  background: var(--cursohero-chip);
  font-size: var(--fs-sm);
}

.tkb-cursohero__cta {
  border-radius: var(--r-full);
  background: #fff;
  color: #0f2a1a;
}

.tkb-cursohero__cta:hover {
  background: var(--brand-soft);
  color: #0f2a1a;
}

/* Cuatro círculos en trébol, como la forma de Google, con verdes de la marca. */
.tkb-cursohero__forma {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 3.75rem);
  gap: 0;
  opacity: 0.9;
}

.tkb-cursohero__forma span {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: var(--r-full);
  background: #4caf50;
}

.tkb-cursohero__forma span:nth-child(2),
.tkb-cursohero__forma span:nth-child(3) {
  background: #7fcf86;
}

@media (max-width: 720px) {
  .tkb-cursohero {
    padding: var(--s-6);
  }

  .tkb-cursohero__forma {
    display: none;
  }
}

.tkb-cursoindice {
  max-width: 26rem;
}

.tkb-cursodesc {
  max-width: 70ch;
}

/* El aviso de la evaluación, en el verde de la marca. */
.tkb-cursoreto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin: var(--s-8) 0;
  padding: var(--s-5) var(--s-6);
  border-radius: var(--r-xl);
  background: var(--brand);
  color: #fff;
}

.tkb-cursoreto__tipo {
  background: rgba(255, 255, 255, 0.18);
}

.tkb-cursoreto__titulo {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.35;
}

.tkb-cursoreto__cta {
  border-radius: var(--r-full);
  background: #fff;
  color: var(--brand-strong);
}

.tkb-cursoreto__cta:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

/* Cuadrícula o lista. */
.tkb-cursovista {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-1);
  margin-bottom: var(--s-4);
}

.tkb-cursovista__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.tkb-cursovista__btn svg {
  width: 16px;
  height: 16px;
}

.tkb-cursovista__btn[aria-pressed='true'] {
  background: var(--brand-strong);
  color: #fff;
}

/* Las actividades: lecciones, evaluación e insignia. */
.tkb-actividades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tkb-actividad {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  height: 100%;
  min-height: 13rem;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

a.tkb-actividad:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.tkb-actividad__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-1);
}

.tkb-actividad__chip {
  padding: 2px var(--s-2);
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.tkb-actividad__chip--requerida {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tkb-actividad__titulo {
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.3;
}

.tkb-actividad__texto {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-actividad__pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--s-3);
}

.tkb-actividad__dur {
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

.tkb-actividad__flecha {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tkb-actividad__flecha svg {
  width: 18px;
  height: 18px;
}

/* La insignia, centrada como en la referencia. */
.tkb-actividad--insignia {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tkb-actividad__medalla {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: var(--s-2);
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  color: var(--ink-soft);
}

.tkb-actividad__medalla svg {
  width: 2.25rem;
  height: 2.25rem;
}

.tkb-actividad--insignia .tkb-btn {
  margin-top: var(--s-3);
  border-radius: var(--r-full);
}

/* En lista: una fila por actividad, sin la altura mínima de la tarjeta. */
.tkb-actividades--lista {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2);
}

.tkb-actividades--lista .tkb-actividad {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-1) var(--s-4);
  min-height: 0;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-xl);
}

.tkb-actividades--lista .tkb-actividad__chips {
  grid-row: span 2;
  margin: 0;
}

.tkb-actividades--lista .tkb-actividad__pie {
  grid-column: 3;
  grid-row: 1 / span 2;
  gap: var(--s-4);
  margin: 0;
  padding: 0;
}

.tkb-actividades--lista .tkb-actividad--insignia {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  text-align: left;
}

.tkb-actividades--lista .tkb-actividad__medalla {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
}

.tkb-actividades--lista .tkb-actividad__medalla svg {
  width: 1.5rem;
  height: 1.5rem;
}

.tkb-actividades--lista .tkb-actividad--insignia .tkb-btn {
  margin: 0 0 0 auto;
}

@media (max-width: 640px) {
  .tkb-actividades--lista .tkb-actividad {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .tkb-actividades--lista .tkb-actividad__chips {
    grid-row: auto;
  }

  .tkb-actividades--lista .tkb-actividad__pie {
    grid-column: 2;
  }
}

/* La lección: una sola columna centrada, con el contenido y la navegación. */
.tkb-leccion {
  max-width: 46rem;
  margin-inline: auto;
}

.tkb-leccion__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

/* Aviso de los cursos de ejemplo de la PoC. */
.tkb-acdemo {
  margin: 0 0 var(--s-5);
  padding: var(--s-2) var(--s-3);
  border: 1px solid color-mix(in srgb, var(--accent-warning) 35%, transparent);
  border-radius: var(--r-md);
  background: var(--accent-warning-soft);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

/* ------------------------------------------------- academy: quiz */

.tkb-quiz {
  max-width: 46rem;
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tkb-quiz--portada {
  text-align: center;
}

.tkb-quiz__titular {
  margin: 0 0 var(--s-3);
  font-size: var(--fs-2xl);
}

.tkb-quiz__titular:focus,
.tkb-quiz__enunciado:focus {
  outline: none;
}

.tkb-quiz__datos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2) var(--s-5);
  margin: 0 0 var(--s-6);
  padding: 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  list-style: none;
}

.tkb-quiz__progreso {
  display: grid;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}

.tkb-quiz__contador {
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

/* El <progress> nativo, con el color de la marca. */
.tkb-quiz__barra {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  appearance: none;
  overflow: hidden;
}

.tkb-quiz__barra::-webkit-progress-bar {
  background: var(--surface-sunken);
}

.tkb-quiz__barra::-webkit-progress-value {
  background: var(--brand);
  transition: width 0.2s;
}

.tkb-quiz__barra::-moz-progress-bar {
  background: var(--brand);
}

.tkb-quiz__pregunta {
  margin: 0;
  padding: 0;
  border: 0;
}

.tkb-quiz__enunciado {
  margin-bottom: var(--s-4);
  padding: 0;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.35;
}

.tkb-quiz__indicacion {
  margin: calc(-1 * var(--s-2)) 0 var(--s-4);
  color: var(--ink-faint);
  font-size: var(--fs-sm);
}

.tkb-quiz__opciones {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Cada opción es una tarjeta entera clicable, con el input real dentro. */
.tkb-quiz__opcion {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tkb-quiz__opcion:hover {
  border-color: var(--brand);
}

/* El input se oculta a la vista pero no al teclado ni al lector de pantalla. */
.tkb-quiz__opcion input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.tkb-quiz__opcion:has(input:focus-visible) {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

.tkb-quiz__letra {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.tkb-quiz__opcion--marcada {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tkb-quiz__opcion--marcada .tkb-quiz__letra {
  background: var(--brand);
  color: #fff;
}

.tkb-quiz__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

/* El progreso se queda arriba mientras se baja por las preguntas. */
.tkb-quiz__inicio {
  position: sticky;
  top: var(--header-h);
  z-index: 1;
  margin: calc(-1 * var(--s-6)) calc(-1 * var(--s-6)) 0;
  padding: var(--s-4) var(--s-6) var(--s-2);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
}

.tkb-quiz__inicio:focus {
  outline: none;
}

.tkb-quiz__inicio .tkb-quiz__progreso {
  margin-bottom: 0;
}

/* Todas las preguntas, una debajo de otra. */
.tkb-quiz__lista {
  display: grid;
  gap: var(--s-8);
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
}

.tkb-quiz__lista > li + li {
  padding-top: var(--s-8);
  border-top: 1px solid var(--line);
}

.tkb-quiz__numero {
  color: var(--ink-faint);
}

/* La que quedó sin responder al intentar terminar. */
.tkb-quiz__pregunta--falta {
  margin-left: calc(-1 * var(--s-4));
  padding-left: calc(var(--s-4) - 3px);
  border-left: 3px solid var(--accent-danger);
}

.tkb-quiz__falta {
  margin: calc(-1 * var(--s-2)) 0 var(--s-4);
  color: var(--accent-danger);
  font-size: var(--fs-sm);
}

.tkb-quiz__acciones--final {
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s-2);
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

.tkb-quiz__aviso {
  margin: 0;
  color: var(--accent-danger);
  font-size: var(--fs-sm);
}

.tkb-quiz__aviso:empty {
  display: none;
}

.tkb-quiz__repaso-explicacion {
  margin: var(--s-2) 0 0;
  padding-left: var(--s-3);
  border-left: 2px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

/* El resultado. */
.tkb-quiz__nota {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 8rem;
  height: 8rem;
  margin: 0 auto var(--s-5);
  border: 6px solid var(--accent-danger-soft);
  border-radius: var(--r-full);
}

.tkb-quiz__nota--aprobado {
  border-color: var(--brand-soft);
}

.tkb-quiz__porcentaje {
  font-size: var(--fs-3xl);
  font-weight: 600;
  line-height: 1;
}

.tkb-quiz__aciertos {
  margin-top: var(--s-1);
  color: var(--ink-faint);
  font-size: var(--fs-xs);
}

.tkb-quiz__resultado > .tkb-quiz__titular,
.tkb-quiz__resultado > .tkb-card__text {
  text-align: center;
}

.tkb-quiz__repaso {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-6) 0 0;
  padding: var(--s-5) 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.tkb-quiz__repaso li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
}

.tkb-quiz__marca {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--r-full);
}

.tkb-quiz__marca svg {
  width: 14px;
  height: 14px;
}

.tkb-quiz__repaso--bien .tkb-quiz__marca {
  background: color-mix(in srgb, var(--accent-success) 14%, transparent);
  color: var(--accent-success);
}

.tkb-quiz__repaso--mal .tkb-quiz__marca {
  background: var(--accent-danger-soft);
  color: var(--accent-danger);
}

.tkb-quiz__repaso-pregunta {
  margin: 0;
}

.tkb-quiz__repaso-detalle {
  margin: var(--s-1) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-quiz__resultado .tkb-quiz__acciones {
  justify-content: center;
}

/* El video de una lección, y su hueco cuando el video no está todavía. */
.tkb-leccion__video {
  margin: var(--s-5) 0 var(--s-6);
}

.tkb-video--hueco {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  background: var(--surface-sunken);
  color: var(--ink-faint);
}

.tkb-video--hueco svg {
  width: 3rem;
  height: 3rem;
}

.tkb-video__hueco-titulo {
  color: var(--ink-soft);
  font-weight: 500;
}

.tkb-video__hueco-nota {
  font-size: var(--fs-sm);
}

/* La tarjeta de ruta: como la de curso, con los cursos que la forman. */
.tkb-trackcard__chips {
  display: flex;
  gap: var(--s-2);
}

.tkb-trackcard__cursos {
  margin: var(--s-2) 0 0;
  padding-left: var(--s-5);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-trackcard__cursos li + li {
  margin-top: var(--s-1);
}

/* "Forma parte de", en el detalle de un curso. */
.tkb-cursorutas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-5) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

.tkb-cursorutas a {
  text-decoration: none;
}

/* ------------------------------------------------- academy: barra lateral */

/* El área privada: barra lateral fija y el contenido a la derecha. */
.tkb-acshell {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.tkb-acshell__main {
  min-width: 0;
}

.tkb-acrail {
  position: sticky;
  top: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - var(--header-h));
  padding: var(--s-5) 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.tkb-acrail__lista {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Icono arriba y etiqueta abajo; el activo lleva la píldora detrás del icono. */
.tkb-acrail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--fs-xs);
  text-decoration: none;
  cursor: pointer;
}

.tkb-acrail__icono {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 2rem;
  border-radius: var(--r-full);
  transition: background 0.15s;
}

.tkb-acrail__icono svg {
  width: 22px;
  height: 22px;
}

.tkb-acrail__label {
  line-height: 1.2;
  text-align: center;
}

.tkb-acrail__item:hover .tkb-acrail__icono {
  background: var(--surface-sunken);
}

.tkb-acrail__item:focus-visible {
  outline: none;
}

.tkb-acrail__item:focus-visible .tkb-acrail__icono {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

.tkb-acrail__item[aria-current='page'] {
  color: var(--brand-strong);
  font-weight: 500;
}

.tkb-acrail__item[aria-current='page'] .tkb-acrail__icono {
  background: var(--brand-soft);
}

/* En móvil, barra de pestañas fija abajo. */
@media (max-width: 720px) {
  .tkb-acshell {
    grid-template-columns: minmax(0, 1fr);
  }

  .tkb-acshell__main {
    /* Que la barra no tape el final de la página. */
    padding-bottom: 4.5rem;
  }

  .tkb-acrail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    flex-direction: row;
    height: auto;
    padding: var(--s-2) var(--s-2) calc(var(--s-2) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .tkb-acrail__lista {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
  }

  .tkb-acrail__lista li {
    flex: 1;
  }

  .tkb-acrail__salir {
    width: auto;
    min-width: 4rem;
  }
}

/* La cuenta en el header del área privada: foto a la izquierda del correo. */
.tkb-acheader__cuenta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3) var(--s-1) var(--s-1);
  border-radius: var(--r-full);
  color: inherit;
  text-decoration: none;
}

.tkb-acheader__cuenta:hover {
  background: var(--surface-sunken);
}

.tkb-acheader__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-full);
  background: var(--surface-sunken);
  color: var(--ink-faint);
  overflow: hidden;
}

.tkb-acheader__avatar svg {
  width: 60%;
  height: 60%;
}

.tkb-acheader__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Con foto, la silueta sobra. */
.tkb-acheader__avatar--foto svg {
  display: none;
}

@media (max-width: 720px) {
  .tkb-acheader__cuenta {
    padding: var(--s-1);
  }
}

/* ------------------------------------------------- academy: progreso */

/* La tarjeta de una ruta en curso: tipo, título, descripción y la barra. */
.tkb-progreso {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: 22rem;
  min-height: 17rem;
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tkb-progreso:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  /* La regla global subraya todo enlace al pasar el ratón; en una tarjeta entera
     subrayaría el título y la descripción. */
  text-decoration: none;
}

.tkb-progreso__tipo {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-3);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: var(--fs-sm);
}

.tkb-progreso__tipo svg {
  width: 14px;
  height: 14px;
}

.tkb-progreso__titulo {
  margin-top: var(--s-2);
  font-size: var(--fs-2xl);
  line-height: 1.2;
}

/* Tres líneas como mucho: la tarjeta no crece con la descripción. */
.tkb-progreso__texto {
  display: -webkit-box;
  color: var(--ink-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.tkb-progreso__barra {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: auto;
  padding-top: var(--s-4);
}

.tkb-progreso__barra progress {
  flex: 1;
  height: 10px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  appearance: none;
  overflow: hidden;
}

.tkb-progreso__barra progress::-webkit-progress-bar {
  background: var(--brand-soft);
}

.tkb-progreso__barra progress::-webkit-progress-value {
  border-radius: var(--r-full);
  background: var(--brand);
}

.tkb-progreso__barra progress::-moz-progress-bar {
  border-radius: var(--r-full);
  background: var(--brand);
}

.tkb-progreso__cifra {
  color: var(--ink-soft);
}

/* ------------------------------------------------- academy: landing */

/* Todo con los tokens del sitio: Aeonik, el verde de la marca y el tema oscuro.
   Los verdes "vivos" de la decoración son variantes fijas del de la marca. */
.tkb-lp {
  --lp-verde-claro: #7fcf86;
  --lp-verde-medio: #4caf50;
  --lp-verde-oscuro: #0f2a1a;
  overflow-x: clip;
}

[data-theme='dark'] .tkb-lp {
  --lp-verde-oscuro: #13321f;
}

.tkb-lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--brand-strong);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tkb-lp-eyebrow__punto {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--r-full);
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.tkb-lp-titulo {
  margin: var(--s-2) 0 0;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.tkb-lp-btn {
  border-radius: var(--r-full);
}

.tkb-lp-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.tkb-lp-acciones--centro {
  justify-content: center;
}

.tkb-lp-seccion {
  padding: clamp(var(--s-12), 8vw, 7rem) 0 0;
}

.tkb-lp-cabeza {
  max-width: 40rem;
  margin-bottom: var(--s-8);
}

.tkb-lp-cabeza--con-enlace {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  max-width: none;
}

.tkb-lp-cabeza--con-enlace > div {
  max-width: 40rem;
}

.tkb-lp-cabeza__lead {
  margin: var(--s-3) 0 0;
  color: var(--ink-soft);
}

/* 1. El encabezado: degradado en verdes y una retícula tenue detrás. */
.tkb-lp-hero {
  position: relative;
  padding: clamp(var(--s-10), 7vw, 6rem) 0 clamp(var(--s-10), 6vw, 5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60rem 30rem at 85% 10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(40rem 24rem at 0% 100%, color-mix(in srgb, var(--lp-verde-claro) 18%, transparent), transparent 70%),
    var(--paper);
}

.tkb-lp-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  content: '';
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 30%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}

.tkb-lp-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(var(--s-8), 5vw, 5rem);
}

.tkb-lp-hero__titulo {
  margin: var(--s-4) 0 var(--s-5);
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.tkb-lp-hero__acento {
  display: block;
  background: linear-gradient(90deg, var(--brand-strong), var(--lp-verde-medio));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tkb-lp-hero__lead {
  max-width: 36rem;
  margin: 0 0 var(--s-8);
  color: var(--ink-soft);
  font-size: var(--fs-lg);
  line-height: 1.55;
}

.tkb-lp-hero__registro {
  margin: var(--s-5) 0 0;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
}

/* La maqueta: tres tarjetas apiladas con un poco de giro. */
.tkb-lp-mock {
  position: relative;
  min-height: 25rem;
}

.tkb-lp-mock > * {
  position: absolute;
  box-shadow: var(--shadow-lg);
}

.tkb-lp-mock__ruta {
  top: 0;
  left: 6%;
  width: min(100%, 20rem);
  min-height: 0;
  transform: rotate(-3deg);
}

.tkb-lp-mock__curso {
  right: 0;
  bottom: 12%;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: 15rem;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transform: rotate(4deg);
}

.tkb-lp-mock__curso .tkb-badge {
  align-self: flex-start;
}

.tkb-lp-mock__curso-titulo {
  font-size: var(--fs-lg);
  font-weight: 500;
}

.tkb-lp-mock__insignia {
  bottom: 0;
  left: 0;
  width: 13rem;
  transform: rotate(-6deg);
}

@media (max-width: 900px) {
  .tkb-lp-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tkb-lp-mock {
    max-width: 26rem;
    margin-inline: auto;
  }
}

@media (max-width: 480px) {
  .tkb-lp-mock {
    min-height: 21rem;
  }

  .tkb-lp-mock__curso {
    width: 12rem;
  }

  .tkb-lp-mock__insignia {
    width: 11rem;
  }
}

/* 2. Una frase grande a un lado, el texto al otro. */
.tkb-lp-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(var(--s-6), 5vw, 5rem);
  align-items: start;
}

.tkb-lp-split__texto {
  color: var(--ink-soft);
  font-size: var(--fs-lg);
  line-height: 1.6;
}

.tkb-lp-split__texto p {
  margin: 0;
}

.tkb-lp-split__texto p + p {
  margin-top: var(--s-4);
}

@media (max-width: 800px) {
  .tkb-lp-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 3. Bento: cuatro tarjetas, dos anchas y dos estrechas. */
.tkb-lp-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tkb-lp-bento__item {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-height: 13rem;
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tkb-lp-bento__item:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.tkb-lp-bento__item--1,
.tkb-lp-bento__item--4 {
  grid-column: span 2;
}

/* La primera, destacada en verde: es la que abre la ruta. */
.tkb-lp-bento__item--1 {
  border-color: transparent;
  background:
    radial-gradient(30rem 16rem at 100% 0%, color-mix(in srgb, var(--lp-verde-claro) 30%, transparent), transparent 70%),
    var(--lp-verde-oscuro);
  color: #fff;
}

/* El h3 lleva --ink de base.css y no hereda el blanco de la tarjeta. */
.tkb-lp-bento__item--1 .tkb-lp-bento__titulo {
  color: #fff;
}

.tkb-lp-bento__item--1 .tkb-lp-bento__texto {
  color: rgba(255, 255, 255, 0.75);
}

.tkb-lp-bento__item--1 .tkb-lp-bento__icono {
  background: rgba(255, 255, 255, 0.12);
  color: var(--lp-verde-claro);
}

.tkb-lp-bento__icono {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: auto;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tkb-lp-bento__icono svg {
  width: 24px;
  height: 24px;
}

.tkb-lp-bento__titulo {
  margin: var(--s-6) 0 0;
  font-size: var(--fs-xl);
  font-weight: 500;
}

.tkb-lp-bento__texto {
  margin: 0;
  color: var(--ink-soft);
}

@media (max-width: 800px) {
  .tkb-lp-bento {
    grid-template-columns: minmax(0, 1fr);
  }

  .tkb-lp-bento__item--1,
  .tkb-lp-bento__item--4 {
    grid-column: auto;
  }
}

/* 4. Línea de tiempo: nodos numerados unidos por una línea. */
.tkb-lp-pasos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tkb-lp-pasos::before {
  position: absolute;
  top: 1.5rem;
  right: 12%;
  left: 12%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--lp-verde-claro));
  content: '';
  opacity: 0.5;
}

.tkb-lp-pasos__item {
  position: relative;
  text-align: center;
}

.tkb-lp-pasos__num {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--s-4);
  border: 2px solid var(--brand);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--brand-strong);
  font-size: var(--fs-lg);
  font-weight: 600;
  box-shadow: 0 0 0 6px var(--paper);
}

.tkb-lp-pasos__item p {
  max-width: 15rem;
  margin: 0 auto;
  color: var(--ink-soft);
}

@media (max-width: 800px) {
  .tkb-lp-pasos {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }

  .tkb-lp-pasos::before {
    top: 1.5rem;
    bottom: 1.5rem;
    left: 1.5rem;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--brand), var(--lp-verde-claro));
  }

  .tkb-lp-pasos__item {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    text-align: left;
  }

  .tkb-lp-pasos__num {
    flex: 0 0 auto;
    margin: 0;
  }

  .tkb-lp-pasos__item p {
    margin: 0;
  }
}

/* 5. Los cursos, con un poco de elevación al pasar. */
.tkb-lp-cursos .tkb-card {
  border-radius: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tkb-lp-cursos .tkb-card:hover {
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-3px);
}

/* 6. El perfil: texto a un lado, la tarjeta de ejemplo al otro. */
.tkb-lp-perfil {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(var(--s-8), 5vw, 5rem);
}

.tkb-lp-perfil__texto p {
  margin: var(--s-4) 0 var(--s-6);
  color: var(--ink-soft);
  font-size: var(--fs-lg);
  line-height: 1.6;
}

.tkb-lp-perfil__texto .tkb-lp-nota {
  margin: var(--s-4) 0 0;
  color: var(--ink-faint);
  font-size: var(--fs-xs);
}

.tkb-lp-perfil__mock .tkb-member {
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.tkb-lp-perfil__mock .tkb-avatar {
  width: 6rem;
  height: 6rem;
  margin-top: -3rem;
}

.tkb-lp-perfil__insignias {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.tkb-lp-perfil__insignias .tkb-insignia__card {
  aspect-ratio: auto;
  padding: var(--s-4) var(--s-3) calc(var(--s-4) + 4px);
}

@media (max-width: 800px) {
  .tkb-lp-perfil {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 7. Preguntas: acordeón con un más que gira a menos. */
.tkb-lp-faq__lista {
  max-width: 48rem;
  border-top: 1px solid var(--line);
}

.tkb-lp-faq__item {
  border-bottom: 1px solid var(--line);
}

.tkb-lp-faq__pregunta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) 0;
  font-size: var(--fs-lg);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.tkb-lp-faq__pregunta::-webkit-details-marker {
  display: none;
}

.tkb-lp-faq__pregunta:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 4px;
}

.tkb-lp-faq__icono {
  position: relative;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  transition: transform 0.2s;
}

.tkb-lp-faq__icono::before,
.tkb-lp-faq__icono::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--brand-strong);
  content: '';
  transform: translate(-50%, -50%);
}

.tkb-lp-faq__icono::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 0.2s;
}

.tkb-lp-faq__item[open] .tkb-lp-faq__icono::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.tkb-lp-faq__respuesta {
  max-width: 40rem;
  margin: 0 0 var(--s-5);
  color: var(--ink-soft);
  line-height: 1.6;
}

/* 8. La llamada final: banda verde oscuro con el trébol. */
.tkb-lp-final-wrap {
  padding: clamp(var(--s-12), 8vw, 7rem) var(--s-6) 0;
}

.tkb-lp-final {
  position: relative;
  padding: clamp(var(--s-10), 6vw, 5rem) var(--s-6);
  border-radius: 32px;
  background:
    radial-gradient(40rem 20rem at 50% 120%, color-mix(in srgb, var(--lp-verde-claro) 35%, transparent), transparent 70%),
    var(--lp-verde-oscuro);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.tkb-lp-final__forma {
  position: absolute;
  top: -2.5rem;
  right: -2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 5rem);
  opacity: 0.35;
}

.tkb-lp-final__forma span {
  width: 5rem;
  height: 5rem;
  border-radius: var(--r-full);
  background: var(--lp-verde-medio);
}

.tkb-lp-final__forma span:nth-child(2),
.tkb-lp-final__forma span:nth-child(3) {
  background: var(--lp-verde-claro);
}

.tkb-lp-final__titulo {
  position: relative;
  max-width: 36rem;
  margin: 0 auto var(--s-4);
  color: #fff;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tkb-lp-final__texto {
  position: relative;
  max-width: 34rem;
  margin: 0 auto var(--s-8);
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-lg);
}

.tkb-lp-final .tkb-lp-acciones {
  position: relative;
}

.tkb-lp-final__cta {
  background: #fff;
  color: var(--lp-verde-oscuro);
}

.tkb-lp-final__cta:hover {
  background: var(--brand-soft);
  color: var(--lp-verde-oscuro);
}

.tkb-lp-final__cta--ghost {
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
}

.tkb-lp-final__cta--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Aparición al hacer scroll. Solo con JS y sin "reducir movimiento": la clase la
   pone el script, así que sin él todo se ve desde el principio. */
.tkb-lp-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.tkb-lp-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Las tarjetas giradas de las maquetas conservan su giro al aparecer. */
.tkb-lp-reveal .tkb-lp-mock[data-reveal],
.tkb-lp-reveal .tkb-lp-perfil__mock[data-reveal] {
  transform: translateY(24px) scale(0.98);
}

.tkb-lp-reveal .tkb-lp-mock[data-reveal].is-visible,
.tkb-lp-reveal .tkb-lp-perfil__mock[data-reveal].is-visible {
  transform: none;
}

/* Escalonado en las listas, para que no aparezca todo de golpe. */
.tkb-lp-reveal .tkb-lp-bento__item:nth-child(2),
.tkb-lp-reveal .tkb-lp-pasos__item:nth-child(2) {
  transition-delay: 0.08s;
}

.tkb-lp-reveal .tkb-lp-bento__item:nth-child(3),
.tkb-lp-reveal .tkb-lp-pasos__item:nth-child(3) {
  transition-delay: 0.16s;
}

.tkb-lp-reveal .tkb-lp-bento__item:nth-child(4),
.tkb-lp-reveal .tkb-lp-pasos__item:nth-child(4) {
  transition-delay: 0.24s;
}

/* La aparición deja transform en "none" con más especificidad que el hover:
   sin esto, las tarjetas dejarían de elevarse al pasar el ratón. */
.tkb-lp-reveal .tkb-lp-bento__item.is-visible:hover {
  transform: translateY(-3px);
  transition-delay: 0s;
}

/* Requisitos de la contraseña bajo el campo: se marcan en verde al cumplirse. */
.tkb-pwrules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px var(--s-3);
  margin: calc(-1 * var(--s-2)) 0 var(--s-4);
  padding: 0;
  list-style: none;
  color: var(--ink-faint);
  font-size: var(--fs-xs);
}

.tkb-pwrules__item {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  transition: color 0.15s;
}

.tkb-pwrules__item[data-ok='true'] {
  color: var(--brand-strong);
}

.tkb-pwrules__mark {
  width: 1em;
  font-weight: 600;
  text-align: center;
}

.tkb-pwrules__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .tkb-pwrules {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* El aviso de Google bajo los formularios con reCAPTCHA. */
.tkb-captcha {
  margin: var(--s-4) 0 0;
  color: var(--ink-faint);
  font-size: var(--fs-xs);
  line-height: 1.5;
  text-align: center;
}

.tkb-captcha a {
  color: inherit;
  text-decoration: underline;
}
