.apx {
	--apx-panel: #101020;
	--apx-linea: #22213a;
	--apx-texto: #e8e6f0;
	--apx-suave: #8b8aa0;
	--apx-tenue: #55536f;
	--apx-acento: #c084fc;
	font-family: "Outfit", system-ui, -apple-system, sans-serif;
	font-weight: 300;
	color: var(--apx-texto);
	position: relative;
}

.apx *,
.apx *::before,
.apx *::after { box-sizing: border-box; }

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

/* ---------- barra de control ---------- */

.apx-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--apx-linea);
	margin-bottom: 16px;
}

.apx-vistas { display: flex; gap: 6px; }

.apx-vistas button {
	background: none;
	border: 1px solid var(--apx-linea);
	color: var(--apx-suave);
	font: inherit;
	font-size: 13px;
	padding: 7px 14px;
	border-radius: 20px;
	cursor: pointer;
}

.apx-vistas button[aria-pressed="true"] {
	color: #fff;
	border-color: #8b2fc9;
	background: rgba(139, 47, 201, .2);
}

.apx-buscar { flex: 1 1 200px; }

.apx-buscar input {
	width: 100%;
	background: var(--apx-panel);
	border: 1px solid var(--apx-linea);
	border-radius: 8px;
	color: var(--apx-texto);
	font: inherit;
	font-size: 15px;
	padding: 9px 13px;
}

.apx-buscar input::placeholder { color: var(--apx-suave); }

.apx-tempo { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--apx-suave); }
.apx-tempo input[type="range"] { width: 120px; accent-color: var(--apx-acento); }
.apx-tempo output { color: var(--apx-acento); min-width: 62px; }

.apx-buscar input:focus-visible,
.apx button:focus-visible {
	outline: 2px solid var(--apx-acento);
	outline-offset: 2px;
}

.apx-cuenta { font-size: 13px; color: var(--apx-suave); margin: 0 0 14px; min-height: 1em; }
.apx-cargando { color: var(--apx-suave); font-size: 14px; }

/* ---------- vista de arbol ---------- */

.apx-lienzo { position: relative; }
.apx-hilos { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.apx-lienzo > *:not(.apx-hilos) { position: relative; z-index: 1; }

.apx-seccion {
	font-size: 10px;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	color: var(--apx-tenue);
	margin: 0 0 10px;
	text-align: center;
	font-weight: 400;
}

.apx-fila { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.apx-nodo {
	border: 1px solid;
	border-radius: 9px;
	padding: 8px 11px;
	text-align: center;
	font: inherit;
	color: var(--apx-texto);
	cursor: pointer;
	min-width: 0;
	transition: transform .12s ease, opacity .15s ease;
}

.apx-nodo:hover { transform: translateY(-1px); }
.apx-nodo b { display: block; font-weight: 400; font-size: 13px; line-height: 1.2; }
.apx-nodo i { display: block; font-style: normal; font-size: 11px; opacity: .78; margin-top: 3px; line-height: 1.3; }
.apx-nodo u { display: block; text-decoration: none; font-size: 10.5px; opacity: .55; margin-top: 2px; }
.apx-nodo[data-apagado="1"] { opacity: .2; }
.apx-nodo[aria-expanded="true"] { box-shadow: inset 0 0 0 1px currentColor; }

.apx-tronco { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 18px 0; }
.apx-tronco .apx-nodo { min-width: 210px; }
.apx-tronco .apx-nodo b { font-family: "Audiowide", "Outfit", sans-serif; font-size: 15px; }
.apx-par { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.apx-familias {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-top: 22px;
}

.apx-caja { border: 1px solid; border-radius: 12px; padding: 12px 10px 11px; }
.apx-caja-tit { font-family: "Audiowide", "Outfit", sans-serif; font-size: 12.5px; line-height: 1.3; text-align: center; margin: 0; font-weight: 400; }
.apx-caja-sub { font-size: 10.5px; text-align: center; color: var(--apx-tenue); margin: 3px 0 10px; }
.apx-hijos { display: flex; flex-direction: column; gap: 6px; }

/* ---------- vista de linea de tiempo ---------- */

.apx-carril { position: relative; }
.apx-anos { position: absolute; font-size: 10.5px; color: var(--apx-tenue); }
.apx-regla { position: absolute; border-left: 1px solid #17162a; top: 16px; }
.apx-etiqueta { position: absolute; font-size: 12px; color: #c9c7db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.apx-barra { position: absolute; height: 12px; border-radius: 3px; cursor: pointer; }
.apx-grupo { position: absolute; font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; left: 0; }

/* ---------- ficha, acciones y reproductor ---------- */

.apx-ficha { scroll-margin-top: 120px; }

.apx-tarjeta {
	background: var(--apx-panel);
	border: 1px solid var(--apx-linea);
	border-radius: 14px;
	padding: 20px 22px;
	margin-bottom: 20px;
}

.apx-tarjeta-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.apx-tarjeta h3 { font-family: "Audiowide", "Outfit", sans-serif; font-weight: 400; font-size: 20px; margin: 0; line-height: 1.25; }
.apx-meta { font-size: 13px; color: var(--apx-suave); margin: 5px 0 0; }
.apx-texto { font-size: 15px; line-height: 1.7; color: #c9c7db; margin: 14px 0 0; }
.apx-origen { border-left: 2px solid var(--apx-linea); padding-left: 14px; }

.apx-etqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.apx-etq { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; border: 1px solid; }

.apx-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin-top: 20px; }
.apx-sub { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--apx-suave); margin: 0 0 8px; font-weight: 400; }

.apx-fila-dato { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1c1b30; font-size: 14px; }
.apx-fila-txt { min-width: 0; }
.apx-fila-txt b { font-weight: 400; }
.apx-fila-sub { display: block; font-size: 12px; color: var(--apx-suave); }

.apx-mini {
	background: none;
	border: 1px solid #33314f;
	color: #c8c6dd;
	width: 32px;
	height: 32px;
	flex: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 11px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.apx-mini:hover { color: #fff; }
.apx-mini[data-sinvideo="1"] { opacity: .55; }

.apx-acciones { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

.apx-accion {
	font-size: 13px;
	padding: 8px 14px;
	border-radius: 20px;
	border: 1px solid var(--apx-linea);
	background: none;
	color: var(--apx-suave);
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}

.apx-accion:hover { color: var(--apx-texto); }

.apx-rel { margin-top: 18px; font-size: 13px; color: var(--apx-suave); }
.apx-rel a { color: var(--apx-acento); text-decoration: none; }
.apx-rel a:hover { text-decoration: underline; }

.apx-cerrar-ficha { background: none; border: 1px solid var(--apx-linea); color: var(--apx-suave); width: 32px; height: 32px; flex: none; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }

.apx-player {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 900;
	width: 356px;
	max-width: calc(100vw - 24px);
	background: var(--apx-panel);
	border: 1px solid var(--apx-linea);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}

.apx-video { width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #000; }
.apx-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.apx-player-info { padding: 10px 12px 4px; }
.apx-player-tema { margin: 0; font-size: 14px; line-height: 1.3; }
.apx-player-sub { margin: 3px 0 0; font-size: 12px; color: var(--apx-suave); }
.apx-player-btns { display: flex; gap: 6px; padding: 8px 12px 12px; }
.apx-player-btns button { background: none; border: 1px solid #33314f; color: #c8c6dd; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; }
.apx-player-btns button:hover { color: #fff; }
.apx-player-btns #apx-cerrar { margin-left: auto; }

@media (max-width: 780px) {
	.apx-hilos { display: none; }
	.apx-familias { grid-template-columns: 1fr; }
	.apx-tronco { gap: 10px; margin: 12px 0; }
	.apx-nodo b { font-size: 12.5px; }
}

@media (max-width: 640px) {
	.apx-player { right: 8px; left: 8px; bottom: 8px; width: auto; }
	.apx-tarjeta { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.apx-nodo { transition: none; }
	.apx-nodo:hover { transform: none; }
}

/* ---------- indice en texto ---------- */

.apx-indice {
	margin-top: 44px;
	padding-top: 26px;
	border-top: 1px solid #22213a;
	font-family: "Outfit", system-ui, sans-serif;
	font-weight: 300;
	color: #c9c7db;
}

.apx-indice h2 { font-family: "Audiowide", "Outfit", sans-serif; font-weight: 400; font-size: 20px; margin: 0 0 4px; color: #e8e6f0; }
.apx-indice-intro { font-size: 13px; color: #8b8aa0; margin: 0 0 22px; }
.apx-indice-fam { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; margin: 26px 0 10px; font-weight: 400; }

.apx-det { border-bottom: 1px solid #1c1b30; padding: 2px 0; }
.apx-det > summary { cursor: pointer; padding: 10px 2px; font-size: 15px; color: #e8e6f0; list-style: none; }
.apx-det > summary::-webkit-details-marker { display: none; }
.apx-det > summary::before { content: "+"; display: inline-block; width: 16px; color: #55536f; }
.apx-det[open] > summary::before { content: "–"; }
.apx-det > summary span { color: #8b8aa0; font-size: 13px; }
.apx-det p { font-size: 14.5px; line-height: 1.7; margin: 0 0 12px; padding-left: 16px; }
.apx-det p strong { font-weight: 400; color: #e8e6f0; }
.apx-det .apx-fuentes { font-size: 12.5px; color: #8b8aa0; }
.apx-det-ir a { color: #c084fc; text-decoration: none; font-size: 13px; }
.apx-det-ir a:hover { text-decoration: underline; }

/* ---------- relato: navegación e índice lateral ---------- */

.apx-vistas .apx-otro {
	display: inline-block;
	border: 1px solid var(--apx-linea, #22213a);
	color: var(--apx-suave, #8b8aa0);
	font-size: 13px;
	padding: 7px 14px;
	border-radius: 20px;
	text-decoration: none;
	line-height: 1.2;
}

.apx-vistas .apx-otro:hover { color: #fff; border-color: #8b2fc9; }
.apx-relato-cab { margin-bottom: 8px; }
.apx-relato-cab .apx-tools { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }

.apx-indice-lateral {
	font-family: "Outfit", system-ui, sans-serif;
	font-weight: 300;
	border-left: 2px solid #22213a;
	padding: 2px 0 2px 16px;
	margin: 0 0 30px;
}

.apx-indice-lateral .apx-indice-tit {
	font-size: 10px;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: #55536f;
	margin: 0 0 8px;
}

.apx-indice-lateral ol { list-style: none; margin: 0; padding: 0; }
.apx-indice-lateral li { margin: 0 0 8px; }
.apx-indice-lateral li.nh3 { padding-left: 14px; }
.apx-indice-lateral a {
	color: #8b8aa0;
	text-decoration: none;
	font-size: 15px;
	line-height: 1.45;
	display: block;
	/* con 340 px caben enteros; si alguno se pasa, se recorta en vez de partirse */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.apx-indice-lateral a:hover { color: #e8e6f0; }
.apx-indice-lateral a.aqui { color: #c084fc; }

@media (min-width: 1000px) {
	.apx-indice-lateral {
		position: sticky;
		top: 110px;
		margin: 0;
		max-height: 80vh;
		overflow-y: auto;
	}
}

@media (max-width: 999px) {
	.apx-relato-envoltorio {
		grid-template-columns: 1fr;
		gap: 0;
		padding: 0;
	}
	.apx-relato { max-width: none; }
	.apx-indice-lateral a { white-space: normal; }
	.apx-relato p { font-size: 17px; }
}

/* ---------- el relato ---------- */

.apx-relato-envoltorio {
	/* Ocupa el ancho de la ventana y se centra por sí mismo, sin depender de dónde
	   esté el contenedor del tema: ni left:50% ni márgenes negativos acertaban. */
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	padding: 0 3vw;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 340px minmax(0, 1fr);
	gap: 76px;
	justify-content: center;
	align-items: start;
}

.entry-content > .apx-relato-envoltorio,
.entry-content .apx-relato-envoltorio { max-width: none; }

.apx-relato {
	font-family: "Outfit", system-ui, sans-serif;
	font-weight: 300;
	color: #c9c7db;
	max-width: 56rem;
}

.apx-relato p { font-size: 19px; line-height: 1.8; margin: 0 0 1.2em; }
.apx-relato h2.apx-relato-tit {
	font-family: "Audiowide", "Outfit", sans-serif;
	font-weight: 400;
	font-size: 27px;
	color: #e8e6f0;
	margin: 2.4em 0 .7em;
	scroll-margin-top: 120px;
}
.apx-relato h3.apx-relato-tit {
	font-weight: 400;
	font-size: 21px;
	color: #c084fc;
	margin: 2em 0 .6em;
	scroll-margin-top: 120px;
}
.apx-relato h4.apx-relato-tit {
	font-weight: 400;
	font-size: 16px;
	color: #8b8aa0;
	margin: 1.6em 0 .5em;
	scroll-margin-top: 120px;
}
.apx-relato .apx { max-width: none; margin: 1.6em 0 2em; }

@media (max-width: 640px) {
	.apx-relato p { font-size: 16px; }
	.apx-relato h2.apx-relato-tit { font-size: 21px; }
}

/* ---------- figuras del relato ---------- */

.apx-figura { margin: 2.2em 0 2.4em; }

.apx-figura img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
	border: 1px solid #22213a;
}

.apx-figura figcaption {
	font-size: 14px;
	line-height: 1.5;
	font-style: italic;
	color: #8b8aa0;
	margin-top: 9px;
}

.apx-figura .apx-credito {
	display: block;
	font-style: normal;
	font-size: 11.5px;
	color: #55536f;
	margin-top: 3px;
}

/* ---------- llamada de cierre del relato ---------- */

.apx-relato .apx-llamada { margin: 1.4em 0 0; }

.apx-relato .apx-llamada a {
	display: inline-block;
	border: 1px solid rgba(192, 132, 252, .45);
	background: rgba(192, 132, 252, .1);
	color: #c084fc;
	border-radius: 22px;
	padding: 10px 20px;
	font-size: 15px;
	text-decoration: none;
}

.apx-relato .apx-llamada a:hover { color: #fff; border-color: #c084fc; }
