/* ========================================== */
        /* ESTILOS GENERALES DE LA HERRAMIENTA BASE   */
        /* ========================================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* ========================================== */
        /* CONFIGURACIÓN GLOBAL CSS (COLORES)         */
        /* ========================================== */
        :root {
            /* Colores por defecto (Basados en Guía BibleArc Profunda) */
            --color-sustantivo: #dc3545;  /* Rojo */
            --color-verbo: #28a745;       /* Verde */
            --color-pronombre: #6f42c1;   /* Morado */
            --color-determinante: #fd7e14;/* Naranja */
            --color-genitivo: #007bff;    /* Azul */
            --color-preposicion: #ffc107; /* Amarillo */
            --color-adjetivo: #ff66b2;    /* Rosado */
            --color-adverbio: #6c757d;    /* Gris */
            --color-secundario: #b19cd9;  /* Lila */

            /* Tema (Light por defecto) */
            --theme-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --theme-container: #ffffff;
            --theme-surface: #ffffff;
            --theme-text: #333333;
            --theme-text-muted: #666666;
            --theme-border: #eaeaea;
            --theme-input-bg: #ffffff;
            --theme-input-border: #cccccc;

            /* Tipografía */
            --workspace-font: 'Lora', serif;
            --workspace-font-size: 16px;
        }

        /* ========================================== */
        /* MODO OSCURO                                */
        /* ========================================== */
        body.dark-mode {
            --theme-bg: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 100%);
            --theme-container: #1e1e2e;
            --theme-surface: #2a2a3e;
            --theme-text: #e0e0e0;
            --theme-text-muted: #aaaaaa;
            --theme-border: #3a3a5a;
            --theme-input-bg: #2a2a3e;
            --theme-input-border: #4a4a6a;
        }
        body.dark-mode .container { background: var(--theme-container) !important; }
        body.dark-mode .section { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
        body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4 { color: var(--theme-text) !important; }
        body.dark-mode p, body.dark-mode label, body.dark-mode li { color: var(--theme-text-muted) !important; }
        body.dark-mode .glass-card { background: rgba(42, 42, 62, 0.7) !important; border-color: rgba(255, 255, 255, 0.05) !important; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important; }
        body.dark-mode .config-panel-header { border-bottom-color: rgba(255, 255, 255, 0.05) !important; }
        body.dark-mode #colorConfigPanel > div { border-bottom-color: rgba(255,255,255,0.05) !important; color: var(--theme-text) !important; }
        body.dark-mode .config-input, body.dark-mode .config-select { background: var(--theme-input-bg) !important; border-color: var(--theme-input-border) !important; color: var(--theme-text) !important; }
        body.dark-mode .input-with-icon { background: var(--theme-input-bg) !important; border-color: var(--theme-input-border) !important; }
        body.dark-mode .input-with-icon input { background: transparent !important; color: var(--theme-text) !important; }
        body.dark-mode .status-indicator-box { background: rgba(0,0,0,0.2) !important; border-color: rgba(255,255,255,0.05) !important; }
        body.dark-mode .radio-pill { border-color: var(--theme-input-border) !important; color: var(--theme-text) !important; }
        body.dark-mode .radio-pill input:checked + span { background: #4a4a8a; color: white; border-color: #6a6aaa; }
        body.dark-mode .radio-pill:hover { background: rgba(255,255,255,0.05); }
        body.dark-mode .nav-buttons a, body.dark-mode .shortcut-btn { background: #2a2a3e !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
        body.dark-mode .nav-buttons a.active { background: #4a4a8a !important; color: white !important; }
        body.dark-mode .shortcuts-bar { background: rgba(30,30,46,0.95) !important; border-color: var(--theme-border) !important; }
        body.dark-mode .interactive-workspace { background: #181828 !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
        body.dark-mode .font-option span { color: var(--theme-text) !important; }
        body.dark-mode .sub-tab-btn { background: #2a2a3e !important; color: #aaa !important; }
        body.dark-mode .sub-tab-btn.active { background: #4a4a8a !important; color: white !important; }

        /* ========================================== */
        /* TARJETAS DE CONFIGURACIÓN PREMIUM          */
        /* ========================================== */
        .config-header-container { text-align: center; margin-bottom: 35px; border-bottom: 2px dashed rgba(0,0,0,0.1); padding-bottom: 25px; }
        body.dark-mode .config-header-container { border-bottom-color: rgba(255,255,255,0.1); }
        .config-hint-text { color: #888; font-size: 0.95em; margin-top: 10px; font-style: italic; }

        .config-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
            gap: 25px;
        }

        .glass-card {
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255,255,255,0.8);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
        }
        .glass-card:hover { transform: translateY(-5px); box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255,255,255,0.9); }

        .config-panel-header { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid rgba(0,0,0,0.05); }
        .config-panel-icon-box {
            min-width: 55px; height: 55px; display: flex; align-items: center; justify-content: center; font-size: 1.8em;
            border-radius: 14px; color: white; box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        }
        .gradient-ai { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
        .gradient-ui { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); }
        .gradient-save { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
        .gradient-palette { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
        
        .config-panel-title { margin: 0 0 5px 0; font-size: 1.25em; color: #1e3c72; font-weight: 700; line-height: 1.2; }
        .config-panel-desc { color: #666; font-size: 0.9em; margin: 0; line-height: 1.4; }
        
        .config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .config-grid .span-2 { grid-column: span 2; }
        @media (max-width: 600px) { .config-grid { grid-template-columns: 1fr; } .config-grid .span-2 { grid-column: span 1; } }

        .config-item { display: flex; flex-direction: column; gap: 6px; }
        .flex-row-between { flex-direction: row; align-items: center; justify-content: space-between; }
        
        .config-label { font-weight: 700; font-size: 0.85em; color: #444; text-transform: uppercase; letter-spacing: 0.5px; }
        .config-sub-label { font-size: 0.8em; color: #777; margin: 0; }
        .highlight-val { color: #1e3c72; font-weight: 800; background: rgba(30, 60, 114, 0.1); padding: 2px 6px; border-radius: 4px; }

        /* Inputs Premium */
        .input-with-icon { display: flex; align-items: center; border: 1px solid #ccc; border-radius: 10px; background: white; overflow: hidden; transition: all 0.2s; }
        .input-with-icon:focus-within { border-color: #1e3c72; box-shadow: 0 0 0 3px rgba(30,60,114,0.15); transform: translateY(-1px); }
        .input-with-icon span { padding: 10px 5px 10px 15px; font-size: 1.1em; color: #666; }
        .input-with-icon input { border: none; outline: none; padding: 12px 15px 12px 5px; flex-grow: 1; font-size: 0.95em; background: transparent; }
        
        .config-select { width: 100%; border: 1px solid #ccc; padding: 12px 15px; border-radius: 10px; font-size: 0.95em; background: white; cursor: pointer; transition: all 0.2s; appearance: auto; }
        .config-select:focus { border-color: #1e3c72; outline: none; box-shadow: 0 0 0 3px rgba(30,60,114,0.15); }
        
        .styled-link { font-size: 0.85em; font-weight: bold; color: #2a5298; text-decoration: none; margin-top: 4px; display: inline-block; transition: opacity 0.2s; }
        .styled-link:hover { opacity: 0.8; text-decoration: underline; }

        /* Sliders */
        .config-slider { width: 100%; margin: 8px 0; -webkit-appearance: none; height: 6px; border-radius: 3px; outline: none; }
        .config-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; transition: 0.2s; }
        .gradient-slider { background: linear-gradient(90deg, #e0c3fc 0%, #8ec5fc 100%); }
        .gradient-slider::-webkit-slider-thumb { background: #764ba2; box-shadow: 0 0 10px rgba(118,75,162,0.5); }
        .blue-slider { background: linear-gradient(90deg, #e3f2fd 0%, #90caf9 100%); }
        .blue-slider::-webkit-slider-thumb { background: #1e3c72; box-shadow: 0 0 10px rgba(30,60,114,0.5); }
        .green-slider { background: linear-gradient(90deg, #d4edda 0%, #a3d3af 100%); }
        .green-slider::-webkit-slider-thumb { background: #28a745; box-shadow: 0 0 10px rgba(40,167,69,0.5); }
        
        .slider-labels { display: flex; justify-content: space-between; font-size: 0.75em; color: #888; font-weight: 600; }

        /* Toggle Switch Premium */
        .toggle-container { display: flex; align-items: center; gap: 10px; }
        .toggle-status { font-size: 0.8em; font-weight: 700; color: #888; text-transform: uppercase; }
        .toggle-switch { position: relative; display: inline-block; width: 50px; height: 26px; vertical-align: middle; }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ddd; border-radius: 26px; transition: 0.4s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
        .toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: 0.4s; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
        .toggle-switch input:checked + .toggle-slider { background-color: #4cd964; }
        .toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }

        /* Radio Pills */
        .radio-pill-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
        .radio-pill { position: relative; display: inline-block; cursor: pointer; }
        .radio-pill input { position: absolute; opacity: 0; cursor: pointer; }
        .radio-pill span { display: block; padding: 10px 15px; border-radius: 12px; border: 1px solid #ddd; background: white; font-size: 0.95em; color: #555; transition: all 0.2s; font-weight: 600; }
        .radio-pill input:checked + span { background: #f0f4ff; color: #1e3c72; border-color: #1e3c72; box-shadow: 0 4px 10px rgba(30,60,114,0.1); transform: translateY(-2px); }
        .radio-pill:hover span { background: #fafafa; border-color: #bbb; }

        /* Status Indicator */
        .status-indicator-box { display: flex; align-items: center; gap: 15px; background: rgba(248, 249, 250, 0.8); padding: 15px; border-radius: 12px; border: 1px dashed #ccc; }
        .pulse-dot { width: 12px; height: 12px; background: #2ecc71; border-radius: 50%; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); animation: pulse 2s infinite; }
        @keyframes pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); } }
        .status-content p { margin: 0; font-size: 0.85em; color: #666; }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
        }

        .container {
            width: 98%;
            max-width: 1920px;
            margin: 0 auto;
            padding: 25px 40px;
            background: white;
            margin-top: 20px;
            margin-bottom: 20px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
        }

        /* Ajustes responsivos para que el padding no estorbe en móviles */
        @media (max-width: 768px) {
            .container {
                width: 100%;
                padding: 15px;
                margin-top: 0;
                margin-bottom: 0;
                border-radius: 0;
            }
        }

        .header {
            text-align: center;
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
            padding: 30px;
            border-radius: 15px;
            margin-bottom: 30px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .header h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }

        .header p {
            font-size: 1.2em;
            opacity: 0.9;
        }

        /* ========================================== */
        /* ENVOLTORIO DE NAVEGACIÓN Y ACCESOS         */
        /* ========================================== */
        .sticky-nav-wrapper {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 30px;
        }

        /* ACCESOS DIRECTOS (ELEGANTE Y DISCRETO) */
        .shortcuts-bar {
            position: sticky;
            top: 10px;
            z-index: 900;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 8px 20px;
            border-radius: 10px;
            display: flex;
            gap: 12px;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .shortcut-text {
            font-size: 12px;
            color: #888;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .shortcut-btn {
            background: white;
            border: 1px solid #e0e0e0;
            color: #555;
            padding: 4px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
            font-size: 12px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
        }

        .shortcut-btn:hover {
            background: #f8f9fa;
            color: #1e3c72;
            border-color: #1e3c72;
            transform: translateY(-1px);
        }

        /* NAVEGACIÓN PRINCIPAL (PASOS - ELEGANTE) */
        .nav-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 10px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .nav-btn {
            background: transparent;
            color: #555;
            border: none;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
            text-decoration: none;
            font-size: 14px;
        }

        .nav-btn:hover {
            background: rgba(0, 0, 0, 0.03);
            color: #1e3c72;
            transform: translateY(-1px);
        }

        .nav-btn.active {
            background: #1e3c72;
            color: white;
            box-shadow: 0 4px 10px rgba(30, 60, 114, 0.3);
            transform: translateY(-1px);
        }

        /* SUB-PESTAÑAS (INTERNAS) */
        .sub-tabs-container {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-bottom: 20px;
            border-bottom: 3px solid #2a5298;
            padding-bottom: 0;
        }

        .sub-tab-btn {
            background: #e8f4fd;
            color: #1e3c72;
            border: 1px solid #c5dcf1;
            border-bottom: none;
            padding: 12px 20px;
            border-radius: 10px 10px 0 0;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
            font-size: 15px;
        }

        .sub-tab-btn:hover {
            background: #d6e9f7;
        }

        .sub-tab-btn.active {
            background: #2a5298;
            color: white;
            border-color: #2a5298;
        }

        .sub-tab-content {
            display: none;
            animation: fadeIn 0.4s;
        }

        .sub-tab-content.active {
            display: block;
        }

        /* SECCIONES PRINCIPALES */
        .section {
            display: none;
            margin-bottom: 40px;
            background: #f8f9fa;
            padding: 30px;
            border-radius: 15px;
            border-left: 5px solid #2a5298;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
            animation: fadeIn 0.5s ease-out forwards;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .section h2 {
            color: #1e3c72;
            font-size: 2em;
            margin-bottom: 20px;
            border-bottom: 3px solid #feb47b;
            padding-bottom: 10px;
        }

        .section h3 {
            color: #2a5298;
            font-size: 1.5em;
            margin: 25px 0 15px 0;
            background: linear-gradient(135deg, #e8f4fd 0%, #d6e9f7 100%);
            padding: 15px;
            border-radius: 10px;
            border-left: 4px solid #2a5298;
        }

        .section h4 {
            color: #ff7e5f;
            font-size: 1.2em;
            margin: 15px 0 10px 0;
        }

        /* CAJAS DE INFORMACIÓN */
        .highlight-box {
            background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
            padding: 20px;
            border-radius: 10px;
            margin: 20px 0;
            border-left: 5px solid #ff7e5f;
        }

        .example-box {
            background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
            padding: 20px;
            border-radius: 10px;
            margin: 15px 0;
            border-left: 5px solid #28a745;
        }

        .warning-box {
            background: linear-gradient(135deg, #fff3cd 0%, #fdeaa7 100%);
            padding: 20px;
            border-radius: 10px;
            margin: 15px 0;
            border-left: 5px solid #ffc107;
        }

        .info-box {
            background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
            padding: 20px;
            border-radius: 10px;
            margin: 15px 0;
            border-left: 5px solid #17a2b8;
        }

        .connection-box {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            padding: 20px;
            border-radius: 10px;
            margin: 20px 0;
            border-left: 5px solid #2196f3;
        }

        /* GRIDS Y TARJETAS */
        .types-grid,
        .relations-grid,
        .genitive-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin: 20px 0;
        }

        .type-card {
            background: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
            border-top: 4px solid #2a5298;
            transition: transform 0.3s ease;
        }

        .type-card:hover {
            transform: translateY(-5px);
        }

        .type-card h4 {
            color: #1e3c72;
            margin-bottom: 15px;
            font-size: 1.3em;
        }

        .type-card h5 {
            color: #ff7e5f;
            margin-bottom: 10px;
            font-size: 1.1em;
        }

        .relation-card {
            background: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border-left: 4px solid #ff7e5f;
        }

        .relation-card h5 {
            color: #1e3c72;
            margin-bottom: 8px;
            font-size: 1em;
        }

        .genitive-card {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            padding: 15px;
            border-radius: 8px;
            border-top: 3px solid #28a745;
        }

        /* TABLAS Y LISTAS */
        .table-container {
            overflow-x: auto;
            margin: 20px 0;
            border-radius: 10px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        }

        .standard-table {
            width: 100%;
            border-collapse: collapse;
            background: white;
        }

        .standard-table th {
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            color: white;
            padding: 15px;
            text-align: left;
            font-weight: bold;
        }

        .standard-table td {
            padding: 12px 15px;
            border-bottom: 1px solid #dee2e6;
        }

        .standard-table tr:nth-child(even) {
            background: #f8f9fa;
        }

        .simple-list {
            background: white;
            padding: 20px;
            border-radius: 10px;
            margin: 15px 0;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .simple-list h4 {
            color: #1e3c72;
            margin-bottom: 15px;
            border-bottom: 2px solid #feb47b;
            padding-bottom: 8px;
        }

        .simple-list ol {
            counter-reset: item;
            padding-left: 0;
        }

        .simple-list ol>li {
            display: block;
            margin-bottom: 15px;
            padding: 12px 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid #2a5298;
            counter-increment: item;
        }

        .simple-list ol>li:before {
            content: counter(item, decimal) ". ";
            font-weight: bold;
            color: #2a5298;
        }

        .simple-list ul>li {
            margin-bottom: 8px;
            padding: 8px 0;
            border-bottom: 1px solid #e9ecef;
        }

        .simple-list ul>li:last-child {
            border-bottom: none;
        }

        /* VARIOS */
        .intro-text {
            font-size: 1.1em;
            line-height: 1.8;
            color: #555;
            margin-bottom: 20px;
            text-align: justify;
        }

        code {
            background: #f1f3f4;
            padding: 3px 8px;
            border-radius: 4px;
            font-family: 'Courier New', monospace;
            color: #d63384;
            font-weight: bold;
        }

        strong {
            color: #1e3c72;
        }

        .back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
            color: white;
            border: none;
            padding: 15px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .back-to-top:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        }

        /* ========================================== */
        /* ESTILOS EXACTOS DE LA GUÍA DE COLORES      */
        /* ========================================== */
        .color-tabs-container {
            background: #2a5298;
            display: flex;
            justify-content: center;
            gap: 5px;
            padding: 0;
            border-radius: 10px 10px 0 0;
        }

        .color-tab-button {
            flex: 1;
            max-width: 400px;
            padding: 20px 30px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 1.1em;
            font-weight: bold;
            transition: all 0.3s ease;
            border-bottom: 4px solid transparent;
        }

        .color-tab-button:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .color-tab-button.active {
            background: white;
            color: #1e3c72;
            border-bottom: 4px solid #ffc107;
        }

        .color-tab-content-inner {
            display: none;
            padding: 30px;
            animation: fadeIn 0.5s;
            background: white;
            border-radius: 0 0 10px 10px;
        }

        .color-tab-content-inner.active {
            display: block;
        }

        .palette-section {
            background: #fff3cd;
            border-left: 5px solid #ffc107;
            padding: 20px;
            margin-bottom: 30px;
            border-radius: 5px;
        }

        .palette-section h2 {
            color: #856404;
            margin-bottom: 15px;
            text-align: center;
        }

        .palette-info {
            background: #e8f5e8;
            border: 2px solid #28a745;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
        }

        .palette-info h3 {
            color: #155724;
            margin-bottom: 10px;
        }

        .level-badge {
            display: inline-block;
            padding: 5px 15px;
            border-radius: 20px;
            font-weight: bold;
            margin: 5px;
        }

        .badge-beginner {
            background: #28a745;
            color: white;
        }

        .badge-intermediate {
            background: #ffc107;
            color: #333;
        }

        .badge-advanced {
            background: #dc3545;
            color: white;
        }

        .color-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .color-section {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            border-top: 5px solid;
        }

        .color-section.red {
            border-top-color: #dc3545;
        }

        .color-section.green {
            border-top-color: #28a745;
        }

        .color-section.cyan {
            border-top-color: #17a2b8;
        }

        .color-section.orange {
            border-top-color: #fd7e14;
        }

        .color-section.purple {
            border-top-color: #6f42c1;
        }

        .color-section.yellow {
            border-top-color: #ffc107;
        }

        .color-section.pink {
            border-top-color: #ff66b2;
        }

        .color-section.lilac {
            border-top-color: #b19cd9;
        }

        .color-section.blue {
            border-top-color: #007bff;
        }

        .color-section.gray {
            border-top-color: #6c757d;
        }

        .color-header {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }

        .color-box {
            width: 30px;
            height: 30px;
            border-radius: 5px;
            margin-right: 15px;
            border: 2px solid #333;
        }

        .red-box {
            background-color: var(--color-sustantivo);
        }

        .green-box {
            background-color: var(--color-verbo);
        }

        .cyan-box {
            background-color: var(--color-secundario);
        }

        .orange-box {
            background-color: var(--color-determinante);
        }

        .purple-box {
            background-color: var(--color-pronombre);
        }

        .yellow-box {
            background-color: var(--color-preposicion);
        }

        .pink-box {
            background-color: var(--color-adjetivo);
        }

        .lilac-box {
            background-color: var(--color-secundario);
        }

        .blue-box {
            background-color: var(--color-genitivo);
        }

        .gray-box {
            background-color: var(--color-adverbio);
        }

        .color-title {
            font-size: 1.2em;
            font-weight: bold;
            color: #333;
        }

        .usage-list {
            list-style: none;
            margin-bottom: 15px;
        }

        .usage-list li {
            padding: 8px 0;
            border-bottom: 1px solid #e9ecef;
            display: flex;
            align-items: center;
        }

        .usage-list li:last-child {
            border-bottom: none;
        }

        .mark-type {
            background: #e9ecef;
            padding: 3px 8px;
            border-radius: 15px;
            font-size: 0.8em;
            font-weight: bold;
            margin-right: 10px;
            min-width: 110px;
            text-align: center;
        }

        .count-badge {
            background: #28a745;
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8em;
            font-weight: bold;
            margin-left: 10px;
        }

        .workflow {
            background: #d1ecf1;
            border-left: 5px solid #17a2b8;
            padding: 20px;
            border-radius: 5px;
            margin-bottom: 20px;
        }

        .workflow h3 {
            color: #0c5460;
            margin-bottom: 15px;
            text-align: center;
        }

        .workflow-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 15px;
        }

        .workflow-item {
            background: white;
            padding: 15px;
            border-radius: 8px;
            border: 2px solid #bee5eb;
        }

        .workflow-item h4 {
            color: #0c5460;
            margin-bottom: 10px;
        }

        .example-section {
            background: #f0f8ff;
            border-left: 5px solid #007bff;
            padding: 20px;
            border-radius: 5px;
            margin-bottom: 20px;
        }

        .example-section h3 {
            color: #004085;
            margin-bottom: 15px;
            text-align: center;
        }

        .biblical-text {
            background: white;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 15px;
            font-style: italic;
            font-size: 1.1em;
            line-height: 1.8;
        }

        .progression-path {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        .progression-path h3 {
            text-align: center;
            margin-bottom: 20px;
            font-size: 1.5em;
        }

        .progression-steps {
            display: flex;
            justify-content: space-around;
            align-items: center;
            flex-wrap: wrap;
            gap: 20px;
        }

        .step {
            background: rgba(255, 255, 255, 0.2);
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            min-width: 200px;
            backdrop-filter: blur(10px);
            color: white;
        }

        .step-number {
            background: white;
            color: #667eea;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px;
            font-weight: bold;
            font-size: 1.2em;
        }

        .arrow {
            font-size: 2em;
            color: white;
        }

        .secondary-note {
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            padding: 15px;
            border-radius: 5px;
            margin-top: 20px;
        }

        .secondary-note h4 {
            color: #721c24;
            margin-bottom: 10px;
        }

        .secondary-note p {
            color: #721c24;
            margin-bottom: 5px;
        }

        /* Tooltips (Actualizados para no cortarse) */
        .info-icon {
            display: inline-block;
            width: 20px;
            height: 20px;
            background: #17a2b8;
            color: white;
            border-radius: 50%;
            text-align: center;
            line-height: 20px;
            font-size: 0.8em;
            font-weight: bold;
            cursor: help;
            margin-left: 8px;
            position: relative;
        }

        .info-icon:hover {
            background: #138496;
            transform: scale(1.1);
        }

        .tooltip {
            visibility: hidden;
            opacity: 0;
            position: absolute;
            z-index: 1000;
            background: linear-gradient(135deg, #2c3e50, #34495e);
            color: white;
            padding: 15px;
            border-radius: 8px;
            width: max-content;
            max-width: 320px;
            bottom: 130%;
            left: 50%;
            transform: translateX(-50%);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
            transition: opacity 0.3s, visibility 0.3s;
            text-align: left;
            font-weight: normal;
            font-style: normal;
            line-height: 1.4;
            text-transform: none;
        }

        .tooltip::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border-width: 5px;
            border-style: solid;
            border-color: #34495e transparent transparent transparent;
        }

        .info-icon:hover .tooltip {
            visibility: visible;
            opacity: 1;
        }

        .tooltip-title {
            font-weight: bold;
            margin-bottom: 8px;
            font-size: 1.1em;
            border-bottom: 2px solid rgba(255, 255, 255, 0.3);
            padding-bottom: 5px;
        }

        .tooltip-definition {
            font-style: italic;
            margin-bottom: 8px;
            opacity: 0.9;
        }

        .tooltip-categories {
            background: rgba(255, 255, 255, 0.15);
            padding: 8px;
            border-radius: 5px;
            margin: 8px 0;
            font-size: 0.85em;
        }

        .tooltip-categories-title {
            font-weight: bold;
            color: #ffc107;
            margin-bottom: 5px;
        }

        .tooltip-example {
            background: rgba(255, 255, 255, 0.1);
            padding: 8px;
            border-radius: 5px;
            margin-top: 8px;
            font-size: 0.9em;
        }

        .tooltip-example strong {
            color: #ffc107;
        }

        /* Terminos Gramaticales en Texto */
        .gram-term {
            position: relative;
            border-bottom: 1px dashed #2a5298;
            cursor: help;
            color: #2a5298;
            font-weight: bold;
        }

        .gram-term .tooltip {
            background: #2c3e50;
            padding: 10px 15px;
            border-radius: 6px;
            font-size: 13px;
            bottom: 130%;
        }

        .gram-term:hover .tooltip {
            visibility: visible;
            opacity: 1;
        }

        /* Anotaciones Frontales */
        .phrase-types {
            background: #e8f5e8;
            border-left: 5px solid #28a745;
            padding: 20px;
            border-radius: 5px;
            margin-bottom: 20px;
        }

        .phrase-types h3 {
            color: #155724;
            margin-bottom: 15px;
            text-align: center;
        }

        .phrase-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
        }

        .phrase-item {
            background: white;
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid;
            text-align: center;
        }

        .phrase-item.yellow {
            border-left-color: #ffc107;
        }

        .phrase-item.green {
            border-left-color: #cccc03;
        }

        .phrase-item.pink {
            border-left-color: #ff66b2;
        }

        .phrase-item.lilac {
            border-left-color: #b19cd9;
        }

        .phrase-item.red {
            border-left-color: #dc3545;
        }

        .phrase-item.purple {
            border-left-color: #6f42c1;
        }

        .phrase-item.cyan {
            border-left-color: #17a2b8;
        }

        .phrase-item.orange {
            border-left-color: #fd7e14;
        }

        .phrase-item.gray {
            border-left-color: #6c757d;
        }

        .phrase-item.green2 {
            border-left-color: #5db939;
        }

        .phrase-item.blue2 {
            border-left-color: #a1afff;
        }

        .phrase-item.blue {
            border-left-color: #007bff;
        }

        .phrase-annotation {
            display: inline-block;
            padding: 5px 10px;
            border-radius: 20px;
            font-weight: bold;
            color: white;
            margin-bottom: 8px;
        }

        .ann-yellow {
            background-color: #ffc107;
        }

        .ann-green {
            background-color: #cccc03;
        }

        .ann-green2 {
            background-color: #5db939;
        }

        .ann-pink {
            background-color: #ff66b2;
        }

        .ann-lilac {
            background-color: #b19cd9;
        }

        .ann-red {
            background-color: #dc3545;
        }

        .ann-purple {
            background-color: #6f42c1;
        }

        .ann-cyan {
            background-color: #17a2b8;
        }

        .ann-orange {
            background-color: #fd7e14;
        }

        .ann-gray {
            background-color: #6c757d;
        }

        .ann-blue {
            background-color: #007bff;
        }

        .ann-blue2 {
            background-color: #a1afff;
        }

        /* ========================================== */
        /* ESTILOS DE LA TABLA 27 RELACIONES          */
        /* ========================================== */
        .relaciones-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            font-size: 14px;
            background: white;
        }

        .relaciones-table th {
            background: #ecf0f1;
            color: #2c3e50;
            font-weight: bold;
            padding: 12px;
            text-align: left;
            border: 1px solid #bdc3c7;
            font-size: 1em;
        }

        .relaciones-table td {
            padding: 10px 12px;
            border: 1px solid #bdc3c7;
            vertical-align: top;
            line-height: 1.4;
            color: #333;
        }

        .category-header {
            font-weight: bold;
            font-size: 1.2em;
            text-align: center;
            padding: 15px !important;
            border: 2px solid #34495e !important;
        }

        .distinct-statement {
            background: #e8d5d5 !important;
            color: #2c3e50 !important;
        }

        .restatement {
            background: #d5e3f0 !important;
            color: #2c3e50 !important;
        }

        .contrary-statement {
            background: #f0e6d2 !important;
            color: #2c3e50 !important;
        }

        .number-col {
            width: 60px;
            text-align: center;
            font-weight: bold;
            background: #f8f9fa;
            color: #2c3e50;
        }

        .name-col {
            width: 200px;
            font-weight: bold;
            color: #2c3e50;
        }

        .english-name {
            color: #7f8c8d;
            font-style: italic;
            font-weight: normal;
            display: block;
            font-size: 0.9em;
        }

        .definition-col {
            min-width: 300px;
        }

        .phrases-col {
            width: 100px;
            text-align: center;
            font-family: 'Courier New', monospace;
            font-weight: bold;
            color: #27ae60;
        }

        .relaciones-table tr:nth-child(even) {
            background: #f8f9fa;
        }

        .relaciones-table tr:hover {
            background: #e3f2fd;
            transition: background-color 0.3s ease;
        }

        .phrase-code {
            display: inline-block;
            background: #ecf0f1;
            padding: 2px 6px;
            margin: 1px;
            border-radius: 3px;
            font-size: 0.9em;
            border: 1px solid #bdc3c7;
            color: #2c3e50;
        }

        .subcategory-note {
            background: #fff3cd;
            border: 1px solid #ffeaa7;
            padding: 15px;
            border-radius: 5px;
            margin: 20px 0;
            font-style: italic;
            color: #856404;
        }

        .main-relation td {
            background: #ffffff;
        }

        .sub-relation td {
            background: #f8f9fa;
        }

        @media (max-width: 768px) {

            .nav-buttons,
            .shortcuts-bar {
                flex-direction: row;
                flex-wrap: nowrap;
                overflow-x: auto;
                justify-content: flex-start;
                padding-bottom: 8px;
                -webkit-overflow-scrolling: touch;
            }

            .shortcut-text {
                display: none;
            }

            .color-tab-button {
                font-size: 0.9em;
                padding: 15px 20px;
            }

            .progression-steps {
                flex-direction: column;
            }

            .arrow {
                transform: rotate(90deg);
            }
        }

        /* ========================================== */
        /* MESA DE TRABAJO INTERACTIVA                */
        /* ========================================== */
        .interactive-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            background: #f8f9fa;
            padding: 15px;
            border-radius: 10px 10px 0 0;
            border: 1px solid #dee2e6;
            border-bottom: none;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
            margin-top: 15px;
        }

        .color-tool {
            display: flex;
            align-items: center;
            background: white;
            border: 1px solid #ced4da;
            padding: 8px 15px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9em;
            transition: all 0.2s ease;
        }

        .color-tool:hover {
            background: #e9ecef;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .color-tool.active {
            border: 2px solid #333;
            transform: scale(1.05);
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
            background: #e9ecef;
        }

        .color-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            margin-right: 8px;
            display: inline-block;
        }

        .interactive-workspace {
            min-height: 400px;
            background: white;
            padding: 30px;
            border: 1px solid #dee2e6;
            border-radius: 0 0 10px 10px;
            font-size: 1.2em;
            line-height: 2;
            box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
            overflow-y: auto;
        }

        .interactive-workspace:empty:before {
            content: attr(aria-placeholder);
            color: #adb5bd;
            font-style: italic;
        }

        .interactive-workspace:focus {
            outline: none;
            border-color: #2a5298;
            box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.2);
        }

        .clear-tool {
            margin-left: auto;
            background: #f8d7da;
            color: #721c24;
            border-color: #f5c6cb;
        }
        .clear-tool:hover {
            background: #f5c6cb;
        }
        
        .clear-all-tool:hover {
            opacity: 0.9;
        }

        /* ============================================== */
        /* MESA DE TRABAJO V2: PHRASING, NOTAS Y LENTES   */
        /* ============================================== */
        
        .workspace-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-bottom: none;
            border-radius: 10px 10px 0 0;
            padding: 10px 20px;
        }
        
        .lens-toggles {
            display: flex;
            gap: 15px;
        }
        
        .lens-toggle {
            cursor: pointer;
            font-size: 0.95em;
            font-weight: 600;
            user-select: none;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        /* Phrasing System */
        .phrase-line {
            display: flex;
            align-items: flex-start;
            margin-bottom: 5px;
            transition: margin-left 0.2s ease-in-out;
            position: relative;
        }

        .phrase-selectors {
            display: flex;
            flex-direction: row;
            gap: 5px;
            margin-right: 10px;
            flex-shrink: 0;
            margin-top: 5px;
        }

        .logic-rel, .phrase-type {
            padding: 2px;
            border-radius: 4px;
            border: 1px solid #ced4da;
            background-color: #f8f9fa;
            font-size: 0.8rem;
            color: #495057;
            cursor: pointer;
            outline: none;
            width: 100px;
        }

        .phrase-text {
            flex-grow: 1;
            outline: none;
            min-height: 1.5em; /* Asegurar que soporte vacío */
        }

        /* Notas Exegéticas */
        .has-note {
            text-decoration: underline dotted #007bff;
            text-underline-offset: 4px;
            cursor: help !important;
            position: relative;
        }

        /* Context Menu (Note Modal) */
        .note-modal {
            position: absolute;
            background: #ffffff;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
            padding: 10px;
            width: 250px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .note-modal-header {
            font-size: 0.85em;
            font-weight: 600;
            color: #495057;
            text-transform: uppercase;
        }

        .note-modal textarea {
            width: 100%;
            resize: none;
            padding: 8px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            font-family: inherit;
            font-size: 0.9em;
            outline: none;
        }

        .note-modal textarea:focus {
            border-color: #2a5298;
        }

        .note-modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 5px;
        }

        .note-btn {
            border: none;
            padding: 4px 8px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8em;
            font-weight: 600;
        }

        .note-btn.save-btn { background: #007bff; color: white; }
        .note-btn.delete-btn { background: #dc3545; color: white; margin-right: auto; }
        .note-btn:hover { filter: brightness(0.9); }

        .note-viewer {
            position: absolute;
            background: #343a40;
            color: white;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 0.85em;
            pointer-events: none;
            z-index: 999;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            max-width: 200px;
        }

        /* Visibility Lenses (Toggles) */
        .hide-colors span[data-color-hex] {
            background-color: transparent !important;
            color: inherit !important;
            padding: 0 !important;
        }

        .hide-notes .has-note {
            text-decoration: none !important;
        }

        .hide-structure .logic-rel, 
        .hide-structure .phrase-type, 
        .hide-structure .phrase-selectors {
            display: none !important;
        }
        
        .hide-structure .phrase-line {
            margin-left: 0 !important;
            display: inline !important;
        }
        
        .hide-structure .phrase-text {
            display: inline !important;
        }    
        .clear-all-tool {
            transition: all 0.2s ease;
        }
        .clear-all-tool:hover {
            background: #c82333 !important;
        }

/* ========================================================================== */
/* BUSCADOR GRAMATICAL AÑADIDO (Pestaña)                                      */
/* ========================================================================== */
.herramienta-gramatical-container {
    padding: 20px;
    color: #333;
}

.herramienta-gramatical-container .search-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.herramienta-gramatical-container .search-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.herramienta-gramatical-container input[type="text"] {
    flex: 1; /* Permite que el input crezca */
    min-width: 300px; /* Asegura un ancho base */
    width: 100%; /* Forzar un 100% real de ancho antes de min/max limites que existan localmente*/
    padding: 15px 20px;
    border: 3px solid #34495e;
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    color: #333;
}

.herramienta-gramatical-container input[type="text"]:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 20px rgba(52, 73, 94, 0.3);
    transform: translateY(-2px);
}

.herramienta-gramatical-container .identification-result {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.herramienta-gramatical-container .identification-result.show {
    display: block;
}

.herramienta-gramatical-container .identification-header {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.herramienta-gramatical-container .grammar-match {
    background: rgba(255,255,255,0.15);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    position: relative;
    border-left: 4px solid rgba(255,255,255,0.8);
}

.herramienta-gramatical-container .grammar-match.match-phrase-preposicional { background: var(--color-preposicion); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-genitiva { background: var(--color-genitivo); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-infinitiva { background: var(--color-verbo); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-conjuncion { background: var(--color-adverbio); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-participial { background: var(--color-verbo); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-aposicional { background: var(--color-sustantivo); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-relativa { background: var(--color-pronombre); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-sustantival { background: var(--color-sustantivo); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-nomarcada { background: var(--color-adverbio); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-adverbial { background: var(--color-adverbio); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-exclamatory { background: var(--color-determinante); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-vocative { background: var(--color-determinante); color: white; }
.herramienta-gramatical-container .grammar-match.match-relation-coordinada { background: var(--color-adverbio); color: white; }
.herramienta-gramatical-container .grammar-match.match-relation-subordinada { background: var(--color-adverbio); color: white; }
.herramienta-gramatical-container .grammar-match.match-expression { background: var(--color-adverbio); color: white; }
.herramienta-gramatical-container .grammar-match.match-preposition { background: var(--color-preposicion); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-adjetival { background: var(--color-adjetivo); color: white; }
.herramienta-gramatical-container .grammar-match.match-phrase-secundario { background: var(--color-secundario); color: white; }

.herramienta-gramatical-container .phrase-annotation {
    position: absolute;
    top: -10px;
    left: 15px;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.8em;
    color: white;
}
.herramienta-gramatical-container .ann-preposicional { background-color: var(--color-preposicion); }
.herramienta-gramatical-container .ann-genitiva { background-color: var(--color-genitivo); }
.herramienta-gramatical-container .ann-infinitiva { background-color: var(--color-verbo); }
.herramienta-gramatical-container .ann-conjuncion { background-color: var(--color-adverbio); }
.herramienta-gramatical-container .ann-participial { background-color: var(--color-verbo); }
.herramienta-gramatical-container .ann-aposicional { background-color: var(--color-sustantivo); }
.herramienta-gramatical-container .ann-relativa { background-color: var(--color-pronombre); }
.herramienta-gramatical-container .ann-sustantival { background-color: var(--color-sustantivo); }
.herramienta-gramatical-container .ann-nomarcada { background-color: var(--color-adverbio); }
.herramienta-gramatical-container .ann-adverbial { background-color: var(--color-adverbio); }
.herramienta-gramatical-container .ann-exclamatory { background-color: var(--color-determinante); }
.herramienta-gramatical-container .ann-vocative { background-color: var(--color-determinante); }
.herramienta-gramatical-container .ann-adjetival { background-color: var(--color-adjetivo); }
.herramienta-gramatical-container .ann-secundario { background-color: var(--color-secundario); }

.herramienta-gramatical-container .match-type { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; color: white;}
.herramienta-gramatical-container .match-details { font-size: 0.95em; opacity: 0.9; margin-bottom: 8px; color: white;}
.herramienta-gramatical-container .match-function { font-style: italic; font-size: 0.9em; opacity: 0.85; color: white;}

.herramienta-gramatical-container .filter-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.herramienta-gramatical-container .filter-btn { padding: 10px 18px; border: 2px solid #34495e; background: rgba(255,255,255,0.9); color: #34495e; border-radius: 25px; cursor: pointer; font-size: 14px; transition: all 0.3s ease; backdrop-filter: blur(5px); }
.herramienta-gramatical-container .filter-btn:hover, .herramienta-gramatical-container .filter-btn.active { background: linear-gradient(135deg, #2c3e50, #34495e); color: white; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(52, 73, 94, 0.3); }

.herramienta-gramatical-container .special-btn { background: linear-gradient(135deg, #27ae60, #2ecc71); border-color: #27ae60; color: white; }
.herramienta-gramatical-container .special-btn:hover { background: linear-gradient(135deg, #2ecc71, #27ae60); box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3); }

.herramienta-gramatical-container .clear-btn { background: linear-gradient(135deg, #e74c3c, #c0392b); border-color: #e74c3c; color: white; }
.herramienta-gramatical-container .clear-btn:hover { background: linear-gradient(135deg, #c0392b, #a93226); box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); }

.herramienta-gramatical-container .grammar-grid { display: grid; gap: 20px; margin-top: 20px;}
.herramienta-gramatical-container .grammar-section { background: rgba(255, 255, 255, 0.95); border-radius: 15px; backdrop-filter: blur(10px); overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.2); transition: all 0.3s ease; }
.herramienta-gramatical-container .grammar-section:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.15); }

.herramienta-gramatical-container .section-header { background: linear-gradient(135deg, #2c3e50, #34495e); color: white; padding: 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: bold; font-size: 1.2em; }
.herramienta-gramatical-container .section-header:hover { background: linear-gradient(135deg, #34495e, #2c3e50); }
.herramienta-gramatical-container .section-header.logical-relations { background: linear-gradient(135deg, #6c757d, #545b62); }
.herramienta-gramatical-container .section-header.phrase-types { background: linear-gradient(135deg, #007bff, #0056b3); }
.herramienta-gramatical-container .section-header.expressions { background: linear-gradient(135deg, #6c757d, #545b62); }
.herramienta-gramatical-container .section-header.prepositions { background: linear-gradient(135deg, #ffc107, #e0a800); }

.herramienta-gramatical-container .toggle-icon { font-size: 1.2em; transition: transform 0.3s ease; }
.herramienta-gramatical-container .section-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.herramienta-gramatical-container .section-content { padding: 25px; display: block; }
.herramienta-gramatical-container .section-content.collapsed { display: none; }

.herramienta-gramatical-container .grammar-item { background: linear-gradient(135deg, #f8f9ff, #f0f4ff); border: 2px solid rgba(52, 73, 94, 0.2); border-radius: 12px; padding: 20px; margin-bottom: 20px; transition: all 0.3s ease; color:#333; }
.herramienta-gramatical-container .grammar-item:hover { box-shadow: 0 8px 25px rgba(52, 73, 94, 0.15); transform: translateY(-3px); border-color: #34495e; }

.herramienta-gramatical-container .item-title { font-weight: bold; color: #2c3e50; font-size: 1.2em; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.herramienta-gramatical-container .item-definition { color: #666; margin-bottom: 15px; font-style: italic; padding: 10px; background: rgba(255,255,255,0.8); border-radius: 8px; }
.herramienta-gramatical-container .details-content { background: linear-gradient(135deg, #2c3e50, #34495e); color: white; padding: 12px 16px; border-radius: 8px; font-family: 'Courier New', monospace; font-weight: 500; }

.herramienta-gramatical-container .greek-section { background: rgba(52, 152, 219, 0.1); padding: 15px; border-radius: 10px; border-left: 4px solid #3498db; margin-top: 15px; }
.herramienta-gramatical-container .greek-title { font-weight: bold; color: #3498db; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.herramienta-gramatical-container .greek-content { background: #3498db; color: white; padding: 12px 16px; border-radius: 8px; font-family: 'Times New Roman', serif; font-size: 1.1em; }
.herramienta-gramatical-container .example-section { background: rgba(52, 73, 94, 0.1); padding: 15px; border-radius: 10px; border-left: 4px solid #34495e; margin-top: 15px; }
.herramienta-gramatical-container .example-title { font-weight: bold; color: #34495e; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.herramienta-gramatical-container .biblical-example { font-style: italic; margin-bottom: 8px; color: #2c3e50; background: rgba(255,255,255,0.7); padding: 8px; border-radius: 5px; }

.herramienta-gramatical-container .no-results { text-align: center; color: white; font-style: italic; padding: 40px; background: rgba(255,255,255,0.1); border-radius: 15px; backdrop-filter: blur(10px); font-size: 1.1em; }
.herramienta-gramatical-container .color-guide-info { background: rgba(255, 255, 255, 0.9); color: #2c3e50; padding: 15px; border-radius: 10px; border-left: 4px solid rgba(255, 255, 255, 0.8); margin-bottom: 20px; text-align: left; font-size: 0.9em; line-height: 1.4; }

@media (max-width: 768px) {
    .herramienta-gramatical-container .search-controls { flex-direction: column; align-items: stretch; }
    .herramienta-gramatical-container .filter-buttons { justify-content: center; }
    .herramienta-gramatical-container input[type="text"] { min-width: 100%; }
}

/* ========================================================================== */
/* ASISTENTE EXEGÉTICO IA                                                     */
/* ========================================================================== */
.ai-panel {
    background: #fff;
    border: 2px solid #5e35b1;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-header {
    background: linear-gradient(135deg, #5e35b1, #3949ab);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header h3 { margin: 0; font-size: 1.2em; }
.close-btn { background: none; border: none; color: white; font-size: 1.2em; cursor: pointer; }
.close-btn:hover { color: #ffeb3b; transform: scale(1.1); }

.ai-settings {
    background: #f1f3f4;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #ddd;
}
.ai-settings input { flex: 1; padding: 8px 12px; border: 1px solid #ccc; border-radius: 5px; outline:none; }
.ai-settings input:focus { border-color: #5e35b1; box-shadow: 0 0 5px rgba(94, 53, 177, 0.3); }
.ai-settings .api-link { font-size: 0.9em; color: #1976d2; text-decoration: none; font-weight: bold; background: rgba(25, 118, 210, 0.1); padding: 5px 10px; border-radius: 15px; }
.ai-settings .api-link:hover { background: rgba(25, 118, 210, 0.2); }

.ai-body {
    padding: 20px;
    height: auto;
    min-height: 150px;
    max-height: 500px;
    overflow-y: auto;
    background: #fafafa;
}

.ai-chat-history { display: flex; flex-direction: column; gap: 15px; }

.chat-message { max-width: 85%; padding: 12px 18px; border-radius: 15px; position: relative; line-height: 1.5; font-size: 0.95em; color: #333; }
.chat-message pre { background: #2d2d2d; color: #f8f8f2; padding: 15px; border-radius: 8px; overflow-x: auto; font-family: 'Courier New', monospace; margin: 10px 0; font-size: 0.95em;}
.chat-message.system-msg { background: #e8eaf6; align-self: flex-start; border-top-left-radius: 0; border-left: 4px solid #3f51b5; }
.chat-message.user-msg { background: #e3f2fd; align-self: flex-end; border-top-right-radius: 0; border-right: 4px solid #1976d2; }
.chat-message.ai-msg { background: #fff; align-self: flex-start; border-top-left-radius: 0; border-left: 4px solid #5e35b1; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #eee; width: 100%; max-width: 95%;}

.ai-footer {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-footer textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    outline: none;
}
.ai-footer textarea:focus { border-color: #3f51b5; }

.ai-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ai-btn { padding: 10px 20px; border: none; border-radius: 20px; cursor: pointer; font-weight: bold; transition: all 0.2s; font-size: 0.95em; }
.ai-btn.copy-prompt { background: #e0e0e0; color: #333; }
.ai-btn.copy-prompt:hover { background: #bdbdbd; }
.ai-btn.run-ai { background: linear-gradient(135deg, #1e88e5, #1565c0); color: white; }
.ai-btn.run-ai:hover { box-shadow: 0 4px 10px rgba(30, 136, 229, 0.4); transform: translateY(-2px); }
.ai-btn.next-stage { background: linear-gradient(135deg, #43a047, #2e7d32); color: white; }
.ai-btn.next-stage:hover { background: linear-gradient(135deg, #4caf50, #388e3c); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);}

/* Animación de pensando */
.typing-indicator { display: inline-flex; gap: 5px; align-items: center;}
.typing-indicator span { width: 8px; height: 8px; background: #5e35b1; border-radius: 50%; animation: typing 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* ========================================================================== */
/* ESTILOS UI API KEYS DUAL (FREE / PAID)                                     */
/* ========================================================================== */

.api-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.api-card-free {
    background-color: #f0f7ff;
    border: 1px solid #bfdbfe;
}

.api-card-free:hover {
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
}

.api-card-paid {
    background-color: #fdf4ff;
    border: 1px solid #e9d5ff;
}

.api-card-paid:hover {
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.1);
}

.api-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.api-icon {
    font-size: 1.5em;
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.api-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1em;
}

.api-subtitle {
    font-size: 0.85em;
    color: #64748b;
}

.api-input {
    background: white !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin-top: -5px;
    width: 100%;
}

.api-link {
    font-size: 0.85em;
    color: #2563eb;
    text-decoration: underline;
    margin-top: -5px;
}

.api-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

.btn-api {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.save-free {
    background-color: #3b82f6;
    color: white;
}
.save-free:hover { background-color: #2563eb; }

.save-paid {
    background-color: #8b5cf6;
    color: white;
}
.save-paid:hover { background-color: #7c3aed; }

.test-btn {
    background-color: white;
    border: 1px solid #cbd5e1;
    color: #475569;
}
.test-btn:hover { background-color: #f1f5f9; }

.api-status {
    font-size: 0.85em;
    font-weight: 500;
    margin-left: auto;
}

/* Modo Selector Pills */
.mode-toggles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.mode-pill-label {
    cursor: pointer;
    position: relative;
    display: block;
}

.mode-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.mode-box {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 15px;
    background: white;
    transition: all 0.2s;
}

.mode-box strong {
    display: block;
    color: #1e293b;
    margin-bottom: 5px;
}

.mode-box span {
    font-size: 0.8em;
    color: #64748b;
    display: block;
}

.mode-radio:checked + .mode-box {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: inset 0 0 0 1px #2563eb;
}