        /* Estilos existentes */
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: #f0f2f5;
            margin: 0;
            padding: 12px;
        }
        #root {
            max-width: 600px;
            margin: 0 auto;
            padding: 5px;
        }
        h1 {
            color: #333;
            text-align: center;
        }
        input[type="text"], input[type="password"] {
            width: 70%;
            padding: 10px;
            margin-right: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px; /* Añadida línea */
        }
        button {
            padding: 10px 15px;
            background-color: #6367ab;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            margin: 5px;
        }
        button:hover {
            background-color: #50549e;
        }
        ul {
            list-style-type: none;
            padding: 0;
        }
        li {
            background-color: #f9f9f9;
            margin: 10px 0;
            padding: 10px;
            border-radius: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .delete-btn {
            background: #fee2e2;
            color: #dc2626;
            padding: 8px 14px;
            border-radius: 8px;
            font-weight: 600;
        }
        .delete-btn:hover, .delete-btn:active {
            background: #fca5a5;
        }
        .error {
            color: red;
            margin-bottom: 10px;
        }
        .loading {
            text-align: center;
            font-style: italic;
            color: #666;
        }
        .login-form {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-top: 20px;
        }
        .login-form input {
            margin-bottom: 10px;
        }

        /* Estilos para el modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .modal-content {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            max-width: 500px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            border-bottom: 1px solid #ddd; /* Línea de separación */
        }
        .modal-close {
            background: none; /* Sin fondo */
            border: none;     /* Sin borde */
            font-size: 1.5rem;
            cursor: pointer;
            color: #333;      /* Color del texto */
            padding: 5px;     /* Aumentado padding */
            margin-left: 10px; /* Margen ajustado */
        }
        .modal-close:hover {
            color: #ff0000;   /* Color al pasar el cursor */
        }
        .ingredient-list {
            list-style-type: none;
            padding: 0;
        }
        .ingredient-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            padding: 10px;
            background-color: #f0f0f0;
            border-radius: 4px;
        }
        .ingredient-actions {
            display: flex;
            gap: 10px;
        }
        .btn {
            padding: 5px 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .btn-primary {
            background-color: #007bff;
            color: white;
        }
        .btn-secondary {
            background-color: #6c757d;
            color: white;
        }
        .btn-danger {
            background-color: #dc3545;
            color: white;
        }
        .ingredient-input {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        .ingredient-input input {
            flex-grow: 1;
            padding: 5px;
            border: 1px solid #ced4da;
            border-radius: 4px;
        }

        /* Estilos responsivos */
        @media (max-width: 768px) {
            .item-container {
                padding: 12px;
            }

            .item-name {
                font-size: 18px;
            }

            .delete-btn {
                padding: 10px 16px;
                font-size: 15px;
            }
        }

        /* Estilos para el botón de micrófono */
        .mic-button {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 60px;
            height: 60px;
            background-color: #6367ab;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            display: flex;
            justify-content: center;
            align-items: center;
            transition: background-color 0.3s, transform 0.3s;
            z-index: 1000; /* Por encima de otros elementos */
        }

        .mic-button:hover {
            background-color: #50549e;
            transform: scale(1.1);
        }

        .mic-button:active {
            background-color: #3f4378;
        }

        .mic-icon {
            width: 30px;
            height: 30px;
            fill: white;
            transition: transform 0.3s;
        }

        .mic-button.listening .mic-icon {
            transform: scale(1.2);
            animation: pulse 1s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1.2); }
            50% { transform: scale(1.4); }
            100% { transform: scale(1.2); }
        }

        /* Estilos para el modal de confirmación */
        .confirmation-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000; /* Por encima de otros elementos */
        }

        .confirmation-modal-content {
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
            text-align: center;
        }

        .confirmation-modal-buttons {
            margin-top: 20px;
        }

        .confirmation-modal-buttons button {
            margin: 0 10px;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        .confirmation-modal-buttons .confirm-btn {
            background-color: #dc3545; /* Rojo para confirmar */
            color: #fff;
        }

        .confirmation-modal-buttons .cancel-btn {
            background-color: #6c757d; /* Gris para cancelar */
            color: #fff;
        }

        /* Otros estilos adicionales */
        .category {
            margin-bottom: 16px;
            background: white;
            padding: 14px;
            border-radius: 14px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            border-left: 5px solid #6367ab;
        }

        .category h2 {
            margin: 0 0 12px;
            cursor: pointer;
            font-size: 1.1rem;
            color: #333;
            padding-bottom: 8px;
            border-bottom: 1px solid #f0f0f0;
        }

        .category ul {
            padding: 0;
            margin: 0;
        }

        .item-container {
            display: flex;
            align-items: center;
            margin-bottom: 6px;
            padding: 10px 12px;
            background: #f8f9fa;
            border-radius: 10px;
            transition: background 0.2s;
        }

        .item-container:active {
            background: #e9ecef;
        }

        .move-btn {
            margin-right: 10px;
            background: none;
            border: none;
            width: 32px;
            height: 32px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            font-size: 18px;
            border-radius: 8px;
            transition: background 0.2s;
        }

        .move-btn:active {
            background: #dee2e6;
        }

        .item-name {
            flex-grow: 1;
            margin-right: 10px;
            cursor: pointer;
            font-size: 17px;
            color: #222;
        }

        .delete-btn {
            background: #fee2e2;
            color: #dc2626;
            border: none;
            padding: 8px 14px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: background 0.2s;
        }

        .delete-btn:active {
            background: #fca5a5;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000; 
        }

        .modal-content {
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
        }

        .ingredient-input {
            display: flex;
            margin-bottom: 10px;
        }

        .ingredient-input input {
            flex-grow: 1;
            margin-right: 10px;
        }

        .ingredient-actions button {
            margin-left: 10px;
            padding: 5px 10px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        .btn-primary {
            background-color: #007bff;
            color: #fff;
        }

        .btn-secondary {
            background-color: #6c757d;
            color: #fff;
        }

        .btn-danger {
            background-color: #dc3545;
            color: #fff;
        }

        .loading {
            text-align: center;
            font-style: italic;
        }

        /* Modal Recetas */
        .recipe-overlay { z-index: 1001; }

        /* Selector de ingredientes */
        .picking-overlay {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); display: flex;
            justify-content: center; align-items: center;
            z-index: 20; border-radius: inherit;
        }
        .picking-modal {
            background: white; border-radius: 12px; padding: 16px;
            width: 90%; max-height: 80%; display: flex; flex-direction: column;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .picking-list {
            flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
        }
        .picking-item {
            display: flex; align-items: center; gap: 10px;
            padding: 10px; margin-bottom: 4px; border-radius: 8px;
            cursor: pointer; border: 2px solid #eee; transition: all 0.15s;
        }
        .picking-item.selected {
            background: #eafaf1; border-color: #27ae60;
        }
        .picking-check { font-size: 20px; }
        .picking-name { flex: 1; font-size: 16px; }
        .picking-qty { font-size: 14px; color: #666; }

        /* Overlay cocinando */
        .cooking-overlay {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(255,255,255,0.92);
            display: flex; justify-content: center; align-items: center;
            z-index: 10; border-radius: inherit;
            animation: cookFadeIn 0.3s ease;
        }
        @keyframes cookFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .cooking-content { text-align: center; }
        .cooking-emoji {
            font-size: 60px;
            animation: cookBounce 1s infinite;
        }
        @keyframes cookBounce {
            0%, 100% { transform: translateY(0) rotate(0deg); }
            25% { transform: translateY(-15px) rotate(-5deg); }
            50% { transform: translateY(0) rotate(0deg); }
            75% { transform: translateY(-10px) rotate(5deg); }
        }
        .cooking-text {
            font-size: 20px; font-weight: 700; color: #333;
            margin: 15px 0 5px;
        }
        .cooking-dots span {
            font-size: 30px; font-weight: bold; color: #6367ab;
            animation: cookDot 1.4s infinite;
            display: inline-block;
        }
        .cooking-dots span:nth-child(2) { animation-delay: 0.2s; }
        .cooking-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes cookDot {
            0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
            40% { opacity: 1; transform: scale(1.2); }
        }
        .recipe-modal { max-width: 550px; overflow-x: hidden; position: relative; }
        .recipe-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #ddd;
        }
        .recipe-header h2 { margin: 0; font-size: 1.3rem; }
        .recipe-list-scroll, .recipe-form-scroll {
            max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
        }
        .recipe-card-simple {
            background: #f9f9f9; border-radius: 10px; padding: 12px;
            margin-bottom: 10px; border-left: 4px solid #27ae60;
        }
        .recipe-card-top-row {
            display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
        }
        .recipe-card-name { font-size: 18px; font-weight: 600; }
        .recipe-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .recipe-btn-green {
            padding: 10px 14px; background: #27ae60; color: white;
            border: none; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600;
        }
        .recipe-btn-blue {
            padding: 10px 14px; background: #6367ab; color: white;
            border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
        }
        .recipe-btn-red {
            padding: 10px 14px; background: #e74c3c; color: white;
            border: none; border-radius: 8px; font-size: 15px; cursor: pointer;
        }
        .recipe-btn-new {
            width: 100%; padding: 14px; background: #27ae60; color: white;
            border: none; border-radius: 10px; font-size: 18px; font-weight: 700;
            cursor: pointer; margin-top: 10px;
        }
        .recipe-btn-ai {
            width: 90%; padding: 14px; background: #6367ab; color: white;
            border: none; border-radius: 10px; font-size: 18px; font-weight: 700;
            cursor: pointer; margin: 0 auto 10px; display: block;
        }
        .recipe-btn-ai:disabled { background: #aaa; }
        .recipe-btn-save {
            width: 100%; padding: 14px; background: #27ae60; color: white;
            border: none; border-radius: 10px; font-size: 18px; font-weight: 700;
            cursor: pointer; margin-top: 15px;
        }
        .recipe-btn-save:disabled { background: #aaa; }
        .recipe-diff-row { display: flex; gap: 8px; margin-bottom: 10px; }
        .recipe-diff {
            flex: 1; padding: 10px; border: 2px solid #999; border-radius: 8px;
            background: #f0f0f0; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center;
            color: #222;
        }
        .active-facil { background: #27ae60; border-color: #27ae60; color: white; }
        .active-media { background: #e67e22; border-color: #e67e22; color: white; }
        .active-dificil { background: #e74c3c; border-color: #e74c3c; color: white; }

        @media (max-width: 768px) {
            .recipe-overlay {
                padding: 0;
            }
            .recipe-modal {
                position: fixed; top: 0; left: 0; right: 0; bottom: 0;
                max-width: 100%; max-height: 100%;
                width: 100%; height: 100%;
                border-radius: 0; display: flex; flex-direction: column;
                padding: 10px; box-sizing: border-box;
                overflow: hidden;
            }
            .recipe-modal .recipe-header { flex-shrink: 0; }
            .recipe-list-scroll, .recipe-form-scroll {
                flex: 1; max-height: none;
                overflow-y: auto; overflow-x: hidden;
                -webkit-overflow-scrolling: touch;
            }
            .recipe-btn-new { flex-shrink: 0; }
            .recipe-btn-save { flex-shrink: 0; }
            .recipe-form-scroll input,
            .recipe-form-scroll textarea {
                max-width: 100%; box-sizing: border-box;
            }
        }

        /* Valoraciones de productos */
        .review-overlay {
            z-index: 1001;
        }
        .review-modal {
            max-width: 550px;
        }
        @media (max-width: 768px) {
            .review-modal {
                position: fixed;
                top: 0; left: 0; right: 0; bottom: 0;
                max-width: 100%;
                max-height: 100%;
                width: 100%;
                height: 100%;
                border-radius: 0;
                display: flex;
                flex-direction: column;
                padding: 10px;
                box-sizing: border-box;
            }
            .review-modal .modal-header {
                flex-shrink: 0;
            }
            .review-modal .review-form {
                flex-shrink: 0;
            }
            .review-modal .review-filters {
                flex-shrink: 0;
            }
            .review-modal .review-list-container {
                flex: 1;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            .review-overlay {
                padding: 0;
            }
        }
        .review-form {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ddd;
        }
        .review-mensaje {
            text-align: center;
            padding: 6px;
            margin-bottom: 8px;
            background: #eef;
            border-radius: 6px;
            font-size: 14px;
            color: #333;
        }
        .review-form input[type="text"] {
            width: 100%;
            padding: 10px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            box-sizing: border-box;
        }
        .foto-label-big {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 50px;
            background: #f0f0f0;
            border: 2px dashed #aaa;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            color: #666;
            text-align: center;
            padding: 8px;
            box-sizing: border-box;
        }
        .foto-preview-big {
            max-width: 100%;
            max-height: 80px;
            object-fit: contain;
            border-radius: 6px;
        }
        .review-big-btns {
            display: flex;
            gap: 10px;
        }
        .big-btn {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-size: 20px;
            font-weight: bold;
            color: white;
            letter-spacing: 1px;
        }
        .big-bueno { background: #27ae60; }
        .big-bueno:hover { background: #219a52; }
        .big-bueno:disabled { background: #95d5b2; }
        .big-malo { background: #e74c3c; }
        .big-malo:hover { background: #c0392b; }
        .big-malo:disabled { background: #f5b7b1; }
        .review-filters {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }
        .review-filters select {
            flex: 1;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        .review-super-group {
            margin-bottom: 15px;
        }
        .review-super-group h3 {
            margin: 0 0 8px;
            padding-bottom: 5px;
            border-bottom: 2px solid #6367ab;
            color: #333;
        }
        .review-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            margin-bottom: 5px;
            border-radius: 6px;
            border-left: 4px solid;
        }
        .review-item.bueno {
            background: #eafaf1;
            border-left-color: #27ae60;
        }
        .review-item.malo {
            background: #fdedec;
            border-left-color: #e74c3c;
        }
        .review-item-info {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .review-icon { font-size: 20px; }
        .review-nombre { font-weight: 500; }
        .review-thumb {
            width: 40px;
            height: 40px;
            object-fit: cover;
            border-radius: 4px;
            cursor: pointer;
        }
        .btn-sm {
            padding: 3px 8px;
            font-size: 12px;
        }
        .foto-ampliada-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            cursor: pointer;
        }
        .foto-ampliada {
            max-width: 90vw;
            max-height: 90vh;
            border-radius: 8px;
        }