/* ESTILOS COMUNICADOR SAAC CHRYSALIS - SISTEMA VISUAL PROLOQUO & KEY FITZGERALD ORIGINAL */
:root {
    --proloquo-bg: #0f172a;
    --window-bg: #1e293b;
    --card-bg: #334155;
    --text-main: #f8fafc;
    --text-dark: #0f172a;
    
    /* FITZGERALD KEY COLOR SYSTEM */
    --color-pronoun: #fef08a; /* Yellow */
    --border-pronoun: #eab308;
    --color-verb: #bbf7d0;    /* Green */
    --border-verb: #22c55e;
    --color-noun: #fed7aa;    /* Orange */
    --border-noun: #f97316;
    --color-adj: #bfdbfe;     /* Blue */
    --border-adj: #3b82f6;
    --color-social: #fbcfe8;  /* Pink */
    --border-social: #ec4899;
    --color-folder: #e0f2fe;  /* Cyan */
    --border-folder: #0284c7;
    
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* ADAPTACIÓN DINÁMICA DE TAMAÑO Y ZOOM ARMÓNICO */
    --comunicador-zoom: 1;
    --tile-height: calc(115px * var(--comunicador-zoom, 1));
    --tile-img-box-h: calc(72px * var(--comunicador-zoom, 1));
    --tile-font-size: calc(0.95rem * var(--comunicador-zoom, 1));
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

::-webkit-scrollbar {
    display: none !important;
    width: 0px !important;
    height: 0px !important;
}
html {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: #0f172a !important;
    -webkit-touch-callout: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.proloquo-theme {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--font);
    background: #0f172a !important;
    color: var(--text-main);
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
    -webkit-touch-callout: none !important;
    box-sizing: border-box !important;
}

.proloquo-app {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    min-height: 0 !important;
    background: var(--proloquo-bg, #0f172a) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 0px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* MESSAGE WINDOW (BARRA DE FRASE Y BOTONES QUE SE ADAPTAN AL 100% DEL ANCHO) */
.proloquo-message-window {
    background: #1e293b !important;
    border-bottom: 2px solid #334155 !important;
    padding: 0.4rem 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    height: clamp(85px, 14vh, 115px) !important;
    min-height: 85px !important;
    max-height: 115px !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.message-display {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    background: #ffffff !important;
    border: 3px solid #94a3b8 !important;
    border-radius: 14px !important;
    height: calc(100% - 6px) !important;
    min-height: 70px !important;
    max-height: 98px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.35rem 0.75rem !important;
    overflow-x: auto !important;
    box-sizing: border-box !important;
}

.message-placeholder { color: #64748b; font-size: 1.05rem; font-weight: 700; width: 100%; text-align: center; }

.sentence-chip {
    background: #ffffff; border: 2.5px solid #0284c7; border-radius: 12px; padding: 0.25rem;
    display: flex; flex-direction: column; align-items: center;
    min-width: 80px; width: clamp(80px, 8vw, 95px); height: calc(100% - 8px); justify-content: space-between;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.sentence-chip img { width: auto; height: calc(100% - 22px); max-height: 52px; object-fit: contain; }
.sentence-chip span { font-size: 0.8rem; font-weight: 900; color: #0f172a; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.sentence-chip.speaking-now { border-color: #16a34a !important; background: #dcfce7 !important; transform: scale(1.1); box-shadow: 0 0 18px #22c55e !important; }

.message-actions { display: flex; gap: 0.45rem; height: calc(100% - 6px); align-items: center; }
.proloquo-btn { font-family: var(--font); font-weight: 900; font-size: 0.95rem; border: none; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; transition: all 0.15s ease; }

/* BOTÓN INICIO / HOME Y ACCIONES */
.btn-sentence-home {
    background: linear-gradient(180deg, #10b981, #059669);
    color: white;
    font-family: var(--font);
    font-weight: 900;
    font-size: 0.95rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: clamp(80px, 8.5vw, 104px) !important;
    min-width: 80px !important;
    max-width: 104px !important;
    height: calc(100% - 6px) !important;
    min-height: 70px !important;
    max-height: 98px !important;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.45);
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.btn-sentence-home:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-speak { background: linear-gradient(180deg, #0284c7, #0369a1); color: white; width: clamp(80px, 8.5vw, 104px) !important; min-width: 80px !important; max-width: 104px !important; height: calc(100% - 6px) !important; min-height: 70px !important; max-height: 98px !important; box-shadow: 0 5px 15px rgba(2, 132, 199, 0.45); }
.btn-speak:hover { background: #0369a1; transform: translateY(-2px); }
.btn-backspace { background: #f59e0b; color: white; width: clamp(80px, 8.5vw, 104px) !important; min-width: 80px !important; max-width: 104px !important; height: calc(100% - 6px) !important; min-height: 70px !important; max-height: 98px !important; box-shadow: 0 5px 15px rgba(245, 158, 11, 0.45); }
.btn-backspace:hover { background: #d97706; transform: translateY(-2px); }
.btn-clear { background: #ef4444; color: white; width: clamp(80px, 8.5vw, 104px) !important; min-width: 80px !important; max-width: 104px !important; height: calc(100% - 6px) !important; min-height: 70px !important; max-height: 98px !important; box-shadow: 0 5px 15px rgba(239, 68, 68, 0.45); }
.btn-clear:hover { background: #dc2626; transform: translateY(-2px); }
.btn-fullscreen { background: linear-gradient(180deg, #8b5cf6, #7c3aed); color: white; width: clamp(80px, 8.5vw, 104px) !important; min-width: 80px !important; max-width: 104px !important; height: calc(100% - 6px) !important; min-height: 70px !important; max-height: 98px !important; box-shadow: 0 5px 15px rgba(139, 92, 246, 0.45); }
.btn-fullscreen:hover { background: #6d28d9; transform: translateY(-2px); }

/* BANNERS */
.session-active-banner { background: linear-gradient(90deg, #0284c7, #0369a1); color: white; padding: 0.5rem 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #38bdf8; }
.session-info { display: flex; align-items: center; gap: 0.75rem; }
.session-badge { background: #fef08a; color: #0f172a; font-weight: 900; font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 6px; }
.session-title-text { font-size: 0.9rem; font-weight: 800; }
.btn-end-session { background: rgba(239, 68, 68, 0.3); color: white; border: 1px solid #ef4444; padding: 0.3rem 0.75rem; border-radius: 8px; font-weight: 800; font-size: 0.8rem; cursor: pointer; }

.practice-banner { background: linear-gradient(90deg, #065f46, #047857); color: white; padding: 0.5rem 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #10b981; }
.practice-info { display: flex; align-items: center; gap: 0.75rem; }
.practice-badge { background: #fef08a; color: #0f172a; font-weight: 900; font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 6px; }
.practice-instruction { font-size: 0.9rem; font-weight: 800; }
.btn-cancel-practice { background: rgba(239, 68, 68, 0.3); color: white; border: 1px solid #ef4444; padding: 0.3rem 0.75rem; border-radius: 8px; font-weight: 800; font-size: 0.8rem; cursor: pointer; }

/* BARRA DE PACIENTE Y GÉNERO */
.patient-bar { background: #0f172a; border-bottom: 2px solid #334155; padding: 0.4rem 0.85rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.patient-selector-group { display: flex; align-items: center; gap: 0.5rem; }
.bar-label { font-size: 0.85rem; font-weight: 800; color: #38bdf8; }

.patient-dropdown {
    background: #1e293b !important;
    color: white !important;
    border: 1.5px solid #0284c7 !important;
    border-radius: 8px !important;
    padding: 0.4rem 0.75rem !important;
    font-family: var(--font) !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
}
.patient-dropdown:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5) !important;
}

.gender-toggle-group { display: flex; background: #1e293b; border-radius: 10px; padding: 2px; border: 1px solid #475569; }
.gender-btn { background: transparent; border: none; color: #94a3b8; padding: 0.35rem 0.75rem; border-radius: 8px; font-family: var(--font); font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.gender-btn.active#btnGenderBoy { background: #0284c7; color: white; }
.gender-btn.active#btnGenderGirl { background: #ec4899; color: white; }
.patient-actions-group { display: flex; gap: 0.4rem; }
.btn-patient-action { background: linear-gradient(135deg, #059669, #10b981); color: white; border: none; border-radius: 8px; padding: 0.4rem 0.75rem; font-family: var(--font); font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.btn-eval { background: linear-gradient(135deg, #0284c7, #0369a1) !important; }
.btn-plan { background: linear-gradient(135deg, #7c3aed, #6d28d9) !important; }
.btn-practice { background: linear-gradient(135deg, #d97706, #f59e0b) !important; }
.btn-lock { background: #dc2626 !important; color: white; border: none; border-radius: 8px; padding: 0.4rem 0.75rem; font-weight: 800; font-size: 0.78rem; cursor: pointer; }

/* NAV BAR */
.proloquo-nav { background: #111827; border-bottom: 2px solid #334155; padding: 0.4rem 0.85rem; display: flex; justify-content: space-between; align-items: center; }
.nav-left { display: flex; align-items: center; gap: 0.6rem; }
.mode-btn { background: #334155; color: var(--text-main); border: 2px solid #475569; border-radius: 8px; padding: 0.4rem 0.8rem; font-family: var(--font); font-weight: 800; font-size: 0.8rem; cursor: pointer; }
.mode-btn.active { background: #0284c7; border-color: #38bdf8; color: white; }
.predictive-step-indicator { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; padding: 0.3rem 0.65rem; border-radius: 8px; font-weight: 800; font-size: 0.78rem; }
.nav-right { display: flex; gap: 0.4rem; }
.nav-tab { background: #334155; color: white; border: none; border-radius: 8px; padding: 0.4rem 0.75rem; font-family: var(--font); font-weight: 800; font-size: 0.8rem; cursor: pointer; }
.btn-edit { background: #d97706 !important; }
.btn-edit.active { background: #ef4444 !important; animation: pulse 1s infinite; }
.btn-qr { background: #8b5cf6 !important; }

/* BUSCADOR */
.search-section { background: #1e293b; padding: 0.35rem 0.85rem; display: flex; gap: 0.4rem; align-items: center; }
.search-section input { flex: 1; background: #0f172a; border: 1px solid #475569; border-radius: 8px; padding: 0.4rem 0.75rem; color: white; font-family: var(--font); font-size: 0.85rem; }
.search-section button { background: #0284c7; color: white; border: none; border-radius: 8px; padding: 0.4rem 0.85rem; font-weight: 800; font-size: 0.8rem; cursor: pointer; }
.btn-reset-pred { background: #475569 !important; }

/* GRID CONTAINER DINÁMICO DE PICTOGRAMAS - MATRIZ FIJA DE 10 COLUMNAS ANCHO X 5 FILAS ALTO */
.proloquo-grid-container {
    flex: 1 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: clamp(4px, 0.7vh, 8px) clamp(6px, 0.7vw, 10px) !important;
    margin: 0px !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    height: 100% !important;
    min-height: 0 !important;
    background: #0f172a !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}
.proloquo-grid {
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(5, minmax(0, 1fr)) !important;
    gap: clamp(4px, 0.7vh, 7px) !important; /* Espacio armónico visible entre tarjetas estilo Captura 1 */
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* TARJETAS DE PICTOGRAMA - ESQUINAS REDONDEADAS Y BORDES ESTILO CAPTURA 1 */
.proloquo-tile {
    border-radius: clamp(10px, 1.4vh, 14px) !important; /* Esquinas redondeadas estilo Captura 1 */
    padding: clamp(2px, 0.4vh, 5px) clamp(3px, 0.4vw, 6px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    position: relative !important;
    border: 2px solid #334155 !important;
    box-shadow: 0 2px 7px rgba(0,0,0,0.22) !important;
    transition: opacity 160ms ease, box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease !important;
    transform: none !important;
    overflow: hidden !important;
    background: #ffffff;
}
.proloquo-tile:hover {
    box-shadow: 0 6px 14px rgba(0,0,0,0.38) !important;
    transform: translateY(-1px) !important;
}
.proloquo-tile:active { opacity: 0.85; }

/* REORDENAMIENTO DRAG & DROP MANUAL EN MODO DESBLOQUEADO */
.proloquo-tile[draggable="true"] {
    cursor: grab !important;
}
.proloquo-tile[draggable="true"]:active {
    cursor: grabbing !important;
}
.proloquo-tile.is-dragging {
    opacity: 0.4 !important;
    transform: scale(0.95) !important;
    border-style: dashed !important;
}
.proloquo-tile.drag-over-target {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 4px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.6) !important;
    transform: scale(1.05) !important;
    z-index: 10 !important;
}

/* COLORES CLÁSICOS DEL CÓDIGO FITZGERALD EN EL FONDO DE CADA CATEGORÍA (CAPTURA 1) */
.type-pronoun { background: #fef08a !important; border-color: #eab308 !important; color: #000000 !important; }
.type-verb    { background: #bbf7d0 !important; border-color: #22c55e !important; color: #000000 !important; }
.type-noun    { background: #fed7aa !important; border-color: #f97316 !important; color: #000000 !important; }
.type-adj     { background: #bfdbfe !important; border-color: #3b82f6 !important; color: #000000 !important; }
.type-social  { background: #fbcfe8 !important; border-color: #ec4899 !important; color: #000000 !important; }
.type-folder  { background: #e0f2fe !important; border-color: #0284c7 !important; color: #000000 !important; }
.type-yes     { background: #bbf7d0 !important; border-color: #16a34a !important; color: #000000 !important; }
.type-no      { background: #fecaca !important; border-color: #ef4444 !important; color: #000000 !important; }

/* SILLAS DE MATRIZ Y CUADROS GRISES PARA ESPACIOS DISPONIBLES */
.proloquo-tile.blank-slot {
    background: rgba(30, 41, 59, 0.45) !important;
    border: 2px dashed rgba(148, 163, 184, 0.35) !important;
    border-radius: clamp(10px, 1.4vh, 14px) !important;
    box-shadow: none !important;
    opacity: 0.85;
    transition: all 0.2s ease !important;
    user-select: none;
}

/* Modo Desbloqueado Terapeuta */
.proloquo-tile.blank-slot.unlocked-blank:hover {
    opacity: 1.0 !important;
    background: rgba(56, 189, 248, 0.2) !important;
    border: 2px dashed #38bdf8 !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.35) !important;
    transform: translateY(-2px) !important;
    cursor: pointer !important;
}

.proloquo-tile.blank-slot.unlocked-blank:hover .blank-plus-icon {
    color: #38bdf8 !important;
    transform: scale(1.2) !important;
}

.proloquo-tile.blank-slot.unlocked-blank:hover .blank-label {
    color: #38bdf8 !important;
}

/* BOTÓN BORRAR / REMOVER PICTOGRAMA EN CADA TARJETA EN MODO EDICIÓN */
.delete-badge {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    background: #ef4444 !important;
    color: white !important;
    font-size: 0.72rem !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 800 !important;
    z-index: 5 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.15s ease !important;
}
.delete-badge:hover {
    transform: scale(1.15) !important;
    background: #dc2626 !important;
}

/* ESTILOS PARA EL MODO INTERACTIVO MOVER PICTOGRAMAS */
.proloquo-tile.is-move-selected {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 4px #f59e0b, 0 0 25px rgba(245, 158, 11, 0.8) !important;
    transform: scale(1.08) !important;
    z-index: 100 !important;
    animation: pulseMoveSelected 1.2s infinite ease-in-out;
}

@keyframes pulseMoveSelected {
    0% { box-shadow: 0 0 0 4px #f59e0b, 0 0 15px rgba(245, 158, 11, 0.6); }
    50% { box-shadow: 0 0 0 6px #fbbf24, 0 0 28px rgba(251, 191, 36, 0.9); }
    100% { box-shadow: 0 0 0 4px #f59e0b, 0 0 15px rgba(245, 158, 11, 0.6); }
}

/* EN MODO BLOQUEADO NIÑO, OCULTAR TOTALMENTE TODOS LOS BOTONES DE CONFIGURACIÓN Y TERA PEUTA */
body.child-lock-active .therapist-elem,
body.child-lock-active .patient-bar,
body.child-lock-active .search-section,
body.child-lock-active .proloquo-nav,
body.child-lock-active .proloquo-toolbar,
body.child-lock-active .nav-tab,
body.child-lock-active .btn-edit,
body.child-lock-active .btn-qr,
body.child-lock-active #searchSection,
body.child-lock-active #patientBar,
body.child-lock-active #proloquoNav,
body.child-lock-active #proloquoToolbar {
    display: none !important;
}

/* Modo Bloqueado Niño: sin efectos de puntero ni interacción */
.proloquo-tile.blank-slot.locked-blank {
    cursor: default !important;
    border: 2px solid rgba(51, 65, 85, 0.4) !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
    pointer-events: none !important;
    background: rgba(30, 41, 59, 0.4) !important;
}

.proloquo-tile.blank-slot.locked-blank:hover {
    transform: none !important;
    box-shadow: none !important;
    background: rgba(30, 41, 59, 0.4) !important;
}

.blank-img-box {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.blank-plus-icon {
    font-size: 2rem !important;
    color: #94a3b8 !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    transition: color 0.2s ease, transform 0.2s ease !important;
}

.blank-label {
    color: #64748b !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
}



/* MARCO CONTENEDOR DE IMAGEN AMPLIA Y COMPLETAMENTE CENTRADA */
.tile-img-box {
    width: 100% !important;
    height: calc(100% - 22px) !important;
    min-height: 0 !important;
    max-height: calc(100% - 20px) !important;
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border-radius: 0px !important;
    flex-shrink: 0 !important;
}

.tile-img-box img, .tile-img, .proloquo-tile img {
    max-width: 95% !important;
    max-height: 95% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: auto !important;
    background: transparent !important;
    transform: none !important;
    mix-blend-mode: multiply;
}

.tile-label {
    font-size: clamp(0.65rem, 1.25vh, 0.88rem) !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    color: #0f172a !important;
    width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: 1px !important;
    margin-bottom: 2px !important;
    letter-spacing: -0.2px !important;
    flex-shrink: 0 !important;
    line-height: 1.1 !important;
}

@keyframes titilarPulse {
    0% {
        transform: scale(1.02) !important;
        box-shadow: 0 0 0 6px #f59e0b, 0 0 30px #f59e0b, inset 0 0 15px #facc15 !important;
        border: 4px solid #facc15 !important;
    }
    50% {
        transform: scale(1.16) !important;
        box-shadow: 0 0 0 12px #38bdf8, 0 0 50px #38bdf8, 0 0 80px #f59e0b, inset 0 0 30px #fef08a !important;
        border: 6px solid #38bdf8 !important;
        background-color: #fef08a !important;
    }
    100% {
        transform: scale(1.02) !important;
        box-shadow: 0 0 0 6px #f59e0b, 0 0 30px #f59e0b, inset 0 0 15px #facc15 !important;
        border: 4px solid #facc15 !important;
    }
}

.proloquo-tile.priority-session-target { border-color: #38bdf8 !important; box-shadow: 0 0 0 4px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.6) !important; }
.proloquo-tile.guided-target-glow {
    animation: titilarPulse 0.6s infinite ease-in-out !important;
    z-index: 1000 !important;
    position: relative !important;
}

/* ARQUITECTURA DE ATENUACIÓN PREDICTIVA */
.proloquo-grid.is-predicting .proloquo-tile.is-attenuated {
    opacity: 0.35 !important;
    filter: grayscale(15%);
}

.proloquo-grid.is-predicting .proloquo-tile.is-predicted {
    opacity: 1.0 !important;
    box-shadow: 0 0 0 3px #38bdf8, 0 0 15px rgba(56, 189, 248, 0.6) !important;
    border-color: #38bdf8 !important;
}

/* TOOLBAR */
@keyframes fallSerpentina {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

.proloquo-toolbar {
    background: #0f172a !important;
    border-top: 2px solid #334155 !important;
    padding: 0.3rem 0.65rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.toolbar-group {
    display: flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
}

.tool-btn {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 8px !important;
    color: #cbd5e1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 0.25rem 0.55rem !important;
    font-family: var(--font) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    white-space: nowrap !important;
}
.tool-btn:hover {
    background: #334155 !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}
.tool-btn.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
}
.tool-btn .tool-icon {
    font-size: 1.1rem !important;
    line-height: 1 !important;
}

.btn-lock-tool {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}
.btn-lock-tool:hover {
    background: #b91c1c !important;
}

.btn-save-tool {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}
.btn-save-tool:hover {
    background: #047857 !important;
}

.btn-qr-tool {
    background: #7c3aed !important;
    color: #ffffff !important;
    border-color: #8b5cf6 !important;
}
.btn-qr-tool:hover {
    background: #6d28d9 !important;
}

.btn-edit-tool {
    background: #d97706 !important;
    color: #ffffff !important;
    border-color: #f59e0b !important;
}
.btn-edit-tool.active {
    background: #ef4444 !important;
    border-color: #f87171 !important;
    animation: pulse 1s infinite;
}

.status-indicator { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; color: #94a3b8; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.status-dot.connected { background: #22c55e; box-shadow: 0 0 8px #22c55e; }

/* ELIMINACIÓN TOTAL DEL BOTÓN FLOTANTE MODIFICAR PACIENTE EN EL COMUNICADOR */
#corrigeteaPatientEditFloater,
.btn-modify-patient,
[id*="PatientEditFloater"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* MODALES & CAPAS FLOTANTES - RESPONSIVE 100% SIN DESBORDAMIENTOS (SE ADAPTAN CON CUALQUIER ZOOM) */

.modal-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(8px) !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1000000 !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}
.modal-overlay.active {
    display: flex !important;
}

.proloquo-modal, .modal-card {
    background: #1e293b !important;
    border: 3px solid #0284c7 !important;
    border-radius: 20px !important;
    width: 580px !important;
    max-width: min(94vw, 580px) !important;
    max-height: calc(100vh - 2rem) !important;
    max-height: calc(100dvh - 2rem) !important;
    display: flex !important;
    flex-direction: column !important;
    color: white !important;
    padding: 1.25rem 1.5rem !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.85) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: auto !important;
    position: relative !important;
}

.modal-large {
    width: 840px !important;
    max-width: min(95vw, 840px) !important;
}

.modal-xlarge {
    width: 980px !important;
    max-width: min(96vw, 980px) !important;
}

.modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #334155 !important;
    padding-bottom: 0.65rem !important;
    margin-bottom: 0.85rem !important;
    flex-shrink: 0 !important;
}

.modal-header h3 {
    margin: 0 !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
}

.close-btn {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 1.8rem !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 0.25rem !important;
    transition: color 0.15s ease !important;
}

.close-btn:hover {
    color: #ef4444 !important;
}

.modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 6px !important;
    box-sizing: border-box !important;
}

.modal-body::-webkit-scrollbar {
    width: 8px !important;
}

.modal-body::-webkit-scrollbar-track {
    background: #0f172a !important;
    border-radius: 4px !important;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #334155 !important;
    border-radius: 4px !important;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #0284c7 !important;
}

.modal-footer {
    flex-shrink: 0 !important;
    border-top: 2px solid #334155 !important;
    padding-top: 0.75rem !important;
    margin-top: 0.75rem !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.eval-tabs-nav { flex-shrink: 0 !important; display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.5rem; border-bottom: 1px solid #334155; margin-bottom: 0.65rem; }
.eval-nav-btn { background: #0f172a; color: #94a3b8; border: 1px solid #475569; border-radius: 8px; padding: 0.4rem 0.8rem; font-family: var(--font); font-weight: 700; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.eval-nav-btn.active { background: #0284c7; color: white; border-color: #38bdf8; }

.eval-tab-body {
    flex: 1 !important; min-height: 0 !important; overflow-y: auto !important;
    max-height: calc(85vh - 200px) !important; background: #0f172a; border-radius: 12px; padding: 1rem; border: 1px solid #334155;
}
.eval-item-card { background: #1e293b; border-radius: 10px; padding: 0.85rem; margin-bottom: 0.75rem; border: 1px solid #334155; }
.eval-question-title { font-size: 0.9rem; font-weight: 800; color: #f8fafc; margin-bottom: 0.4rem; }
.eval-status-options { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.eval-opt-label { font-size: 0.78rem; font-weight: 700; background: #0f172a; padding: 0.3rem 0.6rem; border-radius: 6px; border: 1px solid #475569; cursor: pointer; }

.btn-save-eval { background: linear-gradient(135deg, #059669, #10b981); color: white; border: none; border-radius: 10px; padding: 0.75rem 1.5rem; font-family: var(--font); font-weight: 800; font-size: 0.9rem; cursor: pointer; width: 100%; }

.form-group { margin-bottom: 0.85rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 800; color: #38bdf8; margin-bottom: 0.35rem; }
.form-control { width: 100%; background: #0f172a; border: 1px solid #475569; border-radius: 8px; padding: 0.5rem 0.75rem; color: white; font-family: var(--font); font-size: 0.85rem; }

.form-row { display: flex; gap: 0.75rem; }
.col-6 { flex: 1; }

.planner-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.btn-save-session-plan { background: #7c3aed; color: white; border: none; border-radius: 8px; padding: 0.65rem 1.2rem; font-weight: 800; font-size: 0.85rem; cursor: pointer; flex: 1; }
.btn-activate-session-board { background: #0284c7; color: white; border: none; border-radius: 8px; padding: 0.65rem 1.2rem; font-weight: 800; font-size: 0.85rem; cursor: pointer; flex: 1; }

.practice-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.practice-card { background: #0f172a; border: 2px solid #334155; border-radius: 14px; padding: 1rem; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; transition: all 0.15s ease; }
.practice-card:hover { border-color: #f59e0b; background: #1e293b; }
.practice-card-icon { font-size: 2rem; }
.practice-card-content { flex: 1; }
.practice-card-content h4 { color: #fef08a; font-size: 0.95rem; margin-bottom: 0.2rem; }
.practice-card-content p { color: #94a3b8; font-size: 0.8rem; }
.btn-start-ex { background: #f59e0b; color: #0f172a; border: none; border-radius: 8px; padding: 0.4rem 0.8rem; font-weight: 800; font-size: 0.78rem; cursor: pointer; }

/* MÓDULO DE PRÁCTICA GUIADA COMPLETADO EN VERDE / DORADO */
.practice-card.is-completed {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.9), rgba(15, 23, 42, 0.95)) !important;
    border: 2px solid #10b981 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3) !important;
}
.practice-card.is-completed h4 {
    color: #34d399 !important;
}
.completed-tag {
    display: inline-block;
    background: #059669;
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.3rem;
}

/* BOTÓN DE DESBLOQUEO INVISIBLE PARA MODO CANDADO NIÑO */
.btn-unlock-invisible {
    position: fixed !important;
    top: 0 !important; right: 0 !important;
    width: 60px !important; height: 60px !important;
    background: transparent !important;
    border: none !important; outline: none !important; box-shadow: none !important;
    z-index: 999999 !important; cursor: pointer !important;
}

/* ESTILOS QR LIMPIO DE ALTO CONTRASTE */
.qr-code-wrapper { display: flex; justify-content: center; align-items: center; padding: 1rem; }
.qr-clean-box { background: #ffffff !important; padding: 18px !important; border-radius: 16px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important; display: inline-block !important; }
.qr-clean-box img { display: block !important; margin: 0 auto !important; border-radius: 4px; width: 260px !important; height: 260px !important; }
.qr-clean-box canvas { display: block !important; margin: 0 auto !important; max-width: 100% !important; height: auto !important; }


/* ESTILOS DEL SELECTOR VISUAL DE IMÁGENES */
.picker-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    max-height: 380px;
    overflow-y: auto;
    background: #0f172a;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid #334155;
}

.picker-img-card {
    background: #ffffff;
    border: 2px solid #0284c7;
    border-radius: 12px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.picker-img-card:hover {
    transform: scale(1.05);
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}
.picker-img-card img {
    width: 65px; height: 65px; object-fit: contain;
}
.picker-img-card span {
    font-size: 0.7rem; font-weight: 800; color: #0f172a; margin-top: 0.3rem;
}




/* GARANTÍA DE ADAPTACIÓN MATRIZ 10x5 SIN DESBORDAMIENTO NI SCROLLBAR */
.proloquo-grid {
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(5, minmax(0, 1fr)) !important;
    gap: clamp(4px, 0.7vh, 7px) !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
}

.proloquo-tile {
    aspect-ratio: auto !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    border-radius: clamp(10px, 1.4vh, 14px) !important;
}




/* ZONA TÁCTIL DE DESBLOQUEO CANDADO (3S) PARA TABLETS */
.btn-unlock-touch-zone {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 70px !important;
    height: 70px !important;
    z-index: 999999 !important;
    background: transparent;
    border-bottom-left-radius: 20px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: pointer !important;
}


/* ESTILOS PROFESIONALES DE IMPRESIÓN IMPRESA EN HOJA BLANCA PARA REPORTE CLÍNICO */
@media print {
    body, html {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
    }
    
    /* Ocultar toda la interfaz de la aplicación al imprimir */
    header, footer, nav, .proloquo-app-container, .proloquo-message-window, .patient-bar, .proloquo-nav, .search-section, .proloquo-grid-container, .proloquo-toolbar, .modal-header, .eval-nav-tabs, .modal-footer, .close-btn, button {
        display: none !important;
    }

    /* Mostrar únicamente la tarjeta del reporte clínico limpio */
    .modal-overlay {
        position: static !important;
        background: transparent !important;
        display: block !important;
        padding: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    .modal-card, .proloquo-modal {
        position: static !important;
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #evalTabContent {
        max-height: none !important;
        overflow: visible !important;
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        padding: 0 !important;
    }

    .print-clinical-report {
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .print-clinical-report table {
        width: 100% !important;
        border-collapse: collapse !important;
        color: #000000 !important;
        font-size: 10pt !important;
        margin-top: 1rem !important;
    }

    .print-clinical-report th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1.5px solid #475569 !important;
        padding: 6px 8px !important;
        font-weight: 800 !important;
    }

    .print-clinical-report td {
        border: 1px solid #64748b !important;
        color: #0f172a !important;
        padding: 6px 8px !important;
    }

    .print-header-letterhead {
        border-bottom: 2px solid #0f172a !important;
        padding-bottom: 0.75rem !important;
        margin-bottom: 1.25rem !important;
    }
}


.modal-panoramic {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 92vh !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.25rem !important;
}

#pragmaticEvalModal .modal-card {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 92vh !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.25rem !important;
}

#evalTabContent {
    flex: 1 !important;
    max-height: calc(92vh - 160px) !important;
    overflow-y: auto !important;
}

/* GARANTÍA DE PARIDAD TOTAL 100% SIN RESTRICCIONES PARA TABLETAS (IDÉNTICO A LA COMPUTADORA) */
body:not(.child-lock-active) .patient-bar,
body:not(.child-lock-active) .search-section,
body:not(.child-lock-active) .proloquo-nav,
body:not(.child-lock-active) .therapist-elem {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

body:not(.child-lock-active) button,
body:not(.child-lock-active) select,
body:not(.child-lock-active) input {
    pointer-events: auto !important;
}

/* GARANTÍA DE INTERACCIÓN TÁCTIL NATIVA PARA MENÚS DESPLEGABLES EN TABLETAS */
select, option, #patientSelect, #voiceTypeSelect {
    -webkit-user-select: auto !important;
    -khtml-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
    -webkit-touch-callout: default !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    position: relative !important;
}

.patient-selector-group, .nickname-group, .voice-profile-group {
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

/* GARANTÍA DE ALINEACIÓN DE ALTURA TOTAL Y PANTALLA COMPLETA 100% EN CUALQUIER RESOLUCIÓN O ZOOM */
html, body, .proloquo-app {
    height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
