    /* =====================
    MEJORAS VISUALES 2025
    ===================== */
    :root {
        --main-bg: #181f2a;
        --menu-bg: #2C3E50;
        --accent: #27AE60;
        --accent-dark: #1F8A4D;
        --white: #fff;
        --gray: #808080;
        --blue: #007BFF;
        --blue-dark: #0056b3;
        --border-radius: 10px;
        --shadow: 0 4px 24px #0002, 0 1.5px 4px #0001;
        --transition: 0.25s cubic-bezier(.4, 2, .6, 1);
        --font-main: 'Segoe UI', 'Roboto', Arial, sans-serif;
    }

    body {
        font-family: var(--font-main);
        background: var(--main-bg);
        color: var(--white);
        letter-spacing: 0.01em;
    }

    button,
    .custom-upload-btn {
        display: inline-block;
        padding: 12px 22px;
        margin: 10px 0;
        font-size: 15px;
        font-weight: 600;
        color: var(--white);
        background: linear-gradient(90deg, var(--accent), var(--accent-dark));
        border: none;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        cursor: pointer;
        transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
        outline: none;
        position: relative;
        overflow: hidden;
    }

    button:hover,
    .custom-upload-btn:hover {
        background: linear-gradient(90deg, #2ee88b, #1F8A4D 90%);
        box-shadow: 0 8px 32px #27ae6040, 0 2px 8px #0002;
        transform: translateY(-2px) scale(1.04);
    }

    button:active,
    .custom-upload-btn:active {
        background: linear-gradient(90deg, #1F8A4D, #27AE60 90%);
        transform: scale(0.98);
    }

    input,
    select {
        border-radius: var(--border-radius);
        border: 1.5px solid #2ee88b44;
        background: #232c3b;
        color: var(--white);
        padding: 8px 12px;
        font-size: 15px;
        margin-top: 5px;
        margin-bottom: 10px;
        box-shadow: 0 1.5px 4px #0001;
        transition: border var(--transition), box-shadow var(--transition);
    }

    input:focus,
    select:focus {
        border: 1.5px solid var(--accent);
        box-shadow: 0 2px 8px #27ae6040;
        outline: none;
    }

    #menu,
    #rotation-controls {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        box-shadow: var(--shadow);
    }

    #scene-container {
        border-radius: var(--border-radius);
        box-shadow: 0 8px 32px #0003;
    }

    #model-actions {
        background: rgba(44, 62, 80, 0.97);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }

    #model-actions button {
        border-radius: 8px;
        background: linear-gradient(90deg, var(--blue), var(--blue-dark));
        color: #fff;
        font-weight: 600;
        box-shadow: 0 2px 8px #007bff33;
    }

    #model-actions button:hover {
        background: linear-gradient(90deg, #3faaff, #0056b3 90%);
    }

    #textureGallery button,
    #customTextureGallery button {
        width: 25px;
        /* Reducir el ancho */
        height: 25px;
        /* Reducir la altura */
        padding: 5px;
        /* Ajustar el relleno */
        border-radius: 50%;
        /* Mantener la forma circular */
        background-color: #FF4444;
        /* Mantener el color rojo */
        border: 2px solid #27AE60;
        /* Mantener el borde */
        box-shadow: 0 2px 8px #0002;
        /* Mantener el efecto de sombra */
        transition: border var(--transition), box-shadow var(--transition), transform var(--transition);
    }

    #textureGallery button:hover,
    #customTextureGallery button:hover {
        border: 2px solid #ffd700;
        box-shadow: 0 4px 16px #27ae6044;
        transform: scale(1.08);
    }

    #scale-controls {
        background: rgba(39, 43, 59, 0.97);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }

    #toast {
        background: #232c3b;
        color: #fff;
        border-radius: var(--border-radius);
        box-shadow: 0 2px 8px #27ae6040;
        font-size: 17px;
        font-weight: 600;
        letter-spacing: 0.02em;
        padding: 16px 32px;
        animation: fadeInOut 1.5s;
    }

    @keyframes fadeInOut {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }

        10% {
            opacity: 1;
            transform: translateY(0);
        }

        90% {
            opacity: 1;
            transform: translateY(0);
        }

        100% {
            opacity: 0;
            transform: translateY(-10px);
        }
    }

    h3,
    h2,
    h1 {
        font-family: var(--font-main);
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #fff;
    }

    /* Tarjetas y paneles */
    .panel,
    .card {
        background: #232c3b;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        padding: 18px 20px;
        margin-bottom: 18px;
    }

    ::-webkit-scrollbar {
        width: 8px;
        background: #232c3b;
    }

    ::-webkit-scrollbar-thumb {
        background: #27ae6040;
        border-radius: 8px;
    }

    /* Estilos para botones de agrupación */
    .menu-section h3 {
        margin-top: 15px;
        margin-bottom: 8px;
        color: #00ff88;
        font-size: 14px;
        font-weight: bold;
    }

    #groupBtn, #ungroupBtn {
        display: block;
        width: 100%;
        padding: 10px 12px;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 700;
        color: var(--white);
        background: linear-gradient(45deg, var(--accent), var(--accent-dark));
        border: none;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
        box-shadow: var(--shadow);
    }

    /* Hover/active coherentes con los botones principales */
    #groupBtn:hover, #ungroupBtn:hover {
        background: linear-gradient(45deg, var(--accent-dark), #0E4021);
        transform: scale(1.03);
        box-shadow: 0 8px 32px #27ae6040, 0 2px 8px #0002;
    }

    #groupBtn:active, #ungroupBtn:active {
        transform: scale(0.98);
    }

    /* Fin mejoras visuales */

    body {
        margin: 0;
        font-family: Arial, sans-serif;
        display: flex;
        background: var(--main-bg);
    }

    #menu,
    #rotation-controls {
        position: fixed;
        top: 0;
        background: var(--menu-bg);
        color: var(--white);
        padding: 15px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        z-index: 100;
        overflow-y: auto;
    }

    #menu {
        left: 0;
        width: 200px;
        height: 90vh;
    }

    #rotation-controls {
        right: 0;
        width: 220px;
        height: 89vh;
        border-left: 2px solid #222e3c;
        z-index: 101;
    }

    #scene-container {
        flex-grow: 1;
        margin-left: 220px;
        height: 100vh;
        background: var(--main-bg);
        position: relative;
    }

    h3 {
        font-size: 16px;
        margin: 18px 0 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding-bottom: 4px;
    }

    label {
        display: block;
        margin-top: 10px;
        font-size: 14px;
    }

    input,
    select {
        width: 100%;
        padding: 5px;
        margin-top: 5px;
        border-radius: var(--border-radius);
        border: none;
        font-size: 14px;
    }

    input[type="number"] {
        width: 80px;
        min-width: 60px;
        max-width: 120px;
        text-align: center;
    }

    input[type="file"] {
        display: none;
    }

    button {
        display: block;
        width: 100%;
        margin: 10px 0;
        padding: 10px;
        font-size: 14px;
        font-weight: bold;
        color: var(--white);
        background: linear-gradient(45deg, var(--accent), #298b54);
        border: none;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition: 0.3s;
    }

    button:hover {
        background: linear-gradient(45deg, var(--accent-dark), #0E4021);
        transform: scale(1.05);
    }

    button:active {
        transform: scale(0.95);
    }
    /* Botón de medir estilo metro */
    #measurementToolBtn {
        background: linear-gradient(90deg, #ffe600, #c7b800);
        color: #222;
        border: 2px solid #c7b800;
        box-shadow: 0 4px 16px #ffe60055;
    }

    #measurementToolBtn:hover {
        background: linear-gradient(90deg, #c7b800, #ffe600);
        color: #111;
        transform: scale(1.07);
        box-shadow: 0 6px 24px #ffe60099;
    }

    #model-actions {
        position: fixed;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(44, 62, 80, 0.9);
        padding: 10px;
        border-radius: 8px;
        display: flex;
        gap: 10px;
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
        z-index: 101;
    }

    #model-actions button {
        width: auto;
        padding: 10px 16px;
        background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
        font-weight: 700;
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
        position: relative;
        overflow: hidden;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
        text-align: center;
        letter-spacing: 0.2px;
        min-height: 55px;
        min-width: 95px;
        transition: all 0.3s ease;
    }

    #model-actions button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }

    #model-actions button:hover::before {
        left: 100%;
    }

    #model-actions button:hover {
        box-shadow: 0 6px 25px rgba(39, 174, 96, 0.6);
        transform: translateY(-3px) scale(1.02);
    }

    #model-actions button:active {
        transform: translateY(-1px) scale(0.98);
    }

    /* Estilos especiales para el botón Optimizador de Despiece */
    #optimizadorCorteButton {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

    #optimizadorCorteButton:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    }

    #textureGallery {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-width: 180px;
    }

    #textureGallery button {
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #scale-controls {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(39, 43, 59, 0.9);
        padding: 10px 15px;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        text-align: center;
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: nowrap;
        white-space: nowrap;
        z-index: 101;
    }

    #fixed-note {
        position: fixed;
        bottom: 10px;
        left: 250px;
        color: var(--white);
        background: rgba(30, 30, 30, 0.7);
        font-size: 12px;
        padding: 6px 16px;
        border-radius: var(--border-radius);
        z-index: 99999;
        pointer-events: none;
        line-height: 1.5;
    }

    #toast {
        display: none;
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        background: #222e3c;
        color: var(--white);
        padding: 12px 24px;
        border-radius: 8px;
        font-size: 16px;
        z-index: 9999;
        box-shadow: 0 2px 8px #0008;
    }

    /* Modal ayuda */
    #helpModal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(24, 31, 42, 0.95);
        z-index: 99999;
        align-items: center;
        justify-content: center;
    }

    #helpModal>div {
        background: #222e3c;
        color: var(--white);
        padding: 32px 24px;
        border-radius: 12px;
        max-width: 480px;
        width: 90vw;
        box-shadow: 0 4px 32px #000a;
        position: relative;
    }

    #helpModal h2 {
        margin-top: 0;
    }

    #helpModal ul {
        font-size: 16px;
        line-height: 1.7;
        padding-left: 18px;
    }

    #helpModal li {
        margin-bottom: 8px;
    }

    #helpModal button {
        position: absolute;
        top: 12px;
        right: 16px;
        background: none;
        border: none;
        color: var(--white);
        font-size: 22px;
        cursor: pointer;
    }

    #helpModal div.contact {
        margin-top: 18px;
        font-size: 13px;
        color: #aaa;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Estilos específicos para el footer del modal de ayuda */
    #helpModal a {
        color: #81C784;
        text-decoration: none;
        word-break: break-all;
        display: inline-block;
        max-width: 100%;
    }

    #helpModal a:hover {
        color: #4CAF50;
        text-decoration: underline;
    }

    /* Hide duplicate button styles */
    #rotation-controls button,
    #model-actions button,
    #scale-controls button {
        width: 100%;
    }

    /* Visual para input de textura personalizada */
    #customTexturePanel label[for="customTextureInput"] {
        display: block;
        margin-bottom: 8px;
        font-weight: bold;
        color: #fff;
    }

    #customTexturePanel input[type="file"]+label,
    #customTexturePanel .custom-upload-btn {
        display: inline-block;
        background: linear-gradient(45deg, #27AE60, #298b54);
        color: #fff;
        padding: 8px 18px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: bold;
        margin-bottom: 8px;
        margin-top: 6px;
        transition: background 0.2s, transform 0.2s;
    }

    #customTexturePanel input[type="file"]+label:hover,
    #customTexturePanel .custom-upload-btn:hover {
        background: linear-gradient(45deg, #1F8A4D, #0E4021);
        transform: scale(1.05);
    }

    /* Galería de texturas personalizadas */
    #customTextureGallery button {
        border: 2px solid #27AE60;
        border-radius: 8px;
        box-shadow: 0 2px 8px #0004;
        transition: border 0.2s, box-shadow 0.2s, transform 0.2s;
        position: relative;
        overflow: hidden;
    }

    #customTextureGallery button:hover {
        border: 2px solid #ffd700;
        box-shadow: 0 4px 16px #27ae6044;
        transform: scale(1.08);
    }

    #customTextureGallery button .delete-icon {
        display: none;
        position: absolute;
        top: 2px;
        right: 2px;
        background: #222e3cdd;
        border-radius: 50%;
        font-size: 16px;
        pointer-events: none;
        z-index: 2;
    }

    #customTextureGallery button:hover .delete-icon {
        display: block;
    }

    /* =====================
            TEXTURAS PERSONALIZADAS
            ===================== */

    /* Ocultar el input de archivo real */
    #customTextureInput {
        display: none !important;
    }

    /* Estilo para el botón personalizado de subir archivo */
    .custom-upload-btn {
        display: inline-block;
        background: linear-gradient(45deg, #27AE60, #1F8A4D);
        color: #fff;
        padding: 10px 16px;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 600;
        font-size: 14px;
        border: none;
        margin-top: 6px;
        margin-bottom: 10px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    }

    .custom-upload-btn:hover {
        background: linear-gradient(45deg, #2ECC71, #27AE60);
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(39, 174, 96, 0.4);
    }

    .custom-upload-btn:active {
        transform: translateY(0);
    }

    /* Panel de texturas personalizadas */
    #customTexturePanel {
        background: rgba(52, 73, 94, 0.3);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
        border: 1px solid rgba(39, 174, 96, 0.2);
    }

    #customTexturePanel h3 {
        margin-top: 0;
        color: #27AE60;
        font-size: 16px;
        font-weight: 600;
    }

    /* Galería de texturas personalizadas en el panel */
    #customTextureGallery {
        max-height: 120px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: #27AE60 #2C3E50;
    }

    #customTextureGallery::-webkit-scrollbar {
        width: 6px;
    }

    #customTextureGallery::-webkit-scrollbar-track {
        background: #2C3E50;
        border-radius: 3px;
    }

    #customTextureGallery::-webkit-scrollbar-thumb {
        background: #27AE60;
        border-radius: 3px;
    }

    #customTextureGallery::-webkit-scrollbar-thumb:hover {
        background: #2ECC71;
    }

    /* Contenedor de textura individual */
    #customTextureGallery>div {
        position: relative;
        display: inline-block;
        margin: 2px;
    }

    /* Botones de textura */
    #customTextureGallery button {
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        border: 2px solid #444;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

    #customTextureGallery button:hover {
        border-color: #27AE60;
        transform: scale(1.05);
        box-shadow: 0 2px 12px rgba(39, 174, 96, 0.4);
    }

    /* Botón de eliminar textura */
    #customTextureGallery .delete-btn {
        position: absolute;
        top: -5px;
        right: -5px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #e74c3c;
        color: white;
        border: none;
        font-size: 10px;
        line-height: 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
        transition: all 0.2s ease;
    }

    #customTextureGallery .delete-btn:hover {
        background: #c0392b;
        transform: scale(1.1);
    }

    /* Mensaje cuando no hay texturas */
    #customTextureGallery div[style*="color: #999"] {
        text-align: center;
        font-style: italic;
        padding: 20px;
    }

    #background-controls {
        background: rgba(44, 62, 80, 0.97);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        padding: 12px;
        margin-bottom: 10px;
    }

    #background-controls h3 {
        color: var(--white);
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 8px;
    }

    #background-controls button {
        background: linear-gradient(90deg, #e74c3c, #c0392b);
        color: var(--white);
        border-radius: var(--border-radius);
        padding: 8px 12px;
        margin-top: 6px;
        cursor: pointer;
        font-weight: bold;
    }

    #background-controls button:hover {
        background: linear-gradient(45deg, #c0392b, #a93226);
    }

    #backgroundPanel {
        background: rgba(52, 73, 94, 0.3);
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
        border: 1px solid rgba(39, 174, 96, 0.2);
    }

    #backgroundPanel h3 {
        margin-top: 0;
        color: #27AE60;
        font-size: 16px;
        font-weight: 600;
    }

    #backgroundPanel label {
        display: block;
        margin-bottom: 8px;
        font-weight: bold;
        color: #fff;
    }

    #backgroundPanel input[type="file"] {
        margin-bottom: 10px;
    }

    #backgroundPanel button {
        background: linear-gradient(45deg, #e74c3c, #c0392b);
        color: #fff;
        padding: 8px 12px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: bold;
        border: none;
        transition: all 0.3s ease;
    }

    #backgroundPanel button:hover {
        background: linear-gradient(45deg, #c0392b, #a93226);
    }

    #skyboxPanel {
        background: linear-gradient(180deg, rgba(35,44,59,0.72), rgba(27,34,44,0.6));
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        border: 1px solid rgba(39, 174, 96, 0.06);
        box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    }

    #skyboxPanel h3 {
        margin: 0 0 8px 0;
        color: #2ee88b;
        font-size: 15px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Zona de arrastre / selección */
    .skybox-drop-zone {
        margin-top: 8px;
        background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
        border-radius: 10px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: 2px dashed rgba(46, 232, 139, 0.18);
        transition: border var(--transition), box-shadow var(--transition), transform var(--transition);
        cursor: pointer;
        min-height: 110px;
    }

    .skybox-drop-zone.dragover,
    .skybox-drop-zone:focus {
        border-color: rgba(46, 232, 139, 0.92);
        box-shadow: 0 8px 30px rgba(46,232,139,0.08);
        transform: translateY(-2px);
    }

    .skybox-instructions .icon {
        font-size: 40px;
        display: block;
        margin-bottom: 6px;
        filter: drop-shadow(0 6px 18px rgba(0,0,0,0.6));
    }

    .skybox-instructions .title {
        text-align: center;
        font-weight: 700;
        font-size: 14px;
        color: #ffffff;
        margin: 0;
    }

    .skybox-instructions .title small {
        display: block;
        font-weight: 500;
        font-size: 12px;
        color: #cfd8dc;
        opacity: 0.9;
        margin-top: 6px;
    }

    .file-name {
        font-size: 12px;
        color: #bfcfcf;
        opacity: 0.9;
        margin-top: 6px;
        text-align: center;
    }

    .skybox-preview {
        margin-top: 8px;
        width: 100%;
        max-height: 120px;
        border-radius: 8px;
        overflow: hidden;
        background-size: cover;
        background-position: center;
        border: 1px solid rgba(255,255,255,0.03);
        box-shadow: inset 0 2px 10px rgba(0,0,0,0.45);
    }

    .skybox-preview.hidden { display: none; }

    .skybox-actions {
        display: flex;
        gap: 10px;
        margin-top: 10px;
    }

    .skybox-actions button {
        flex: 1;
        padding: 10px 12px;
        border-radius: 8px;
        background: linear-gradient(180deg,#4aa3ff,#2d8fe6);
        color: #fff;
        border: none;
        font-weight: 700;
        box-shadow: 0 6px 18px rgba(45,143,230,0.16);
        transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    }

    #skyboxClearButton {
        background: linear-gradient(180deg,#eff6fb,#cfe5fb);
        color: #0b2640;
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    }

    .skybox-actions button:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 28px rgba(45,143,230,0.22);
    }

    .skybox-hint {
        font-size: 12px;
        color: #b9c3c9;
        margin-top: 8px;
        opacity: 0.95;
    }

    /* Agrega esto a tu style.css */
    .archivos-lista div {
        padding-left: 8px;
        border-left: 1px solid #444;
        margin-bottom: 2px;
    }

    .predetermined-module-item {
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        margin: 10px 0;
        background-color: #f9f9f9;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .module-info h4 {
        margin: 0 0 5px 0;
        color: #333;
    }

    .module-info p {
        margin: 2px 0;
        font-size: 12px;
        color: #666;
    }

    .load-model-btn {
        background-color: #4CAF50;
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        cursor: pointer;
        font-size: 14px;
    }

    .load-model-btn:hover {
        background-color: #45a049;
    }

    /* Biblioteca SKP */
    .skp-library-section {
        background: white;
        border-radius: 8px;
        padding: 20px;
        margin: 20px 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .skp-library-section h3 {
        margin: 0 0 15px 0;
        color: #333;
        border-bottom: 2px solid #4CAF50;
        padding-bottom: 10px;
    }

    #skp-library-container {
        max-height: 600px;
        overflow-y: auto;
        border: 1px solid #e0e0e0;
        border-radius: 5px;
        padding: 15px;
    }

    .skp-category {
        margin-bottom: 20px;
    }

    .skp-category-header {
        background: #f5f5f5;
        padding: 10px;
        margin: 0 0 10px 0;
        border-radius: 5px;
        color: #555;
        font-size: 16px;
        border-left: 4px solid #4CAF50;
    }

    .skp-files-list {
        margin-left: 15px;
    }

    .skp-file-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        margin: 8px 0;
        background: #fafafa;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .skp-file-item:hover {
        background: #f0f0f0;
        border-color: #4CAF50;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .skp-file-info {
        flex-grow: 1;
    }

    .skp-file-name {
        font-weight: bold;
        color: #333;
        margin-bottom: 5px;
    }

    .skp-file-details {
        font-size: 12px;
        color: #666;
    }

    .skp-file-size {
        background: #e3f2fd;
        padding: 2px 6px;
        border-radius: 3px;
        margin-right: 10px;
    }

    .skp-file-path {
        font-family: monospace;
        background: #f5f5f5;
        padding: 2px 6px;
        border-radius: 3px;
    }

    .skp-file-actions {
        display: flex;
        gap: 8px;
    }

    .btn-load-skp, .btn-preview-skp {
        padding: 8px 12px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.3s ease;
    }

    .btn-load-skp {
        background: #4CAF50;
        color: white;
    }

    .btn-load-skp:hover {
        background: #45a049;
    }

    .btn-preview-skp {
        background: #2196F3;
        color: white;
    }

    .btn-preview-skp:hover {
        background: #1976D2;
    }

    #refresh-skp-library {
        background: #FF9800;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        margin-top: 15px;
    }

    #refresh-skp-library:hover {
        background: #F57C00;
    }

    /* Modal de vista previa */
    .skp-preview-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.8);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 10000;
    }

    .skp-preview-content {
        background: white;
        border-radius: 10px;
        padding: 20px;
        max-width: 400px;
        width: 90%;
    }

    .skp-preview-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }

    .skp-preview-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #666;
    }

    .skp-preview-container {
        width: 100%;
        height: 300px;
        border: 1px solid #ddd;
        border-radius: 5px;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 15px;
    }

    .skp-preview-actions {
        text-align: center;
    }

    .btn-load-from-preview {
        background: #4CAF50;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
    }

    /* Indicador de carga */
    #skp-loading-indicator {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255,255,255,0.9);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    .loading-content {
        text-align: center;
        background: white;
        padding: 30px;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #4CAF50;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 15px;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .loading-progress {
        width: 200px;
        height: 6px;
        background: #f0f0f0;
        border-radius: 3px;
        margin: 15px auto 0;
        overflow: hidden;
    }

    .progress-bar {
        height: 100%;
        background: #4CAF50;
        width: 0%;
        transition: width 0.3s ease;
    }

    /* Notificaciones */
    .skp-notification {
        position: fixed;
        top: 20px;
        right: 20px;
        padding: 15px 20px;
        border-radius: 5px;
        color: white;
        z-index: 10001;
        animation: slideIn 0.3s ease;
    }

    .skp-notification.success {
        background: #4CAF50;
    }

    .skp-notification.error {
        background: #f44336;
    }

    .skp-notification.info {
        background: #2196F3;
    }

    @keyframes slideIn {
        from { transform: translateX(100%); }
        to { transform: translateX(0); }
    }

    #modulosTree {
        font-size: 15px;
        color: #fff;
        padding-left: 0;
        margin-bottom: 12px;
    }

    #modulosTree details {
        margin-bottom: 4px;
        margin-left: 0;
        background: none;
        border-radius: 6px;
        transition: background 0.2s;
    }

    #modulosTree details[open] > summary {
        background: #22384a;
        color: #2ecc71;
    }

    #modulosTree summary {
        list-style: none;
        cursor: pointer;
        font-weight: 600;
        padding: 6px 8px 6px 28px;
        border-radius: 6px;
        position: relative;
        transition: background 0.2s, color 0.2s;
        margin-bottom: 2px;
        user-select: none;
    }

    #modulosTree summary::before {
        content: "📂";
        position: absolute;
        left: 6px;
        top: 6px;
        font-size: 16px;
        transition: color 0.2s;
    }

    #modulosTree details[open] > summary::before {
        content: "📁";
        color: #2ecc71;
    }

    #modulosTree button.stl-file-btn {
        display: block;
        width: 92%;
        margin: 4px auto 4px 28px;
        background: #2ecc71;
        color: #fff;
        border: none;
        border-radius: 6px;
        padding: 6px 8px 6px 28px;
        text-align: left;
        cursor: pointer;
        font-size: 14px;
        position: relative;
        transition: background 0.2s, color 0.2s, box-shadow 0.2s;
        box-shadow: 0 1px 4px #0002;
    }

    #modulosTree button.stl-file-btn::before {
        content: "📄";
        position: absolute;
        left: 8px;
        top: 6px;
        font-size: 15px;
        opacity: 0.8;
    }

    #modulosTree button.stl-file-btn:hover {
        background: #27ae60;
        color: #fff;
        box-shadow: 0 2px 8px #27ae6040;
        transform: translateX(2px) scale(1.03);
    }

    .folder-item, .file-item {
        cursor: pointer;
        padding: 2px 0;
        display: flex;
        align-items: center;
    }
    .folder-item:hover, .file-item:hover {
        background: #2a3b4d;
        border-radius: 4px;
    }
    .folder-icon, .file-icon {
        margin-right: 6px;
    }

    #moduloGallery {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 10px;
        transition: max-height 0.3s;
    }

    .modulo-card {
        background: #232c3b;
        border-radius: 12px;
        box-shadow: 0 2px 8px #27ae6040;
        padding: 16px 18px;
        min-width: 160px;
        max-width: 180px;
        color: #fff;
        font-weight: 600;
        font-size: 15px;
        text-align: center;
        cursor: pointer;
        border: 2px solid #27ae60;
        transition: background 0.2s, transform 0.15s, border 0.2s;
        position: relative;
        margin-bottom: 4px;
    }

    .modulo-card:hover {
        background: #27ae60;
        color: #fff;
        transform: scale(1.04);
        border: 2px solid #ffd700;
    }

    #toggleModuloGalleryBtn {
        margin-bottom: 8px;
        background: #1F8A4D;
        border-radius: 8px;
        color: #fff;
        font-weight: 700;
        padding: 8px 18px;
        cursor: pointer;
        border: none;
        box-shadow: 0 2px 8px #27ae6040;
        transition: background 0.2s, transform 0.15s;
    }

    #toggleModuloGalleryBtn:hover {
        background: #27ae60;
        transform: scale(1.04);
    }

    /* Elimina la barra de desplazamiento horizontal global */
    html, body {
    overflow-x: hidden !important;
    }

    /* =====================
    TUTORIAL INTERACTIVO
    ===================== */

    #tutorialOverlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: transparent;
        /* Asegurar que el overlay (y su popup hijo) esté por encima de la máscara */
        z-index: 100002;
        align-items: center;
        justify-content: center;
        animation: fadeIn 0.3s ease;
        pointer-events: none;
    }

    /* Solo aplicar backdrop cuando NO hay highlight */
    #tutorialOverlay:not(.has-highlight) {
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(2px);
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    .tutorial-popup {
        background: linear-gradient(145deg, #1a2332 0%, #2a3544 100%);
        border-radius: 20px;
        max-width: 600px;
        width: 90vw;
        padding: 0;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(46, 232, 139, 0.1);
        position: fixed;
        overflow: hidden;
        animation: tutorialSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        /* Más alto que la máscara y otros elementos del overlay */
        z-index: 100003;
        transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                    left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: auto;
    }

    @keyframes tutorialSlideIn {
        /* Importante: no animar 'transform' aquí para no sobrescribir
        el translate(-50%,-50%) que centra el popup al inicio. */
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes tutorialFadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    .tutorial-body > * {
        animation: tutorialFadeIn 0.3s ease-out;
    }

    .tutorial-header {
        background: linear-gradient(135deg, #27ae60 0%, #1f8a4d 100%);
        padding: 24px 28px;
        position: relative;
        overflow: hidden;
    }

    .tutorial-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        animation: headerGlow 3s ease-in-out infinite;
    }

    @keyframes headerGlow {
        0%, 100% { transform: translate(0, 0); }
        50% { transform: translate(-10px, -10px); }
    }

    .tutorial-title {
        margin: 0;
        font-size: 26px;
        font-weight: 800;
        color: #ffffff;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        position: relative;
        z-index: 1;
    }

    .tutorial-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: white;
        font-size: 26px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 2;
        line-height: 1;
    }

    .tutorial-close:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: rotate(90deg) scale(1.1);
    }

    .tutorial-progress {
        height: 6px;
        background: rgba(255, 255, 255, 0.15);
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .tutorial-progress-bar {
        height: 100%;
        background: linear-gradient(90deg, #2ecc71, #27ae60);
        transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 10px rgba(46, 232, 139, 0.5);
    }

    .tutorial-body {
        padding: 32px 28px;
    }

    .tutorial-step-counter {
        display: inline-block;
        background: rgba(39, 174, 96, 0.15);
        color: #2ecc71;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 16px;
        border: 1px solid rgba(39, 174, 96, 0.3);
    }

    .tutorial-text {
        color: #e0e6ed;
        font-size: 16px;
        line-height: 1.7;
        margin: 0 0 28px 0;
    }

    .tutorial-actions {
        display: flex;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
    }

    .tutorial-skip {
        background: transparent;
        color: #94a3b8;
        border: none;
        padding: 12px 18px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .tutorial-skip:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #cbd5e1;
    }

    .tutorial-nav-buttons {
        display: flex;
        gap: 10px;
    }

    .tutorial-prev,
    .tutorial-next {
        padding: 12px 24px;
        border: none;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .tutorial-prev {
        background: rgba(255, 255, 255, 0.08);
        color: #e0e6ed;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .tutorial-prev:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateX(-2px);
    }

    .tutorial-next {
        background: linear-gradient(135deg, #27ae60, #1f8a4d);
        color: white;
        box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
    }

    .tutorial-next:hover {
        background: linear-gradient(135deg, #2ecc71, #27ae60);
        box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
        transform: translateY(-2px);
    }

    .tutorial-next:active,
    .tutorial-prev:active {
        transform: scale(0.97);
    }

    /* Highlight animado - claramente visible sobre el área nítida */
    .tutorial-highlight {
        position: fixed;
        border: 3px solid #27ae60;
        border-radius: 12px;
        pointer-events: none;
        z-index: 99999;
        box-shadow: 
            0 0 0 4px rgba(39, 174, 96, 0.4),
            0 0 0 8px rgba(39, 174, 96, 0.2),
            0 0 30px rgba(39, 174, 96, 0.6),
            0 0 60px rgba(39, 174, 96, 0.4),
            inset 0 0 0 2px rgba(255, 255, 255, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(39, 174, 96, 0.08);
    }

    @keyframes tutorialPulse {
        0%, 100% {
            box-shadow: 
                0 0 0 4px rgba(39, 174, 96, 0.3),
                0 0 0 8px rgba(39, 174, 96, 0.15),
                0 0 30px rgba(39, 174, 96, 0.5),
                inset 0 0 30px rgba(39, 174, 96, 0.1);
        }
        50% {
            box-shadow: 
                0 0 0 6px rgba(39, 174, 96, 0.4),
                0 0 0 12px rgba(39, 174, 96, 0.2),
                0 0 40px rgba(39, 174, 96, 0.6),
                inset 0 0 40px rgba(39, 174, 96, 0.15);
        }
    }

    /* Indicadores de teclado */
    .tutorial-keyboard-hint {
        text-align: center;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 12px;
        color: #94a3b8;
    }

    .tutorial-keyboard-hint kbd {
        background: rgba(255, 255, 255, 0.1);
        padding: 4px 8px;
        border-radius: 4px;
        font-family: monospace;
        font-size: 11px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        margin: 0 2px;
    }

    /* Flecha indicadora */
    .tutorial-arrow {
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        z-index: 1;
        animation: arrowBounce 1.5s ease-in-out infinite;
    }

    @keyframes arrowBounce {
        0%, 100% { transform: translateY(0) translateX(0); }
        50% { transform: translateY(-3px) translateX(-3px); }
    }

    .tutorial-arrow.arrow-left,
    .tutorial-arrow.arrow-right {
        animation-name: arrowBounceHorizontal;
    }

    @keyframes arrowBounceHorizontal {
        0%, 100% { transform: translateY(-50%) translateX(0); }
        50% { transform: translateY(-50%) translateX(-3px); }
    }

    /* Backdrop mejorado cuando hay highlight - sin blur en área resaltada */
    #tutorialOverlay.has-highlight {
        background: transparent;
    }

    #tutorialOverlay.has-highlight::before {
        backdrop-filter: none;
    }

    /* Crear capas de overlay con recorte SVG */
    .tutorial-overlay-mask {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        /* Debajo del overlay y del popup */
        z-index: 100001;
        pointer-events: none;
    }

    .tutorial-overlay-mask svg {
        width: 100%;
        height: 100%;
    }

    /* Animación de entrada más suave para el popup */
    @keyframes tutorialPopupSlide {
        from {
            opacity: 0;
            transform: scale(0.9);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .tutorial-popup.animated {
        animation: tutorialPopupSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* Mejora para elementos pequeños */
    .tutorial-highlight.small-element {
        border-width: 2px;
        box-shadow: 
            0 0 0 3px rgba(39, 174, 96, 0.25),
            0 0 0 6px rgba(39, 174, 96, 0.15),
            0 0 20px rgba(39, 174, 96, 0.5);
    }

    /* Responsive */
    @media (max-width: 768px) {
        .tutorial-popup {
            width: 95vw;
            max-width: none;
            position: fixed !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
        }
        
        .tutorial-title {
            font-size: 22px;
        }
        
        .tutorial-text {
            font-size: 15px;
        }
        
        .tutorial-actions {
            flex-direction: column-reverse;
            gap: 8px;
        }
        
        .tutorial-nav-buttons {
            width: 100%;
        }
        
        .tutorial-prev,
        .tutorial-next {
            flex: 1;
            justify-content: center;
        }
        
        .tutorial-skip {
            width: 100%;
        }

        /* Ocultar flechas en móviles */
        .tutorial-arrow {
            display: none;
        }

        /* Ajustar highlight en móviles */
        .tutorial-highlight {
            border-width: 2px;
        }
    }

    /* Mejoras para pantallas muy pequeñas */
    @media (max-width: 480px) {
        .tutorial-body {
            padding: 24px 20px;
        }

        .tutorial-header {
            padding: 20px 24px;
        }

        .tutorial-title {
            font-size: 20px;
            padding-right: 30px;
        }

        .tutorial-close {
            width: 35px;
            height: 35px;
            font-size: 22px;
            top: 15px;
            right: 15px;
        }

        .tutorial-keyboard-hint {
            font-size: 11px;
            display: none; /* Ocultar hints de teclado en móviles */
        }
    }

    /* Mejoras para pantallas grandes */
    @media (min-width: 1400px) {
        .tutorial-popup {
            max-width: 700px;
        }

        .tutorial-title {
            font-size: 28px;
        }

        .tutorial-text {
            font-size: 17px;
        }
    }

