/* ════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Sistema de Variables CSS
   Todos los colores, espaciados y efectos pasan por aquí.
   ════════════════════════════════════════════════════════════════ */
:root {
    /* ── Superficies (de más oscuro a más claro) ── */
    --bg-color:    #121212;
    --menu-color:  #181818;  
    --card-bg:     #1e1e1e;
    --surface-1:   #2a2a2a;
    --surface-2:   #333333;
    --surface-3:   #3a3a3a;

    /* ── Texto ── */
    --text-main:   #e0e0e0;
    --text-muted:  #888888;   
    --text-subtle: #666666;

    /* ── Bordes ── */
    --border:       #333333;
    --border-light: #444444;

    /* ── Acento y semánticos ── */
    --accent:         #4CAF50;
    --pomo-work:      #d95550;
    --pomo-short:     #4c9195;
    --pomo-long:      #457ca3;
    --status-blue:    #256ca5;
    --status-red:     #bb0e02;
    --status-yellow:  #cdcd00;
    --status-green:   #4CAF50;
    --fuego :         #d74907;
    --fuego-azul:     #44a4f2;

    /* ── Transiciones (consistencia global) ── */
    --t-fast:   0.15s;
    --t-base:   0.25s;
    --t-slow:   0.4s;
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ── Radio de borde ── */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-xl: 20px;

    /* ── Sombras ── */
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

    /* ── Layout ── */
    --sidebar-w:   280px;
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-height:  65px;

    /* ── Z-Index estratificado ── */
    --z-pdf:     100;
    --z-nav:     6000;
    --z-modal:   9000;
    --z-top:     9999;
}

/* ════════════════════════════════════════════════════════════════
   RESET Y BASE
   ════════════════════════════════════════════════════════════════ */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-2) var(--bg-color);
}

::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); border-radius: var(--r-sm); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: var(--r-sm); border: 2px solid var(--bg-color); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); }
::-webkit-scrollbar-corner { background: var(--bg-color); }

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

label   { display: block; color: var(--text-muted); font-size: 0.8em; margin-bottom: 5px; margin-top: 15px; }
input,
textarea,
select  {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 10px;
    border-radius: var(--r-sm);
    box-sizing: border-box;
    font-family: inherit;
    /* FIX: font-size 16px solo en móvil para evitar zoom en iOS, no globalmente */
}
textarea { height: 120px; resize: vertical; }

/* Ocultar flechas en input number */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

h2 { margin: 0; padding: 10px 0; font-size: 1.4em; }

@keyframes fadeIn    { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn     { from { transform: scale(0.8); opacity: 0; }         to { transform: scale(1); opacity: 1; } }
@keyframes stabFadeIn { from { opacity: 0; transform: translateY(4px); }   to { opacity: 1; transform: translateY(0); } }
@keyframes savePulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Soporte tamaños LaTeX */
.tiny  { font-size: 0.6em; }
.small { font-size: 0.85em; }
.large { font-size: 1.2em; }
.huge  { font-size: 1.8em; }

/* ════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════ */
#sidebar {
    width: var(--sidebar-w);
    background: var(--menu-color);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transition: width var(--t-slow) var(--ease-out), padding var(--t-slow) var(--ease-out);
    position: relative;
    z-index: 100;
}
#sidebar.collapsed { width: 0; padding: 0; border: none; overflow: visible; }
#sidebar.collapsed > *:not(#sidebar-toggle) { display: none !important; }

#sidebar-toggle {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 40px;
    background: var(--surface-1);
    border: 1px solid var(--border-light);
    border-left: none;
    border-radius: 0 var(--r-md) var(--r-md) 0;
    cursor: pointer;
    color: var(--text-subtle);
    display: flex; align-items: center; justify-content: center;
    z-index: 101;
    font-size: 10px;
    transition: var(--t-fast);
}
#sidebar-toggle:hover { background: var(--surface-2); color: var(--accent); }

.sidebar-title   { font-size: 1.1em; color: rgb(251, 196, 0); margin: 0; letter-spacing: -0.5px; }
.sidebar-version { font-size: 0.6em; opacity: 0.5; }

.sidebar-header-row {
    display: flex; justify-content: space-between; align-items: flex-end;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
    margin-top: 25px; margin-bottom: 10px;
}
.sidebar-label { font-size: 0.75em; letter-spacing: 1px; font-weight: bold; }

.btn-header-add {
    background: none; border: none; color: #622a6f;
    cursor: pointer; font-size: 1.1em; line-height: 1; padding: 0 5px;
    transition: color var(--t-fast);
}
.btn-header-add:hover { color: var(--accent); transform: scale(1.1); }

.sidebar-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
    padding: 5px; width: 100%; box-sizing: border-box;
}

/* ── Lista asignaturas/proyectos ── */
.section-list {
    list-style: none; padding: 0; margin-bottom: 20px;
    overflow-y: auto; flex-grow: 1; min-height: 50px;
}

.asig-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--r-sm);
    margin-bottom: 4px;
    color: var(--text-muted);
    transition: all var(--t-base) var(--ease-out);
    font-size: 0.9em;
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    border-left: 4px solid transparent;
}
.asig-item:hover {
    background: var(--surface-1);
    color: var(--text-main);
    padding-left: 15px;
    border-left-color: var(--dynamic-color, var(--accent));
}
.asig-item.active {
    background: var(--surface-2);
    color: var(--text-main);
    border-left-color: var(--dynamic-color, var(--accent));
    font-weight: bold;
}

.asig-actions { display: flex; gap: 5px; opacity: 0; transition: opacity var(--t-fast); }
.asig-item:hover .asig-actions { opacity: 1; }

/* FIX: .btn-mini y .btn-mini_2 eran idénticos — unificados */
.btn-mini,
.btn-mini_2 {
    background: none; border: none; color: var(--text-subtle);
    cursor: pointer; font-size: 1.1em; padding: 2px 5px; z-index: 10;
}
.btn-mini:hover,
.btn-mini_2:hover { color: var(--text-main); transform: scale(1.2); }

/* ════════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ════════════════════════════════════════════════════════════════ */
#main-content {
    flex-grow: 1; padding: 20px;
    overflow-y: auto;
    display: flex; flex-direction: column; align-items: center;
}
.container {
    width: 100%; max-width: 1400px;
    display: grid; grid-template-columns: 3.5fr 300px;
    gap: 30px; padding-bottom: 50px;
}

.hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════════
   CARDS GENÉRICAS
   ════════════════════════════════════════════════════════════════ */
.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}
.panel-header h3 { margin: 0; font-size: 1.3em; }
.panel-header p  { font-size: 0.85em; color: var(--text-muted); margin: 4px 0 0 0; }

.form-label { color: #aaa; font-size: 0.85em; margin-bottom: 6px; display: block; }
.form-input {
    width: 100%; background: var(--bg-color);
    border: 1px solid var(--border); color: var(--text-main);
    padding: 10px 12px; border-radius: var(--r-md);
    box-sizing: border-box; font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--border-light); }
.form-input.sm { padding: 8px; }

.form-footer {
    display: flex; justify-content: flex-end; gap: 12px;
    border-top: 1px dashed var(--border); padding-top: 15px; margin-top: 20px;
}

input[type="color"].color-picker-dinamico {
    background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
    width: 32px; height: 32px; cursor: pointer; padding: 0;
}
input[type="color"].color-picker-dinamico::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"].color-picker-dinamico::-webkit-color-swatch { border-radius: 3px; border: none; }

/* ════════════════════════════════════════════════════════════════
   TARJETA DE ESTUDIO
   ════════════════════════════════════════════════════════════════ */
#study-card {
    min-height: 300px; display: flex; flex-direction: column;
    touch-action: pan-y; user-select: none;
}
.card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.meta-tema  { font-size: 0.8em; color: var(--text-muted); }
.meta-fecha { font-size: 0.8em; font-weight: bold; color: #ffab40; }

.btn-card-edit {
    background: none; border: 1px solid var(--border-light); color: #aaa;
    cursor: pointer; font-size: 0.7em; padding: 2px 6px; border-radius: var(--r-sm);
}
.btn-card-edit:hover { color: var(--text-main); border-color: var(--text-subtle); }

.area-revelar    { margin-top: 30px; display: flex; justify-content: center; }
.concepto-contenido { margin: 20px 0; }
.controles-respuesta { flex-wrap: wrap; justify-content: center; }

.study-footer {
    margin-top: auto; border-top: 1px solid var(--border); padding-top: 15px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; flex-wrap: wrap;
}

/* Filtros pie de tarjeta */
.btn-filtros-dropdown {
    background: transparent; border: 1px solid var(--border-light);
    border-radius: var(--r-xl); color: #aaa; font-size: 0.75em;
    padding: 2px 8px; cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    transition: all var(--t-fast);
}
.btn-filtros-dropdown:hover { border-color: var(--text-muted); color: var(--text-main); }
.filtros-icon { font-size: 0.9em; color: var(--status-red); transition: color var(--t-fast); }

.study-check-label {
    margin: 0; cursor: pointer; font-size: 0.75em; color: #aaa;
    display: flex; align-items: center; gap: 4px;
}
.study-check-shortcut { font-size: 0.8em; opacity: 0.5; }
.contador-filtro { font-size: 0.7em; color: var(--text-subtle); font-family: monospace; white-space: nowrap; }

/* ── Botones de dificultad ── */
.controls { display: flex; margin-top: 30px; }
.btn-dif {
    padding: 12px; border: none; background: var(--surface-1);
    cursor: pointer; font-weight: bold; flex: 1; margin: 0 5px;
    border-radius: var(--r-sm); color: #aaa;
    transition: all var(--t-base);
}
.btn-dif:hover { transform: translateY(-2px); color: white; }
.btn-dif-1 { border-bottom: 3px solid var(--status-blue); }
.btn-dif-2 { border-bottom: 3px solid var(--status-green); }
.btn-dif-3 { border-bottom: 3px solid var(--status-yellow); }
.btn-dif-4 { border-bottom: 3px solid var(--status-red); }
.btn-dif-1:hover { background-color: #1976D2; box-shadow: 0 0 15px var(--status-blue); }
.btn-dif-2:hover { background-color: #388E3C; box-shadow: 0 0 15px var(--status-green); }
.btn-dif-3:hover { background-color: #F57C00; box-shadow: 0 0 15px var(--status-yellow); }
.btn-dif-4:hover { background-color: #D32F2F; box-shadow: 0 0 15px var(--status-red); }

/* ── Listas LaTeX ── */
#concepto-contenido ol,
#concepto-contenido ul { margin-left: 20px; padding-left: 20px; margin-bottom: 15px; }
#concepto-contenido li { margin-bottom: 8px; line-height: 1.6; }

.latex-ejemplos-box {
    background-color: rgba(46, 125, 50, 0.1);
    border-left: 3px solid #2E7D32;
    padding: 10px; margin: 10px 0; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.latex-ejemplos-title { color: var(--status-green); font-weight: bold; font-size: 0.9em; margin-bottom: 5px; display: block; }
.tikz-ph {
    display: inline-block; color: var(--text-muted); font-style: italic; font-size: 0.82em;
    background: rgba(255,255,255,0.05); border: 1px dashed var(--border-light);
    border-radius: var(--r-sm); padding: 1px 6px; margin: 2px 0;
}

/* ════════════════════════════════════════════════════════════════
   SISTEMA DE BOTONES
   Base + 8 temas de clic + 4 variantes semánticas
   ════════════════════════════════════════════════════════════════ */
.btn-content {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.btn-text     { font-size: 1.1em; font-weight: 700; letter-spacing: 0.5px; }
.btn-shortcut {
    font-size: 0.65em; opacity: 0.6; font-family: 'Consolas', monospace;
    text-transform: uppercase; background: rgba(0,0,0,0.2);
    padding: 2px 6px; border-radius: var(--r-sm); margin-top: 4px;
}

.btn-modern {
    border-radius: var(--r-lg);
    padding: 8px 16px;
    cursor: pointer;
    transition: all var(--t-base) var(--ease-out);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 140px; position: relative; overflow: hidden;
    font-family: inherit;
}

/* ── VARIANTES SEMÁNTICAS ── */

/* ════════════════════════════════════════════════════════════════
   NUEVA TAXONOMÍA DE BOTONES
   ════════════════════════════════════════════════════════════════ */

/* ── Clase Base: Botón de Sidebar ── */
.btn-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--r-md, 8px);
    transition: all var(--t-fast, 0.2s);
    font-family: inherit;
    padding: 10px;
    gap: 8px;
    width: 100%;
}
.btn-sidebar:active { transform: scale(0.96); }
/* ── Modificadores de btn-modern (Acciones secundarias) ── */
.btn-modern.btn-muted {
    color: var(--text-muted);
    border-color: var(--border-light);
}

.btn-modern.btn-muted:hover {
    color: var(--text-main);
    border-color: var(--border);
    background: var(--surface-1);
}

.btn-success {
    background: color-mix(in srgb, var(--status-green) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--status-green) 40%, transparent);
    color: var(--status-green);
    border-radius: var(--r-md);
    padding: 8px 16px;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: all var(--t-base) var(--ease-out);
}
.btn-success:hover {
    background: color-mix(in srgb, var(--status-green) 25%, transparent);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--status-green) 20%, transparent);
}

.btn-info {
    background: color-mix(in srgb, var(--status-blue) 15%, transparent);
    border: 1px solid var(--status-blue);
    color: var(--status-blue);
    border-radius: var(--r-md); padding: 8px 16px;
    cursor: pointer; font-family: inherit;
    transition: all var(--t-base) var(--ease-out);
}
.btn-info:hover {
    background: color-mix(in srgb, var(--status-blue) 25%, transparent);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--status-blue) 20%, transparent);
}

.btn-danger {
    background: color-mix(in srgb, var(--status-red) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--status-red) 40%, transparent);
    color: var(--status-red);
    border-radius: var(--r-md); padding: 8px 16px;
    cursor: pointer; font-family: inherit;
    transition: all var(--t-base) var(--ease-out);
}
.btn-danger:hover {
    background: color-mix(in srgb, var(--status-red) 20%, transparent);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--status-red) 15%, transparent);
}

.btn-neutral {
    background: color-mix(in srgb, var(--text-main) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-main) 40%, transparent);
    color: color-mix(in srgb, var(--text-main) 70%, transparent);
    border-radius: var(--r-md); padding: 8px 16px;
    cursor: pointer; font-family: inherit;
    transition: all var(--t-base) var(--ease-out);
}
.btn-neutral:hover {
    background: color-mix(in srgb, var(--text-main) 20%, transparent);
    color: var(--text-main);
}

.btn-ghost {
    background: transparent; border: 1px solid var(--border-light);
    color: var(--text-muted); font-size: 0.8em;
    cursor: pointer; padding: 5px 12px; border-radius: var(--r-sm);
    transition: all var(--t-base);
}
.btn-ghost:hover { background: var(--surface-1); color: #ccc; border-color: var(--border-light); }

/* ── ICONO CUADRADO PEQUEÑO (sidebar/toolbar) ── */
.btn-icon-sm {
    min-width: 0 !important;
    width: 45px; height: 45px;
    padding: 0 !important;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── BOTÓN MINI CONTROL ── */
.btn-mini-control {
    background: var(--surface-2); color: var(--text-main);
    border: none; border-radius: var(--r-sm); cursor: pointer;
    font-size: 0.7em; padding: 2px 5px;
    transition: background var(--t-fast);
}
.btn-mini-control:hover { background: var(--surface-3); }

/* ════════════════════════════════════════════════════════════════
   TEMAS VISUALES DE BOTONES (Desacoplados del tema global)
   ════════════════════════════════════════════════════════════════ */

/* ── 1. GLASSMORPHISM (defecto) ── */
body.style-glass .btn-reveal {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: #90a4ae;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
}
body.style-glass .btn-muted {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
}
body.style-glass .btn-next {
    background: linear-gradient(135deg, rgba(113, 68, 134, 0.3), rgba(142, 86, 169, 0.3));
    backdrop-filter: blur(8px);
    color: #e1bee7;
    border: 1px solid rgba(142, 86, 169, 0.4);
    box-shadow: 0 8px 24px rgba(113, 68, 134, 0.15);
}
body.style-glass .btn-modern:hover { transform: translateY(-2px); }
body.style-glass .btn-sidebar {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(4px);
    color: rgba(144, 164, 174, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
body.style-glass .btn-sidebar:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── 2. CYBERPUNK (neón) ── */
body.style-cyber .btn-reveal {
    background: var(--bg-color); color: #607d8b; border: 1px solid #263238;
}
body.style-cyber .btn-muted {
    background: transparent; color: #37474f; border: 1px solid #1a2327; box-shadow: none;
}
body.style-cyber .btn-next {
    background: var(--bg-color); color: #ba68c8; border: 1px solid #4a148c;
    text-shadow: 0 0 5px rgba(186, 104, 200, 0.5);
}
body.style-cyber .btn-modern:hover {
    box-shadow: 0 0 15px rgba(255,255,255,0.1); border-color: var(--text-main); color: var(--text-main);
}
body.style-cyber .btn-sidebar {
    background: #0d1117;
    color: #455a64;
    border: 1px solid #161b22;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 1px;
}
body.style-cyber .btn-sidebar:hover {
    border-color: #30363d;
    color: #8b949e;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
/* ── 3. SKEUOMORPHIC (físico) ── */
body.style-skeuo .btn-reveal {
    background: var(--card-bg); color: var(--text-muted);
    border: 1px solid var(--bg-color);
    box-shadow: 3px 3px 6px var(--bg-color), -1px -1px 2px var(--surface-1);
}
body.style-skeuo .btn-muted {
    background: transparent; border: none;
    box-shadow: inset 2px 2px 4px var(--bg-color), inset -1px -1px 2px var(--surface-1);
    color: var(--text-muted); opacity: 0.8;
}
body.style-skeuo .btn-next {
    background: #714486; color: #fff; border: 1px solid #5a366b;
    box-shadow: 3px 3px 6px var(--bg-color), inset 1px 1px 2px rgba(255,255,255,0.2);
}
body.style-skeuo .btn-modern:hover { filter: brightness(1.1); }
body.style-skeuo .btn-sidebar {
    background: var(--bg-color);
    color: var(--text-muted);
    border: none;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.4), 
                inset -1px -1px 3px rgba(255,255,255,0.05);
}
body.style-skeuo .btn-sidebar:hover {
    color: var(--text-main);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5), 
                0 2px 4px rgba(0,0,0,0.3);
}

/* ── 4. NORDIC NIGHT (gélido) ── */
body.style-nord .btn-reveal {
    background: #434c5e; color: #d8dee9; border: 1px solid #4c566a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
body.style-nord .btn-muted {
    background: #3b4252; color: #8fbcbb; border: 1px solid #434c5e;
    box-shadow: none; opacity: 0.7;
}
body.style-nord .btn-next {
    background: #5e81ac; color: #eceff4; border: 1px solid #81a1c1;
    box-shadow: 0 4px 14px rgba(94, 129, 172, 0.3);
}
body.style-nord .btn-modern:hover { transform: translateY(-2px); filter: brightness(1.1); }
body.style-nord .btn-sidebar {
    background: #2e3440;
    color: #81a1c1;
    border: 1px solid #3b4252;
}
body.style-nord .btn-sidebar:hover {
    background: #3b4252;
    color: #88c0d0;
    border-color: #4c566a;
}

/* ── 5. Bloodborne / Gothic Horror ── */
body.style-yahrnam .btn-reveal {
    background: #020b1a; color: rgba(200, 220, 255, 0.5); border: 1px solid rgba(20, 40, 60, 0.8);
    box-shadow: 0 4px 15px rgb(20, 30, 56); 
}
body.style-yahrnam .btn-muted {
    background: color-mix(in srgb, var(--bg-color), #0a2137 40%);; color: rgba(132, 155, 179, 0.686); border: 1px solid rgba(20, 30, 40, 0.5);
    box-shadow: 0 4px 15px rgba(0, 7, 206, 0.222);
}
body.style-yahrnam .btn-next {
    background: #0a2137; color: #9baab8; border: 1px solid #000000;
    box-shadow: 0 8px 30px rgba(10, 10, 15, 0.9); 
}
body.style-yahrnam .btn-modern:hover {
    background: #082039; box-shadow: 0 0 25px rgba(180, 20, 20, 0.4); 
    color: #ff5555; border-color: #8a1111; transform: translateY(1px); 
    transition: all 0.2s ease-in-out;
}
body.style-yahrnam .btn-sidebar {
    background: #050505;
    color: #4a4a4a;
    border: 1px solid #1a1a1a;
    font-family: 'Georgia', serif;
}
body.style-yahrnam .btn-sidebar:hover {
    background: #0a0a0a;
    color: #8a1111;
    border-color: #330000;
}

/* ── 6. RETRO TERMINAL (fósforo) ── */
body.style-terminal .btn-reveal {
    background: rgba(0,0,0,0.5); color: #33ff33; border: 1px solid rgba(51,255,51,0.3);
    font-family: monospace;
}
body.style-terminal .btn-muted {
    background: transparent; color: rgba(51, 255, 51, 0.5); border: 1px dashed rgba(51, 255, 51, 0.2);
    font-family: monospace; box-shadow: none; text-shadow: none;
}
body.style-terminal .btn-next {
    background: #111; color: #33ff33; border: 1px solid #33ff33; font-weight: 900;
    font-family: monospace;
}
body.style-terminal .btn-modern:hover {
    background: #000; color: #33ff33; box-shadow: 0 0 20px rgba(51, 255, 51, 0.2);
}
body.style-terminal .btn-sidebar {
    background: transparent;
    color: rgba(51, 255, 51, 0.4);
    border: 1px dashed rgba(51, 255, 51, 0.2);
    font-family: 'Courier New', monospace;
}
body.style-terminal .btn-sidebar:hover {
    background: rgba(51, 255, 51, 0.05);
    color: #33ff33;
    border-style: solid;
}

/* ── 7. MATERIAL (elevación) ── */
body.style-material .btn-reveal {
    background: var(--surface-1); color: #90a4ae; border: none;
    box-shadow: 0 2px 2px rgba(0,0,0,0.3), 0 4px 8px rgba(0,0,0,0.2);
}
body.style-material .btn-muted {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border-light);
    box-shadow: none;
}
body.style-material .btn-next {
    background: #7e57c2; color: #fff; border: none;
    box-shadow: 0 4px 8px rgba(126, 87, 194, 0.35), 0 2px 2px rgba(0,0,0,0.3);
}
body.style-material .btn-modern:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.4), 0 4px 4px rgba(0,0,0,0.2);
    transform: translateY(-3px);
}
body.style-material .btn-sidebar {
    background: var(--surface-1);
    color: var(--text-muted);
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
body.style-material .btn-sidebar:hover {
    background: var(--menu-color);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* ── 8. NEON (resplandor de color) ── */
body.style-neon .btn-reveal {
    background: rgba(0, 0, 0, 0.5); color: #afff00; border: 2px solid #afff00; font-weight: bold;
    box-shadow: 0 0 5px rgba(175, 255, 0, 0.4), inset 0 0 5px rgba(175, 255, 0, 0.3); text-shadow: 0 0 5px #afff00;
}
body.style-neon .btn-muted {
    background: transparent; color: rgba(175, 255, 0, 0.5); border: 1px solid rgba(175, 255, 0, 0.2);
    font-weight: normal; box-shadow: none; text-shadow: none;
}
body.style-neon .btn-next {
    background: rgba(0, 0, 0, 0.5); color: #ff00de; border: 2px solid #ff00de; font-weight: bold;
    box-shadow: 0 0 5px rgba(255, 0, 222, 0.5), inset 0 0 15px rgba(255, 0, 222, 0.4); text-shadow: 0 0 8px #ff00de;
}
body.style-neon .btn-modern:hover {
    filter: brightness(1.3); box-shadow: 0 0 35px currentColor, inset 0 0 15px currentColor; transform: scale(1.02);
}

body.style-neon .btn-sidebar {
    background: transparent;
    color: rgba(175, 255, 0, 0.3);
    border: 1px solid rgba(175, 255, 0, 0.1);
}
body.style-neon .btn-sidebar:hover {
    color: #afff00;
    border-color: #afff00;
    box-shadow: 0 0 10px rgba(175, 255, 0, 0.2);
}

/* ── 9. MINIMAL (flat, solo texto) ── */
body.style-minimal .btn-reveal {
    background: transparent; color: var(--text-muted);
    border: none; border-bottom: 1px solid var(--border); border-radius: 0;
}
body.style-minimal .btn-muted {
    background: transparent; color: var(--text-subtle);
    border: none; border-bottom: 1px dotted var(--border-light); border-radius: 0; opacity: 0.6;
}
body.style-minimal .btn-next {
    background: transparent; color: var(--text-main);
    border: none; border-bottom: 2px solid #714486; border-radius: 0;
}
body.style-minimal .btn-modern:hover {
    color: var(--text-main); border-bottom-color: var(--accent); transform: none;
}
body.style-minimal .btn-sidebar {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 0;
}
body.style-minimal .btn-sidebar:hover {
    border-bottom: 1px solid var(--accent);
    color: var(--text-main);
}
/* ── 10. BRUTALIST (bordes gruesos, audaz) ── */
body.style-brutalist .btn-reveal {
    background: var(--bg-color); color: var(--text-muted);
    border: 2px solid var(--border); border-radius: 0;
    font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
}
body.style-brutalist .btn-muted {
    background: transparent; color: var(--text-muted);
    border: 2px dashed var(--border-light); border-radius: 0;
    font-weight: bold; box-shadow: none;
}
body.style-brutalist .btn-next {
    background: var(--text-main); color: var(--bg-color);
    border: 2px solid var(--text-main); border-radius: 0;
    font-weight: 900; text-transform: uppercase; letter-spacing: 1px;
}
body.style-brutalist .btn-modern:hover {
    border-color: var(--accent); color: var(--accent);
    background: var(--bg-color); transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--accent);
}
body.style-brutalist .btn-sidebar {
    background: var(--bg-color);
    color: var(--text-muted);
    border: 2px solid var(--border-light);
    border-radius: 0;
    font-weight: bold;
}
body.style-brutalist .btn-sidebar:hover {
    background: var(--surface-1);
    border-style: dashed;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--border-light);
}

/* ════════════════════════════════════════════════════════════════
   ANIMACIONES DE PULSADO (independientes del tema visual)
   ════════════════════════════════════════════════════════════════ */

body.click-none .btn-modern:active,
body.click-none .btn-modern.simulated-active { transform: none; box-shadow: none; opacity: 0.8; }

body.click-cyber .btn-modern:active,
body.click-cyber .btn-modern.simulated-active {
    transform: scale(0.98);
    box-shadow: 0 0 10px currentColor, inset 0 0 5px rgba(255,255,255,0.2);
    border-color: currentColor;
}

body.click-skeuo .btn-modern:active,
body.click-skeuo .btn-modern.simulated-active {
    transform: translateY(2px) scale(0.98);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5), inset -1px -1px 2px rgba(255,255,255,0.05) !important;
}

body.click-liquid .btn-modern:active,
body.click-liquid .btn-modern.simulated-active {
    transform: scale(0.97);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.1);
    filter: brightness(1.2);
}

/* NUEVA: Rebote Elástico */
body.click-bounce .btn-modern:active,
body.click-bounce .btn-modern.simulated-active {
    transform: scale(0.92);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* NUEVA: Impacto Brutalista */
body.click-brutal .btn-modern:active,
body.click-brutal .btn-modern.simulated-active {
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 currentColor !important;
    background: currentColor;
    color: var(--bg-color) !important;
    transition: all 0.05s linear;
}

/* ────── Animación RIPPLE (para style-material) ────── */
body.style-material .btn-modern::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
        rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
body.style-material .btn-modern:active::after { opacity: 1; transition: none; }

/* ════════════════════════════════════════════════════════════════
   POMODORO
   ════════════════════════════════════════════════════════════════ */
.pomodoro-wrapper { margin-top: 10px; text-align: center; }
.pomo-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; margin-top: 10px; }
.pomo-btn-mode {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.9em; padding: 5px 10px; border-radius: var(--r-xl);
}
.pomo-btn-mode.active {
    background: rgba(255,255,255,0.1); color: var(--text-main); font-weight: bold;
}

.pomo-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 25px; }

#timer-display {
    font-size: 5em; font-weight: bold; font-family: 'Courier New', monospace;
    margin: 10px 0; color: var(--text-main);
    font-variant-numeric: tabular-nums; letter-spacing: -2px;
}

.btn-pomo-big {
    width: 110px; height: 70px; border-radius: 24px;
    border: 3px solid rgba(255,255,255,0.15);
    background: var(--card-bg); color: var(--pomo-work);
    font-size: 2em; cursor: pointer;
    transition: all var(--t-base);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
}
.btn-pomo-big:hover {
    background: rgba(255,255,255,0.05); transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0,0,0,0.4); border-color: currentColor;
}
.btn-pomo-big:active  { transform: translateY(1px) scale(0.98); }

.btn-pomo-skip {
    width: 70px; height: 70px; border-radius: 24px;
    background: var(--card-bg); border: 3px solid var(--border);
    color: var(--text-subtle); cursor: pointer;
    transition: all var(--t-base);
    font-size: 1.5em;
    display: flex; align-items: center; justify-content: center;
    margin-left: 15px; box-shadow: var(--shadow-sm);
}
.btn-pomo-skip:hover  { color: var(--text-main); border-color: var(--text-subtle); transform: translateX(3px); }
.btn-pomo-skip:active { transform: translateY(1px) scale(0.98); }

.btn-circle-mini {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid var(--border-light); background: transparent;
    color: var(--text-main); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--t-base) var(--ease-out);
    font-size: 1em; line-height: 1;
}
.btn-circle-mini:hover  { background: rgba(255,255,255,0.1); transform: scale(1.15); border-color: var(--text-muted); color: white; box-shadow: 0 0 8px rgba(255,255,255,0.1); }
.btn-circle-mini:active { transform: scale(0.9); }

/* ── Tareas ── */
.add-task-btn {
    padding: 15px; border: 2px dashed var(--border-light);
    background: rgba(0,0,0,0.2); color: var(--text-muted);
    font-weight: bold; cursor: pointer; margin-top: 5px;
    border-radius: var(--r-md); transition: all var(--t-base);
}
.add-task-btn:hover { border-color: var(--text-subtle); color: var(--text-main); background: rgba(0,0,0,0.4); }

#task-form-panel {
    background: white; color: #333; padding: 20px;
    border-radius: var(--r-md); text-align: left; margin-top: 10px;
    box-shadow: var(--shadow-lg); animation: fadeIn 0.2s;
}
#task-form-panel input {
    background: #f0f0f0; border: 1px solid #ddd; color: #333;
    margin-bottom: 10px; font-size: 1.1em; padding: 12px;
}
#task-form-panel input::placeholder { color: #aaa; font-style: italic; }
#task-form-panel label { color: #666; margin-top: 10px; font-weight: bold; }

.est-pomo-container { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.est-pomo-input { width: 70px !important; font-weight: bold; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }
.btn-cancel { background: none; border: none; color: var(--text-subtle); font-weight: bold; cursor: pointer; padding: 10px 20px; }
.btn-save {
    background: var(--surface-2); color: var(--text-main); border: none;
    padding: 10px 25px; border-radius: var(--r-sm); font-weight: bold;
    cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn-save:hover { background: var(--surface-1); }
.btn-save-latex {
    background: var(--accent); color: rgb(0, 0, 0); border: none;
    padding: 10px 25px; border-radius: var(--r-sm); font-weight: bold;
    cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn-save-latex:hover { filter: brightness(1.1); }

.task-list { list-style: none; padding: 0; text-align: left; margin-top: 15px; }

.task-item {
    background: var(--surface-2); padding: 12px 15px; margin-bottom: 8px;
    border-radius: var(--r-md); display: flex; justify-content: space-between;
    align-items: center; cursor: pointer; position: relative; overflow: hidden;
    --task-color: var(--text-subtle);
    border: 1px solid transparent;
    border-left: 6px solid var(--task-color);
    transition: all var(--t-base) var(--ease-out);
    box-shadow: var(--shadow-sm);
}
.task-item:hover {
    background: var(--surface-3); border-color: var(--task-color);
    box-shadow: 0 8px 2px -5px var(--task-color); z-index: 10;
}
.task-item:active { transform: scale(0.98) translateY(-1px); box-shadow: 0 4px 10px -2px var(--task-color); }
.task-item.active-task {
    background: var(--surface-3); border-color: var(--task-color);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.3), 0 0 10px var(--task-color);
}
.task-item.done {
    opacity: 0.6; border-left-color: var(--border-light);
    --task-color: var(--border-light); text-decoration: line-through;
}

.task-progress-bg { height: 4px; background: rgba(0,0,0,0.3); width: 100px; margin-top: 5px; border-radius: 2px; overflow: hidden; }
.pomo-count { font-weight: bold; color: #ccc; font-size: 0.9em; margin-right: 10px; }

/* ════════════════════════════════════════════════════════════════
   MÓDULO PDF
   ════════════════════════════════════════════════════════════════ */
#modulo-pdf {
    position: relative;
    background: var(--card-bg); border-radius: var(--r-md);
    border: 1px solid var(--border); margin-top: 15px;
    overflow: hidden; display: flex; flex-direction: column;
    transition: all var(--t-slow) var(--ease-out);
    box-shadow: var(--shadow-md);
    z-index: var(--z-pdf);
}
#modulo-pdf.pdf-collapsed {
    background: transparent; border-color: transparent; box-shadow: none; align-items: center;
}

#pdf-inner-wrapper {
    display: grid; grid-template-rows: 1fr;
    transition: grid-template-rows var(--t-slow) var(--ease-out);
    width: 100%;
}
#modulo-pdf.pdf-collapsed #pdf-inner-wrapper { grid-template-rows: 0fr; }
#pdf-inner-content { overflow: hidden; opacity: 1; transition: opacity var(--t-slow); display: flex; flex-direction: column; }
#modulo-pdf.pdf-collapsed #pdf-inner-content { opacity: 0; pointer-events: none; }

#pdf-toggle-mini {
    display: none;
    background: var(--surface-1);
    border: 2px solid var(--dynamic-color, var(--accent));
    color: var(--dynamic-color, var(--accent));
    border-radius: var(--r-xl); cursor: pointer;
    padding: 8px 24px; font-size: 0.85em; font-weight: bold;
    align-items: center; gap: 8px; letter-spacing: 0.5px;
    transition: all var(--t-base) var(--ease-out);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-pdf);
}
#pdf-toggle-mini:hover { background: var(--dynamic-color, var(--accent)); color: var(--bg-color); box-shadow: var(--shadow-md); }
#modulo-pdf.pdf-collapsed #pdf-toggle-mini { display: flex;  z-index: var(--z-pdf);}

#pdf-header-bar {
    padding: 10px 15px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface-1); border-bottom: 1px solid rgba(0,0,0,0.2);
    transition: filter var(--t-fast); user-select: none;
}
#pdf-header-bar:hover { filter: brightness(1.1); }

.recursos-container {
    padding: 15px; background: var(--menu-color);
    border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}

.slot-chip {
    display: flex; align-items: center;
    background: var(--surface-1); border: 1px solid var(--border-light);
    border-radius: var(--r-sm); padding: 6px 10px;
    font-size: 0.85em; cursor: pointer;
    transition: all var(--t-base); color: var(--text-muted); user-select: none;
}
.slot-chip:hover { background: var(--surface-2); border-color: var(--text-subtle); color: var(--text-main); transform: translateY(-1px); }
.slot-chip.loaded { background: rgba(33, 150, 243, 0.15); border-left: 3px solid var(--status-blue); color: var(--text-main); }
.slot-chip.active-view { background: var(--accent); border-color: var(--accent); color: var(--bg-color); font-weight: bold; }

.slot-del-btn {
    margin-left: 8px; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(0,0,0,0.2);
    font-size: 0.9em; line-height: 0; color: inherit; border: none; cursor: pointer;
}
.slot-del-btn:hover { background: #ff5252; color: white; }

#visor-pdf-container {
    height: 700px; background: var(--bg-color);
    position: relative; display: flex; align-items: center; justify-content: center;
}
#pdf-placeholder { text-align: center; color: var(--border-light); }
iframe#pdf-frame { width: 100%; height: 100%; border: none; display: none; }

/* ════════════════════════════════════════════════════════════════
   DASHBOARD — WIDGETS
   ════════════════════════════════════════════════════════════════ */
.stat-widget {
    background: var(--card-bg); border-radius: var(--r-md);
    padding: 15px; margin-bottom: 15px; border: 1px solid var(--border);
}
.stat-title {
    color: var(--text-muted); font-size: 0.85em; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border-light); padding-bottom: 5px;
}

/* ── Anillo de progreso ── */
.ring-container {
    position: relative; width: 120px; height: 120px; margin: 0 auto;
    background: var(--card-bg); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.multi-color-donut {
    width: 100%; height: 100%; border-radius: 50%;
    background: conic-gradient(var(--surface-2) 0% 100%);
    transition: background 0.5s ease;
    -webkit-mask: radial-gradient(transparent 62%, black 63%);
    mask: radial-gradient(transparent 62%, black 63%);
}
.ring-text {
    position: absolute; display: flex; flex-direction: column;
    align-items: center; line-height: 1; z-index: 10; pointer-events: none;
}
.ring-percent { font-size: 1.8em; font-weight: 700; color: var(--text-main); }
.ring-label   { font-size: 0.6em; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

/* ── Heatmap calendario ── */
.heatmap-container { display: flex; flex-direction: column; gap: 5px; }
.week-days-header  { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 2px; }
.week-day-name     { text-align: center; font-size: 0.6em; color: var(--text-subtle); text-transform: uppercase; }
.heatmap-grid      { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.heatmap-day {
    width: 100%; aspect-ratio: 1; border-radius: 2px;
    background: var(--surface-2); font-size: 0.7em;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: default; transition: all var(--t-fast);
    position: relative;
}
.day-past-done    { background: var(--status-blue); color: white; box-shadow: 0 0 5px rgba(33, 150, 243, 0.4); }
.day-past-missed  { background: var(--status-red); color: white; font-weight: bold; border: 1px solid #ff8a80; }
.day-today-indicator {
    background: var(--surface-1); color: white; font-weight: bold;
    outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 3px;
}
.day-today-active  { background: var(--status-green) !important; color: white; outline-color: #81c784; }
.day-future-pending { background: var(--status-yellow); color: var(--bg-color); opacity: 0.8; font-weight: bold; }
.heatmap-day[data-tip]:not([data-tip=""]):hover { cursor: pointer; filter: brightness(1.25); }

.heatmap-day:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background: var(--bg-color); color: var(--text-main); font-size: 0.75em;
    white-space: pre; padding: 4px 8px; border-radius: var(--r-sm);
    border: 1px solid var(--border-light);
    z-index: var(--z-top); pointer-events: none; min-width: 80px; text-align: center;
}

.heatmap-day .event-dot {
    position: absolute; top: 2px; right: 2px;
    width: 5px; height: 5px; border-radius: 50%;
    background: white; opacity: 0.85; pointer-events: none;
}

/* ── Barras de distribución ── */
.diff-bar-row { display: flex; align-items: center; margin-bottom: 5px; font-size: 0.8em; }
.diff-label   { width: 60px; color: #aaa; }
.diff-track   { flex-grow: 1; height: 6px; background: var(--surface-1); border-radius: 3px; overflow: hidden; }
.diff-fill    { height: 100%; }
.diff-val     { width: 30px; text-align: right; color: var(--text-main); }
.diff-delta         { font-size: 0.7em; width: 30px; text-align: right; }
.diff-delta.up      { color: var(--status-green); }
.diff-delta.down    { color: var(--status-red); }
.diff-delta.neutral { color: var(--text-subtle); }

/* ── Toggle semanal ── */
.weekly-toggle { display: flex; gap: 4px; margin-bottom: 8px; }
.weekly-toggle button {
    flex: 1; padding: 3px 0; background: var(--surface-2);
    border: 1px solid var(--border-light); color: var(--text-muted);
    border-radius: var(--r-sm); cursor: pointer; font-size: 0.7em; transition: var(--t-fast);
}
.weekly-toggle button.active { background: #19a693; border-color: #19a693; color: white; }

.bar-popup {
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background: var(--menu-color); border: 1px solid var(--border-light);
    border-radius: var(--r-md); padding: 6px 10px; font-size: 0.72em;
    white-space: nowrap; z-index: var(--z-top); color: #ccc; pointer-events: none;
    box-shadow: var(--shadow-lg);
}

/* ── Deuda de estudio ── */
#deuda-score     { font-size: 2.8em; font-weight: bold; line-height: 1; }
.deuda-breakdown { font-size: 0.7em; color: var(--text-muted); margin-top: 8px; }
.deuda-item      { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px solid var(--surface-1); }

/* ── Eficiencia ── */
.eficiencia-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px; }
.eficiencia-cell  { background: var(--card-bg); border-radius: var(--r-md); padding: 8px; text-align: center; }
.eficiencia-num   { font-size: 1.6em; font-weight: bold; }
.eficiencia-label { font-size: 0.6em; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

/* ── Mapa horas ── */
.hora-heatmap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 8px; }
.hora-cell {
    height: 22px; border-radius: 3px; background: var(--surface-1);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.55em; color: var(--border-light); cursor: default;
    transition: var(--t-fast); position: relative;
}
.hora-cell:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background: var(--bg-color); color: var(--text-main); padding: 3px 7px;
    border-radius: var(--r-sm); border: 1px solid var(--border-light);
    white-space: nowrap; z-index: var(--z-top); font-size: 1.2em;
}

/* ── Contención MathJax en widgets ── */
.stat-widget mjx-container {
    max-width: 100% !important; overflow-x: auto !important; overflow-y: hidden !important; padding: 2px 0;
}
.stat-widget mjx-container::-webkit-scrollbar       { height: 3px; }
.stat-widget mjx-container::-webkit-scrollbar-thumb { background: var(--border-light); }

/* ── Widget pendientes ── */
#pending-list-items {
    height: 250px; overflow-y: auto; overflow-x: hidden;
    background: rgba(0,0,0,0.2); border-radius: var(--r-sm);
    padding: 5px; margin-top: 10px;
    scrollbar-width: thin; scrollbar-color: var(--border-light) var(--surface-1);
}
#widget-pendientes .stat-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; border-radius: var(--r-sm); margin-bottom: 4px;
    background: rgba(255,255,255,0.03); transition: background var(--t-fast);
}
.pending-item:hover { background: rgba(255,255,255,0.08); }
.pending-item-title {
    flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-right: 8px; color: var(--text-main); font-size: 0.95em;
}

/* ════════════════════════════════════════════════════════════════
   WIDGET MANAGER
   ════════════════════════════════════════════════════════════════ */
.widget-controls {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 4px; margin-bottom: 4px; opacity: 0; transition: opacity var(--t-fast); height: 18px;
}
.stat-widget:hover .widget-controls { opacity: 1; }

.widget-drag-handle {
    cursor: grab; color: var(--text-subtle); font-size: 1.1em;
    padding: 0 4px; line-height: 1; user-select: none;
}
.widget-drag-handle:active { cursor: grabbing; }

.widget-ctrl-btn {
    background: none; border: none; cursor: pointer; color: var(--text-subtle);
    font-size: 0.75em; padding: 2px 5px; border-radius: 3px; line-height: 1;
    transition: color var(--t-fast), background var(--t-fast);
}
.widget-ctrl-btn:hover { color: #ccc; background: var(--surface-2); }

.stat-widget.widget-minimized > *:not(.widget-controls):not(.stat-title) { display: none !important; }
.stat-widget.widget-minimized > .stat-title { margin-bottom: 0; opacity: 0.6; }
.stat-widget.widget-minimized { padding-bottom: 8px; }
.stat-widget.widget-hidden    { display: none !important; }
.stat-widget.widget-dragging  { opacity: 0.45; outline: 2px dashed var(--accent); }
.stat-widget.widget-drag-over { outline: 2px solid var(--accent); outline-offset: -2px; }

#widget-manage-panel {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 18px;
    z-index: var(--z-top); min-width: 240px; max-width: 300px;
    box-shadow: var(--shadow-lg); display: none;
}
#widget-manage-panel.open { display: block; }
#widget-manage-panel h3   { margin: 0 0 12px; font-size: 0.85em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.wmp-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 0.8em; color: var(--text-main);
}
.wmp-row:last-child { border-bottom: none; }
.wmp-toggle {
    cursor: pointer; padding: 2px 8px; border-radius: var(--r-sm);
    border: 1px solid var(--border); background: none; font-size: 0.75em; color: var(--text-muted);
    transition: all var(--t-fast);
}
.wmp-toggle.active { color: var(--status-green); border-color: var(--status-green); }
#widget-manage-close {
    margin-top: 12px; width: 100%; padding: 6px;
    background: var(--surface-1); border: none; border-radius: var(--r-sm);
    color: var(--text-muted); cursor: pointer; font-size: 0.8em;
}
#widget-manage-close:hover { background: var(--border); color: var(--text-main); }

/* ════════════════════════════════════════════════════════════════
   MODALES
   ════════════════════════════════════════════════════════════════ */
/* Z-index unificado — antes declarado en 3 sitios distintos */
#ajustes-modal,
#pomodoro-modal,
#fechas-modal {z-index: var(--z-modal);}
#resumen-sesion-modal,
#modal-filtros {z-index: var(--z-top);}
#modal-amigos { z-index: var(--z-top); }

#ajustes-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
}
.modal-content {
    background: var(--card-bg); padding: 30px; border-radius: var(--r-md);
    width: 90%; max-width: 500px; border: 1px solid var(--border);
    max-height: 80vh; overflow-y: auto;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 1px solid var(--border-light); padding-bottom: 10px;
}
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.setting-row input { width: 60px; text-align: center; }

/* Resumen sesión */
#resumen-sesion-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
#resumen-sesion-modal.visible { display: flex; }
.resumen-card {
    background: var(--card-bg); border: 1px solid var(--border-light); border-radius: var(--r-lg);
    padding: 28px 32px; max-width: 380px; width: 90%; text-align: center;
    animation: popIn 0.3s var(--ease-spring);
}
.resumen-title    { font-size: 1.1em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.resumen-stats    { display: flex; justify-content: space-around; margin: 16px 0; }
.resumen-stat     { flex: 1; }
.resumen-num      { font-size: 2.4em; font-weight: bold; }
.resumen-lbl      { font-size: 0.65em; color: var(--text-muted); text-transform: uppercase; }
.resumen-breakdown { font-size: 0.75em; color: #aaa; margin: 12px 0; text-align: left; line-height: 1.8; }

/* Fechas clave */
#fechas-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(3px);
    align-items: center; justify-content: center;
}
#fechas-modal.visible { display: flex; }
.fechas-card {
    background: var(--card-bg); border: 1px solid var(--border-light); border-radius: var(--r-lg);
    padding: 24px; width: 420px; max-width: 95vw;
    max-height: 85vh; display: flex; flex-direction: column; gap: 14px;
}
.fechas-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fechas-form input,
.fechas-form select {
    background: var(--surface-1); border: 1px solid var(--border-light);
    color: var(--text-main); border-radius: var(--r-md); padding: 7px 10px; font-size: 0.85em;
}
.fechas-form input[type="text"] { grid-column: 1 / -1; }
.fechas-form button {
    grid-column: 1 / -1; padding: 8px; background: var(--accent); border: none;
    border-radius: var(--r-md); color: var(--bg-color); font-weight: bold; cursor: pointer; font-size: 0.9em;
}
.fechas-list { overflow-y: auto; flex-grow: 1; }

#btn-add-fecha {
    background: none; border: 1px solid var(--border-light); color: var(--text-muted);
    border-radius: var(--r-sm); cursor: pointer; font-size: 0.8em;
    padding: 2px 7px; transition: all var(--t-fast); line-height: 1.4;
}
#btn-add-fecha:hover { border-color: var(--accent); color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   AJUSTES — PESTAÑAS
   ════════════════════════════════════════════════════════════════ */
#settings-tabs { overflow-x: auto; scrollbar-width: none; }
#settings-tabs::-webkit-scrollbar { display: none; }

.stab {
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-subtle); cursor: pointer; font-size: 0.78em;
    font-weight: 600; letter-spacing: 0.3px; padding: 8px 12px;
    transition: color var(--t-fast), border-color var(--t-fast); white-space: nowrap;
}
.stab:hover { color: #bbb; }
.stab.stab-active { color: var(--accent); border-bottom-color: var(--accent); }
.stab-panel { animation: stabFadeIn 0.15s ease; }
.stab-icon  { color: rgb(120, 53, 187); font-size: 1.1em; }

/* ── Horario ── */
.schedule-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 5px; margin-bottom: 15px;
}
.schedule-day-box {
    background: var(--surface-2); border: 1px solid var(--border-light);
    border-radius: var(--r-sm); min-height: 80px; height: auto;
    cursor: pointer; display: flex; flex-direction: column; align-items: center;
    padding: 5px; transition: all var(--t-fast);
}
.schedule-day-box:hover    { background: var(--surface-3); border-color: var(--accent); }
.schedule-day-box.selected { border: 2px solid var(--accent); background: var(--surface-1); }
.day-label    { font-size: 0.8em; color: #aaa; font-weight: bold; margin-bottom: 5px; text-transform: uppercase; }
.day-content  { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.mini-subject-tag {
    font-size: 0.75em; padding: 4px; border-radius: 3px; color: white;
    text-align: center; line-height: 1.2; white-space: normal;
    word-wrap: break-word; overflow-wrap: break-word; width: 100%; box-sizing: border-box;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ════════════════════════════════════════════════════════════════
   MODO EXAMEN
   ════════════════════════════════════════════════════════════════ */
.exam-mode-selector {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px;
}
.exam-mode-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; padding: 12px; border: 2px solid var(--border);
    border-radius: var(--r-lg); cursor: pointer; background: transparent;
    color: var(--text-muted); transition: all var(--t-base) var(--ease-out);
    position: relative; overflow: hidden;
}
.exam-mode-card:hover:not(.active) {
    border-color: rgba(76, 175, 80, 0.3); background: var(--menu-color);
    color: var(--text-main); transform: translateY(-2px);
}
.exam-mode-card.active { border-color: var(--accent); background: rgba(76, 175, 80, 0.12); color: #fff; }
.exam-mode-card.active::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.exam-mode-card .exam-mode-icon { font-size: 1.5em; }
.exam-mode-card strong          { font-size: 0.8em; font-weight: 600; }

.exam-correction-card { border: 1px solid var(--surface-1); border-radius: var(--r-md); padding: 14px; background: var(--menu-color); margin-bottom: 12px; }
.exam-card-header     { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.exam-badge           { font-size: 0.7em; padding: 1px 8px; border-radius: 10px; }
.exam-meta            { font-size: 0.75em; color: var(--border-light); }
.exam-meta.right      { margin-left: auto; color: var(--text-muted); }
.exam-card-title      { font-weight: bold; color: var(--text-main); margin-bottom: 10px; }
.exam-card-grid       { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; font-size: 0.85em; }
.exam-col-label       { color: var(--text-muted); margin-bottom: 4px; font-size: 0.8em; text-transform: uppercase; }
.exam-ans-box         { background: var(--menu-color); border-radius: var(--r-sm); padding: 8px; min-height: 40px; white-space: pre-wrap; line-height: 1.5; }
.exam-ans-box.user-ans    { color: #aaa; }
.exam-ans-box.correct-ans { color: #ccc; }
.exam-grade-grid      { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.exam-btn-grade { padding: 7px 2px; border-radius: var(--r-md); cursor: pointer; font-size: 0.8em; font-weight: bold; transition: all var(--t-base); }
.exam-btn-grade.grade-1 { background: rgba(33,150,243,0.2); border: 1px solid var(--status-blue);   color: var(--status-blue); }
.exam-btn-grade.grade-2 { background: rgba(76,175,80,0.2);  border: 1px solid var(--status-green);  color: var(--status-green); }
.exam-btn-grade.grade-3 { background: rgba(255,152,0,0.2);  border: 1px solid var(--status-yellow); color: var(--status-yellow); }
.exam-btn-grade.grade-4 { background: rgba(244,67,54,0.2);  border: 1px solid var(--status-red);    color: var(--status-red); }

/* ════════════════════════════════════════════════════════════════
   PIZARRA
   ════════════════════════════════════════════════════════════════ */
#pizarra-canvas { position: fixed; top: 0; left: 0; z-index: 9000; cursor: crosshair; touch-action: none; }

/* ════════════════════════════════════════════════════════════════
   CHAT IA
   ════════════════════════════════════════════════════════════════ */
#btn-open-chat {
    position: fixed; bottom: 80px; right: 20px;
    width: 50px; height: 50px; border-radius: 50%;
    background: radial-gradient(circle, #2d1b4e 0%, #000 100%);
    border: 1px solid var(--border-light); color: white;
    cursor: pointer; box-shadow: var(--shadow-lg);
    z-index: var(--z-top);
    transition: all var(--t-base);
    display: flex; align-items: center; justify-content: center;
}
#btn-open-chat i {
    font-size: 1.4em; color: #800000;
    filter: drop-shadow(0 0 8px #ffdd00); transition: all var(--t-slow);
}
#btn-open-chat:hover { transform: scale(1.1); box-shadow: 0 0 20px #ffdd00; border-color: #ffdd00; }
#btn-open-chat:hover i { filter: drop-shadow(0 0 15px #ffdd00); }

#ai-chat-widget {
    position: fixed; bottom: 90px; right: 80px;
    width: 350px; height: 500px; background: var(--card-bg);
    border: 1px solid var(--border-light); border-radius: var(--r-lg);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg); z-index: var(--z-top); overflow: hidden;
    transition: opacity var(--t-fast), transform var(--t-fast);
}
.chat-header {
    background: var(--surface-1); padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between;
    font-weight: bold; color: #a0a0a0; font-size: 0.9em;
}
#chat-messages {
    flex-grow: 1; padding: 15px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px; font-size: 0.9em;
}
.chat-msg { padding: 8px 12px; border-radius: var(--r-md); max-width: 85%; line-height: 1.4; word-wrap: break-word; }
.chat-msg.system { align-self: center; background: var(--surface-2); color: #aaa; font-size: 0.8em; }
.chat-msg.user   { align-self: flex-end; background: var(--status-blue); color: white; }
.chat-msg.ai     { align-self: flex-start; background: var(--surface-1); color: var(--text-main); border: 1px solid var(--border); }
.chat-input-area {
    padding: 10px; background: var(--card-bg); border-top: 1px solid var(--border);
    display: flex; gap: 10px;
}
#ai-user-input {
    flex-grow: 1; background: var(--bg-color); border: 1px solid var(--border-light);
    color: white; border-radius: var(--r-sm); padding: 8px;
    resize: none; height: 40px; font-family: inherit;
}
#btn-send-ai {
    background: var(--status-blue); color: white; border: none;
    border-radius: var(--r-sm); width: 40px; cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════
   COLORES SEMÁNTICOS APARTADOS (para clases inyectadas por JS)
   ════════════════════════════════════════════════════════════════ */
.color-Definición  { color: #c40202; }
.color-Teorema     { color: #1e4fb2; }
.color-Proposición { color: #16a116; }
.color-Lema        { color: #20603D; }
.color-Corolario   { color: #3883c2; }
.color-Axioma      { color: #dabcfa; }
.color-Observación { color: #7242A3; }
.color-Nota        { color: #9e9e9e; }
.color-Ejemplo     { color: #3CAF6E; }
.color-Demot           { color: #1e4fb2; border-left-color: #1e4fb2; }
.color-Demop           { color: #16a116; border-left-color: #16a116; }
.color-Demol           { color: #20603D; border-left-color: #20603D; }
.color-Democ           { color: #3883c2; border-left-color: #3883c2; }

/* ════════════════════════════════════════════════════════════════
   UTILIDADES SEMÁNTICAS
   ════════════════════════════════════════════════════════════════ */
.text-success { color: var(--status-green)  !important; }
.text-danger  { color: var(--status-red)    !important; }
.text-warning { color: var(--status-yellow) !important; }
.text-info    { color: var(--status-blue)   !important; }
.text-muted   { color: var(--text-muted)    !important; }

.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-col     { display: flex; flex-direction: column; }

/* ════════════════════════════════════════════════════════════════
   HOVER OVERRIDES (extraídos de inline handlers)
   ════════════════════════════════════════════════════════════════ */
#btn-abrirajustes               { transition: color var(--t-base), transform var(--t-base); }
#btn-abrirajustes:hover         { color: var(--accent) !important; transform: rotate(50deg); }
#btn-abrirmodalpomodoro         { transition: transform var(--t-base), opacity var(--t-base); opacity: 0.7; }
#btn-abrirmodalpomodoro:hover   { transform: rotate(180deg); opacity: 1 !important; }

/* ════════════════════════════════════════════════════════════════
   IMPORTADOR TABULADO
   ════════════════════════════════════════════════════════════════ */
#panel-import-json, #panel-import-latex { animation: fadeIn 0.3s; }

/* ════════════════════════════════════════════════════════════════
   FILTROS MODAL
   ════════════════════════════════════════════════════════════════ */
.filter-wrapper {
    display: flex; align-items: center;
    max-width: 0; opacity: 0; overflow: hidden;
    transition: all var(--t-slow) var(--ease-out); transform-origin: right center;
}
.filters-active .filter-wrapper { max-width: 500px; opacity: 1; margin-right: 10px; }

.btn-morph { position: relative; width: 30px; height: 30px; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; }
.btn-morph .icon-layer { position: absolute; transition: all var(--t-base) var(--ease-out); font-size: 1.4em; line-height: 1; transform-origin: center; }
.btn-morph .icon-eye  { transform: scaleY(1); opacity: 1; }
.btn-morph .icon-bar  { transform: scaleY(0); opacity: 0; }
.filters-active .btn-morph .icon-eye { transform: scaleY(0); opacity: 0; }
.filters-active .btn-morph .icon-bar { transform: scaleY(1); opacity: 1; color: #aaa; }

/* ════════════════════════════════════════════════════════════════
   JSON EDITOR
   ════════════════════════════════════════════════════════════════ */
#json-editor-area {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px; background: var(--menu-color);
    color: #a9b7c6; line-height: 1.5;
    border: 1px solid var(--border-light);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE & MOBILE LAYOUT
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 950px) {
    /* FIX: font-size 16px solo en móvil para evitar zoom en iOS, no globalmente */
    input, textarea, select { font-size: 16px !important; }

    .container {
        display: block;
        padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
    }
    #main-content {
        width: 100%;
        padding: max(15px, var(--safe-top)) 15px 15px 15px;
    }
    #sidebar-toggle, .mobile-close-stats { display: none !important; }

    #sidebar {
        display: flex !important; position: fixed;
        top: 0; left: 0; height: 100dvh;
        width: 85vw; max-width: 320px;
        z-index: 5002;
        transform: translateX(-100%);
        transition: transform var(--t-slow) var(--ease-out);
        padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
        box-shadow: none;
    }
    #sidebar.mobile-open { transform: translateX(0); box-shadow: 5px 0 25px rgba(0,0,0,0.6); }

    #dashboard-col {
        display: block !important; position: fixed;
        top: 0; left: 0; height: 100dvh; width: 100vw;
        background: var(--bg-color); z-index: 5001;
        overflow-y: auto;
        overflow-x: hidden; /* Forzar bloqueo de desbordamiento horizontal */
        box-sizing: border-box; /* Contener el padding dentro de los 100vw */
        padding: max(20px, var(--safe-top)) 20px calc(var(--nav-height) + var(--safe-bottom) + 20px) 20px;
        transform: translateY(100%);
        transition: transform var(--t-slow) var(--ease-out);
    }
    #dashboard-col.mobile-active { transform: translateY(0); }

    #ajustes-modal, #pomodoro-modal, .modal, .modal-overlay { z-index: var(--z-top) !important; }

    #modulo-pdf {
        position: fixed !important; bottom: 0; left: 0;
        width: 100vw; height: calc(100dvh - var(--safe-top));
        z-index: 8000 !important; border-radius: var(--r-lg) var(--r-lg) 0 0;
        margin: 0; transform: translateY(100%);
        transition: transform var(--t-slow) var(--ease-spring);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    }
    #modulo-pdf:not(.pdf-collapsed) { transform: translateY(0); }
    #visor-pdf-container { height: 100% !important; flex-grow: 1; }

    #mobile-nav-bar {
        display: flex !important; position: fixed; bottom: 0; left: 0;
        width: 100%; height: calc(var(--nav-height) + var(--safe-bottom));
        background: rgba(30, 30, 30, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid var(--border); z-index: var(--z-nav);
        justify-content: space-evenly; align-items: flex-start;
        padding-bottom: var(--safe-bottom);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    }

    mjx-container[display="true"] {
        max-width: 100% !important; overflow-x: auto !important; overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch; padding: 10px 0 !important;
    }

    .controls { flex-direction: column; gap: 8px; margin-top: 20px; }
    .btn-dif   { margin: 0; width: 100%; }

    #ai-chat-widget { width: 100%; height: 50%; bottom: 0; right: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}

/* Botones mínimos 48px táctiles */
@media (max-width: 950px) {
    .btn-dif, .btn-modern, .mobile-nav-btn { min-height: 48px; }
}

#mobile-nav-bar { display: none; }

@media (min-width: 951px) {
    #mobile-nav-bar { display: none !important; }
}

.mobile-nav-btn {
    background: transparent; border: none; color: #777; font-size: 1.6em;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; height: var(--nav-height); cursor: pointer; transition: color var(--t-fast);
}
.mobile-nav-btn.active { color: var(--accent); }
.mobile-nav-btn span   { font-size: 0.35em; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; font-weight: 600; }


/* ── Modales Globales ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.visible .modal-content {
    transform: translateY(0);
}