    /* === RESET Y GARANTÍA DE ICONOS (FONT AWESOME) === */
    .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands {
        font-family: "Font Awesome 6 Free" !important;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        display: inline-block !important;
        font-style: normal;
        font-variant: normal;
        line-height: 1;
        text-rendering: auto;
    }
    .fas, .fa-solid { font-weight: 900 !important; }
    .far, .fa-regular { font-weight: 400 !important; }
    
    /* === BOTONES DE ICONO (UNIFICADOS) === */
    .icon-btn, .icon-btn-mobile {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 2.5rem !important;
        height: 2.5rem !important;
        border-radius: 0.5rem !important;
        transition: all 0.3s ease !important;
        cursor: pointer;
        border: none;
    }
    .icon-btn i { font-size: 1.25rem !important; line-height: 1 !important; }
    .icon-btn-mobile i { font-size: 1.5rem !important; line-height: 1 !important; }
    
    /* === MODO OSCURO COMPLETO === */
    .dark {
        background-color: #1a202c !important;
        color: #e2e8f0 !important;
    }
    .dark .bg-white { background-color: #2d3748 !important; }
    .dark .bg-gray-50 { background-color: #1a202c !important; }
    .dark .bg-gray-100 { background-color: #2d3748 !important; }
    .dark .text-gray-700, .dark .text-gray-800, .dark .text-gray-900 { color: #f7fafc !important; }
    .dark .text-gray-600 { color: #cbd5e0 !important; }
    .dark .text-gray-500 { color: #a0aec0 !important; }
    .dark .border-gray-200 { border-color: #4a5568 !important; }
    .dark .shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3) !important; }
    .dark .toc-container { background-color: #2d3748 !important; }
    .dark footer { background: linear-gradient(145deg, #0f1117, #1a1c24) !important; }
    
    /* === ESTILOS DE TARJETAS Y BADGES === */
    .badge-germanico { background-color: #5a3e2b; color: white; }
    .badge-islam { background-color: #2d6a4f; color: white; }
    .badge-reconquista { background-color: #1e6091; color: white; }
    .badge-espana { background-color: #c4450c; color: white; }
    .badge-eventos { background-color: #6c584c; color: white; }
    
    .monarch-card { cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
    .monarch-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); }
    .rotate-180 { transform: rotate(180deg); transition: transform 0.3s ease; }
    
    .bio-section { margin-bottom: 1rem; }
    .bio-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: #b87333; }
    .bio-highlight { background-color: #fef3c7; padding: 0.75rem; border-radius: 0.5rem; margin: 0.75rem 0; font-style: italic; }
    .bio-stats { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
    .bio-stat { background-color: #f3f4f6; padding: 0.5rem 1rem; border-radius: 0.5rem; text-align: center; flex: 1; min-width: 80px; }
    .bio-stat-value { font-weight: 700; font-size: 1.1rem; color: #b87333; }
    .dark .bio-highlight { background-color: #2d2a1e; color: #e5e5e5; }
    .dark .bio-stat { background-color: #1f2937; }
    .dark .bio-stat-value { color: #f59e0b; }
    
    .monarch-info-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
    .monarch-avatar { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: bold; color: white; background: linear-gradient(135deg, #b87333, #8b5a2b); }
    
    /* === MEJORAS RESPONSIVE === */
    body { overflow-x: hidden; width: 100%; -webkit-tap-highlight-color: transparent; }
    .container { max-width: 100%; }
    p, li, h1, h2, h3, h4 { word-break: break-word; overflow-wrap: break-word; }
    
    @media (max-width: 1023px) {
        .px-4 { padding-left: 1rem; padding-right: 1rem; }
        .py-8 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
        .hero-section .p-8 { padding: 1.5rem; }
        .grid-cols-2 { gap: 0.75rem; }
        #toc-sidebar.show { display: block; width: 100%; }
    }
    @media (max-width: 767px) {
        .hero-section .flex-col .w-48 { width: 120px; height: 120px; }
    }
    
    /* === BOTÓN SUBIR === */
/* === BOTÓN SUBIR === */
#btnSubir {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
    display: flex;           /* Añadir: usa flexbox */
    align-items: center;     /* Añadir: centra verticalmente */
    justify-content: center; /* Añadir: centra horizontalmente */
}
#btnSubir i {
    font-size: 1.25rem;      /* Añadir: tamaño del ícono */
    line-height: 1;          /* Añadir: evita desbordes */
}
#btnSubir:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 6px 16px rgba(0,0,0,0.3); 
}
@media (max-width: 1024px) {
    #btnSubir { 
        width: 40px; 
        height: 40px; 
        bottom: 20px; 
        right: 20px;
    }
    #btnSubir i {
        font-size: 1rem;     /* Añadir: ajuste para móvil */
    }
}

    
    /* === TOC MÓVIL === */
    .toc-mobile-toggle .fa-chevron-down { transition: transform 0.3s; }
    .toc-mobile-toggle.open .fa-chevron-down { transform: rotate(180deg); }
    .typography-menu.show { display: block !important; }
    
    /* === ENLACES === */
    a { color: #0288d1; text-decoration: none; font-weight: 700; }
    a[target="_blank"]::after { content: "↗"; margin-left: 3px; font-size: 0.9em; }
    a[href^="#"] { color: #7b1fa2; border-bottom: 1px dotted #7b1fa2; }
    a[href$=".pdf"] { color: #c2185b; }
    a[href$=".pdf"]::before { content: "📄 "; }
    
    /* === TRANSICIONES === */
    body, .preview-text { transition: background-color 0.3s ease, color 0.3s ease; }
    .toc-container a { transition: color 0.2s ease; }